From 4c87b6256dcaa2fc16568fcdb4d7a83f840cccd1 Mon Sep 17 00:00:00 2001 From: eshe Date: Thu, 27 May 2010 15:18:38 +0100 Subject: [PATCH] Fixed an error in settings dialog that caused app to segfault on arm. Changed init script to start daemon as user instead of root. Added small fixes to postinst etc. scripts. --- Makefile | 76 +++++++++++------------ debian/control | 2 +- debian/postinst | 3 +- debian/postrm | 10 +-- debian/preinst | 2 +- debian/prerm | 2 +- src/daemon/Makefile | 147 ++++++++++++++++++++++---------------------- src/daemon/data/jenirokd | 27 ++++---- src/daemon/main.cpp | 11 ++++ src/gui/Makefile | 133 ++++++++++++++++++++------------------- src/gui/daemon.cpp | 29 +-------- src/gui/settingsdialog.cpp | 21 +++---- 12 files changed, 220 insertions(+), 243 deletions(-) diff --git a/Makefile b/Makefile index bf8ed45..f1878b8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: jenirok -# Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Apr 17 12:38:18 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Thu May 27 14:38:01 2010 # Project: jenirok.pro # Template: subdirs # Command: /usr/bin/qmake -unix -o Makefile jenirok.pro @@ -73,45 +73,43 @@ sub-src-daemon-install_subtargets: src/daemon/$(MAKEFILE) FORCE sub-src-daemon-uninstall_subtargets: src/daemon/$(MAKEFILE) FORCE cd src/daemon/ && $(MAKE) -f $(MAKEFILE) uninstall -Makefile: jenirok.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qmake.conf /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf +Makefile: jenirok.pro /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf $(QMAKE) -unix -o Makefile jenirok.pro -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf: qmake: qmake_all FORCE @$(QMAKE) -unix -o Makefile jenirok.pro diff --git a/debian/control b/debian/control index 6db7d1e..f979bff 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.7.2 Package: jenirok Architecture: any -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, libqt4-sql-sqlite Description: Searches unknown callers with Eniro's person search. Jenirok finds unknown callers' details using Eniro person search. Person search diff --git a/debian/postinst b/debian/postinst index 3eb2f3c..3c024db 100644 --- a/debian/postinst +++ b/debian/postinst @@ -3,8 +3,7 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor # Make jenirok autostart on boot if this is a new install -oldversion="$2" -if [ -z "$oldversion" ]; then +if [ -z "$2" ]; then update-rc.d jenirokd defaults 99 >/dev/null fi diff --git a/debian/postrm b/debian/postrm index b479182..a0d93df 100644 --- a/debian/postrm +++ b/debian/postrm @@ -1,7 +1,9 @@ -#!/bin/sh -e +#!/bin/sh -rm -f /home/user/.jenirok.db -update-rc.d -f jenirokd remove +# Remove database and init scripts if app was removed +if [ "$1" == "purge" ] || [ "$1" == "remove" ]; then + rm -f /home/user/.jenirok.db + update-rc.d -f jenirokd remove >/dev/null 2>&1 +fi exit 0 - diff --git a/debian/preinst b/debian/preinst index e672a47..768a4bb 100644 --- a/debian/preinst +++ b/debian/preinst @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh /etc/init.d/jenirokd stop >/dev/null 2>&1 diff --git a/debian/prerm b/debian/prerm index e672a47..768a4bb 100644 --- a/debian/prerm +++ b/debian/prerm @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh /etc/init.d/jenirokd stop >/dev/null 2>&1 diff --git a/src/daemon/Makefile b/src/daemon/Makefile index a1974a5..2849096 100644 --- a/src/daemon/Makefile +++ b/src/daemon/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: jenirokd -# Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Apr 17 16:35:57 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Thu May 27 17:06:03 2010 # Project: daemon.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile daemon.pro @@ -10,12 +10,12 @@ CC = gcc CXX = g++ -DEFINES = -DDATADIR=\"/usr/share\" -DPKGDATADIR=\"\" -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) -CXXFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) -INCPATH = -I/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++ -I. -I/targets/FREMANTLE_X86/usr/include/QtCore -I/targets/FREMANTLE_X86/usr/include/QtNetwork -I/targets/FREMANTLE_X86/usr/include/QtGui -I/targets/FREMANTLE_X86/usr/include/QtSql -I/targets/FREMANTLE_X86/usr/include/QtMaemo5 -I/targets/FREMANTLE_X86/usr/include -I/targets/FREMANTLE_X86/usr/include/QtDBus -I../common -I. +DEFINES = -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024 -DDATADIR=\"/usr/share\" -DPKGDATADIR=\"\" -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5 -I. -I/targets/FREMANTLE_ARMEL/usr/include/QtCore -I/targets/FREMANTLE_ARMEL/usr/include/QtNetwork -I/targets/FREMANTLE_ARMEL/usr/include/QtGui -I/targets/FREMANTLE_ARMEL/usr/include/QtSql -I/targets/FREMANTLE_ARMEL/usr/include/QtMaemo5 -I/targets/FREMANTLE_ARMEL/usr/include -I/targets/FREMANTLE_ARMEL/usr/include/QtDBus -I../common -I. LINK = g++ -LFLAGS = -Wl,-O1 -Wl,-rpath,/usr/lib +LFLAGS = -Wl,-rpath-link,/usr/lib -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath,/usr/lib LIBS = $(SUBLIBS) -L/usr/lib -lebook-1.2 -ledataserver-1.2 -lxml2 -lgconf-2 -ldbus-glib-1 -lconic -ldbus-1 -lgobject-2.0 -lglib-2.0 -L/usr/lib -lQtMaemo5 -L/usr/X11R6/lib -lQtSql -lQtGui -lQtNetwork -lQtDBus -lQtXml -lQtCore -lpthread AR = ar cqs RANLIB = @@ -70,29 +70,28 @@ OBJECTS = main.o \ moc_eniro.o \ moc_connectionmanager.o \ qrc_translations.o -DIST = /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qdbus.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusadaptors.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ +DIST = /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qdbus.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \ daemon.pro QMAKE_TARGET = jenirokd DESTDIR = @@ -125,29 +124,28 @@ all: Makefile $(TARGET) $(TARGET): $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) -Makefile: daemon.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qmake.conf /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qdbus.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusadaptors.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ +Makefile: daemon.pro /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qdbus.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/lib/libQtDBus.prl \ /usr/lib/libQtXml.prl \ /usr/lib/libQtCore.prl \ @@ -156,29 +154,28 @@ Makefile: daemon.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qma /usr/lib/libQtSql.prl \ /usr/lib/libQtNetwork.prl $(QMAKE) -unix -o Makefile daemon.pro -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qdbus.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusinterfaces.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusadaptors.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/link_pkgconfig.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qdbus.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf: /usr/lib/libQtDBus.prl: /usr/lib/libQtXml.prl: /usr/lib/libQtCore.prl: diff --git a/src/daemon/data/jenirokd b/src/daemon/data/jenirokd index 4be7cda..c5edb44 100755 --- a/src/daemon/data/jenirokd +++ b/src/daemon/data/jenirokd @@ -2,25 +2,31 @@ NAME=jenirokd DAEMON=/usr/bin/jenirokd +DAEMONUSER=user +PIDFILE=/tmp/jenirokd.pid +PARAMS="" + +if [ "$2" == "manual" ]; then + PARAMS=manual +fi export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" case "$1" in start) - echo -n "Starting daemon: "$NAME - start-stop-daemon --start --background --exec $DAEMON - echo "." + echo "Starting daemon: "$NAME + start-stop-daemon --start -c $DAEMONUSER --background --pidfile $PIDFILE --make-pidfile --exec $DAEMON $PARAMS + chown $DAEMONUSER $PIDFILE ;; stop) - echo -n "Stopping daemon: "$NAME - start-stop-daemon --stop --oknodo --name $NAME - echo "." + echo "Stopping daemon: "$NAME + start-stop-daemon --stop --user $DAEMONUSER --oknodo --pidfile $PIDFILE ;; restart) - echo -n "Restarting daemon: "$NAME - start-stop-daemon --stop --quiet --oknodo --retry 30 --name $NAME - start-stop-daemon --start --quiet --background --exec $DAEMON - echo "." + echo "Restarting daemon: "$NAME + start-stop-daemon --stop --user $DAEMONUSER --oknodo --pidfile $PIDFILE + start-stop-daemon --start -c $DAEMONUSER --background --pidfile $PIDFILE --make-pidfile --exec $DAEMON $PARAMS + chown $DAEMONUSER $PIDFILE ;; *) @@ -29,4 +35,3 @@ case "$1" in esac exit 0 - diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index e069e26..7dc2b01 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -21,9 +21,20 @@ #include #include #include "calllistener.h" +#include "settings.h" int main(int argc, char *argv[]) { + // If daemon was started on boot, the first parameter is not set + if(!(argc >= 2 && argv[1] == "manual")) + { + if(Settings::instance()->get("autostart") == "0") + { + // Autostart is disabled -> exit + return 0; + } + } + QApplication app(argc, argv); QTranslator translator; diff --git a/src/gui/Makefile b/src/gui/Makefile index b7a1344..fa3d397 100644 --- a/src/gui/Makefile +++ b/src/gui/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: jenirok -# Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Apr 17 16:30:11 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Thu May 27 17:38:04 2010 # Project: gui.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile gui.pro @@ -10,12 +10,12 @@ CC = gcc CXX = g++ -DEFINES = -DDATADIR=\"/usr/share\" -DPKGDATADIR=\"\" -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) -CXXFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) -INCPATH = -I/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++ -I. -I/targets/FREMANTLE_X86/usr/include/QtCore -I/targets/FREMANTLE_X86/usr/include/QtNetwork -I/targets/FREMANTLE_X86/usr/include/QtGui -I/targets/FREMANTLE_X86/usr/include/QtSql -I/targets/FREMANTLE_X86/usr/include/QtMaemo5 -I/targets/FREMANTLE_X86/usr/include -I../common -I. +DEFINES = -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024 -DDATADIR=\"/usr/share\" -DPKGDATADIR=\"\" -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5 -I. -I/targets/FREMANTLE_ARMEL/usr/include/QtCore -I/targets/FREMANTLE_ARMEL/usr/include/QtNetwork -I/targets/FREMANTLE_ARMEL/usr/include/QtGui -I/targets/FREMANTLE_ARMEL/usr/include/QtSql -I/targets/FREMANTLE_ARMEL/usr/include/QtMaemo5 -I/targets/FREMANTLE_ARMEL/usr/include -I../common -I. LINK = g++ -LFLAGS = -Wl,-O1 -Wl,-rpath,/usr/lib +LFLAGS = -Wl,-rpath-link,/usr/lib -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath,/usr/lib LIBS = $(SUBLIBS) -L/usr/lib -lebook-1.2 -ledataserver-1.2 -lxml2 -lgconf-2 -ldbus-glib-1 -lconic -ldbus-1 -lgobject-2.0 -lglib-2.0 -lQtMaemo5 -L/usr/lib -L/usr/X11R6/lib -lQtSql -lQtGui -lQtNetwork -lQtDBus -lQtXml -lQtCore -lpthread AR = ar cqs RANLIB = @@ -88,26 +88,25 @@ OBJECTS = main.o \ moc_connectionmanager.o \ qrc_icons.o \ qrc_translations.o -DIST = /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ +DIST = /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \ gui.pro QMAKE_TARGET = jenirok DESTDIR = @@ -140,26 +139,25 @@ all: Makefile $(TARGET) $(TARGET): $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) -Makefile: gui.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qmake.conf /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ +Makefile: gui.pro /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/lib/libQtMaemo5.prl \ /usr/lib/libQtDBus.prl \ /usr/lib/libQtXml.prl \ @@ -168,26 +166,25 @@ Makefile: gui.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qmake. /usr/lib/libQtSql.prl \ /usr/lib/libQtNetwork.prl $(QMAKE) -unix -o Makefile gui.pro -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/link_pkgconfig.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf: +/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf: /usr/lib/libQtMaemo5.prl: /usr/lib/libQtDBus.prl: /usr/lib/libQtXml.prl: @@ -337,7 +334,9 @@ settings.o: ../common/settings.cpp ../common/settings.h \ connectionmanager.o: ../common/connectionmanager.cpp ../common/connectionmanager.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o connectionmanager.o ../common/connectionmanager.cpp -cache.o: ../common/cache.cpp ../common/db.h \ +cache.o: ../common/cache.cpp ../common/cache.h \ + ../common/eniro.h \ + ../common/db.h \ ../common/settings.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o cache.o ../common/cache.cpp diff --git a/src/gui/daemon.cpp b/src/gui/daemon.cpp index 6a5a4e8..c5bc0d4 100644 --- a/src/gui/daemon.cpp +++ b/src/gui/daemon.cpp @@ -24,14 +24,12 @@ namespace { const QString DAEMON_NAME = "jenirokd"; const QString INIT_DIR = "/etc/init.d"; - const QString AUTOSTART_ENABLE = "update-rc.d jenirokd defaults 99"; - const QString AUTOSTART_DISABLE = "update-rc.d -f jenirokd remove"; } bool Daemon::start() { QProcess proc; - proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "start"); + proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "start" << "manual"); proc.waitForStarted(); proc.waitForFinished(); @@ -87,31 +85,6 @@ bool Daemon::isRunning() return !result.isEmpty(); } -bool Daemon::setAutostart(bool enabled) -{ - QProcess proc; - - if(enabled) - { - proc.start(AUTOSTART_ENABLE); - } - else - { - proc.start(AUTOSTART_DISABLE); - } - - proc.waitForStarted(); - proc.waitForFinished(); - - if(proc.exitCode() != 0) - { - return false; - } - - return true; - -} - Daemon::Daemon() { } diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index f84f8c8..626a0b2 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -31,7 +31,7 @@ #include "daemon.h" #include "cache.h" -QMap SettingsDialog::sites_ = Eniro::getSites(); +QMap SettingsDialog::sites_; SettingsDialog::SettingsDialog(QWidget* parent): QDialog(parent), usernameInput_(0), passwordInput_(0), cacheInput_(0), siteSelector_(0), @@ -62,6 +62,12 @@ autostartSelector_(0) siteSelector_ = new ButtonSelector(tr("Eniro site"), this); QString site = Settings::instance()->get("eniro_site"); int i = 0; + + if(sites_.empty()) + { + sites_ = Eniro::getSites(); + } + QMap ::const_iterator it; for(it = sites_.begin(); it != sites_.end(); it++) { @@ -150,18 +156,6 @@ void SettingsDialog::saveSettings() currentSite_ = site; } - if(autostart != currentAutostart_) - { - bool value = false; - - if(autostart == "1") - { - value = true; - } - - Daemon::setAutostart(value); - } - } void SettingsDialog::setVisible(bool visible) @@ -171,7 +165,6 @@ void SettingsDialog::setVisible(bool visible) if(visible) { currentSite_ = siteSelector_->value().toString(); - currentAutostart_ = autostartSelector_->value().toString(); } } -- 1.7.9.5