[Scummvm-devel] OSystem::displayLogFile()

Max Horn max at quendi.de
Fri Jun 3 17:57:06 CEST 2011


Am 03.06.2011 um 17:22 schrieb Alex Bevilacqua:

> Couldn't you do something along the lines of:
> 
> xterm -e less $PATH_TO_SCUMMVM_LOG
> 
> I'm assuming both commands are available (by default) on all *NIX distros. I was going to recommend a GUI message + xclip, but xclip isn't installed by default :P

Sure, that could be one of the fallbacks. But I know that *I* certainly would prefer if xdg-open was tried first... but then, I am not primarily a Linux user anyway ;). 

Anyway, I imagine something like this could work:

bool OSystem_POSIX::hasFeature(Feature f) {
  if (f == kFeatureDisplayLogFile)
    return true;
  return OSystem_SDL::hasFeature(f);
}

bool OSystem_POSIX::displayLogFile() {
  if (_logFilePath.empty())
    return false;
  int res = system("xdg-open '%s' || xterm -e less '%s'", _logFilePath.c_str(), _logFilePath.c_str());
  return res != 0;
}


Anyway, we can just implement one solution now, and fine tune it later. Let's build the bikeshed before we argue how to paint it ;).


Cheers,
Max



More information about the Scummvm-devel mailing list