Commit 41d2d633 authored by Simon Persson's avatar Simon Persson
Browse files

Start using kdeinit for improved startup time

Resolves #2.
I noticed that there is no need to call "kshell4 kup-daemon" from the .desktop file's exec line. The kdeinit process will be asked to start it and if there's a library with the right name, that will be loaded instead of starting a new executable.
parent 332095ca
......@@ -15,8 +15,8 @@ rsyncjob.cpp
../settings/kupsettings.cpp
)
kde4_add_executable(kupdaemon ${kupdaemon_SRCS})
target_link_libraries(kupdaemon
kde4_add_kdeinit_executable(kup-daemon ${kupdaemon_SRCS})
target_link_libraries(kdeinit_kup-daemon
QtCore
QtDBus
QtGui
......@@ -34,7 +34,8 @@ solid
)
########### install files ###############
install(TARGETS kupdaemon ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kup-daemon ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kdeinit_kup-daemon ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES kupdaemon.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
install(FILES kupdaemon.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kupdaemon)
[Desktop Entry]
Name=Kup
GenericName=Backup Monitor
Exec=kupdaemon
Exec=kup-daemon
Icon=chronometer
Type=Application
Terminal=false
......
......@@ -33,13 +33,13 @@ static const char description[] = I18N_NOOP("Kup is a flexible backup solution u
static const char version[] = "0.3";
int main(int argc, char **argv) {
extern "C" int KDE_EXPORT kdemain(int argc, char **argv) {
KupDaemon *lDaemon = new KupDaemon();
if(!lDaemon->shouldStart()) {
qWarning() <<ki18n("Kup is not enabled, enable it from the system settings module.").toString();
return 0;
}
KAboutData lAbout("kupdaemon", "kup", ki18nc("@title", "Kup Daemon"), version, ki18n(description),
KAboutData lAbout("kup-daemon", "kup", ki18nc("@title", "Kup Daemon"), version, ki18n(description),
KAboutData::License_GPL, ki18n("Copyright (C) 2011 Simon Persson"),
KLocalizedString(), 0, "simonpersson1@gmail.com");
lAbout.addAuthor(ki18n("Simon Persson"), KLocalizedString(), "simonpersson1@gmail.com");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment