view src/main/linux/SDL_Qtopia_main.cc @ 750:ce48d14ca5bf

Date: Mon, 24 Nov 2003 20:11:31 +0000 From: John Drinkwater <john@nextraweb.com> Subject: SDL configure.in patch On my cygwin compile environment, I get a script error with configure. $ ./configure --enable-debug=no -q; appending configuration tag "CXX" to libtool appending configuration tag "F77" to libtool ./configure: line 28135: : command not found *snip the rest* The supplied patch fixes the problem, just a minor oversight of some [ ] & t\ est.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 24 Nov 2003 21:57:13 +0000
parents 0648505b1f8b
children
line wrap: on
line source


/* Include the SDL main definition header */
#include "SDL_main.h"
#include <stdlib.h>
#include <unistd.h>
#ifdef main
#undef main
#endif
#ifdef QWS
#include <qpe/qpeapplication.h>
#include <qapplication.h>
#include <qpe/qpeapplication.h>
#include <stdlib.h>

// Workaround for OPIE to remove taskbar icon. Also fixes
// some issues in Qtopia where there are left-over qcop files in /tmp/.
// I'm guessing this will also clean up the taskbar in the Sharp version
// of Qtopia.
static inline void cleanupQCop() {
  QString appname(qApp->argv()[0]);
  int slash = appname.findRev("/");
  if(slash != -1) {  appname = appname.mid(slash+1); }
  QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'";
  system(cmd.latin1());
  cmd = "/tmp/qcop-msg-"+appname;
  unlink(cmd.latin1());
}

static QPEApplication *app;
#endif

extern int SDL_main(int argc, char *argv[]);

int main(int argc, char *argv[])
{
#ifdef QWS
  // This initializes the Qtopia application. It needs to be done here
  // because it parses command line options.
  app = new QPEApplication(argc, argv);
  QWidget dummy;
  app->showMainWidget(&dummy);
  atexit(cleanupQCop);
#endif
  // Exit here because if return is used, the application
  // doesn't seem to quit correctly.
  exit(SDL_main(argc, argv));
}