[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kfritz] /: Refactored build process
From:       Joachim Wilke <git () joachim-wilke ! de>
Date:       2012-03-31 18:31:23
Message-ID: 20120331183123.84FD0A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 4a8d2b45a9f4e3162f53f7e56b770c0b4a777abe by Joachim Wilke.
Committed on 31/03/2012 at 20:30.
Pushed by joachimwilke into branch 'master'.

Refactored build process

- Split main method from KFritz.cpp to main.cpp
- Creating kfritzstatic.a out of all objects excluding main.o
- Adapted linking kfritz executable
- kfritzstatic.a can now be used for unit testing kfritz

M  +5    -3    CMakeLists.txt
M  +0    -49   KFritz.cpp
C  +0    -18   main.cpp [from: KFritz.cpp - 086% similarity]     [License: UNKNOWN]  \
*

The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.


http://commits.kde.org/kfritz/4a8d2b45a9f4e3162f53f7e56b770c0b4a777abe

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56991ad..f138d02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,9 +79,11 @@ kde4_add_kcfg_files(kfritzbox_SRCS GENERATE_MOC KSettings.kcfgc)
 kde4_add_ui_files(kfritzbox_SRCS KSettingsFritzBox.ui KSettingsFonbooks.ui \
KSettingsMisc.ui DialDialog.ui)  
 configure_file(pkg-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/pkg-config.h)
-kde4_add_executable(kfritz ${kfritzbox_SRCS})
-target_link_libraries(kfritz ${KDE4_KDEUI_LIBS} ${KDE4_KNOTIFYCONFIG_LIBRARY} 
-                                fritz++ ${GCRYPT_LIBRARIES} ${CC++_LDFLAGS})
+kde4_add_library(kfritzstatic STATIC ${kfritzbox_SRCS}) 
+kde4_add_executable(kfritz main.cpp)
+target_link_libraries(kfritz kfritzstatic fritz++ 
+                      ${KDE4_KDEUI_LIBS} ${KDE4_KNOTIFYCONFIG_LIBRARY} 
+                      ${GCRYPT_LIBRARIES} ${CC++_LDFLAGS})
 if (INDICATEQT_FOUND)
 	target_link_libraries(kfritz ${INDICATEQT_LIBRARIES})
 endif (INDICATEQT_FOUND)
diff --git a/KFritz.cpp b/KFritz.cpp
index 52e18e8..477c25b 100644
--- a/KFritz.cpp
+++ b/KFritz.cpp
@@ -32,8 +32,6 @@
 
 #include "KSettings.h"
 
-static const char *VERSION        = "0.0.9";
-
 KFritz::KFritz(KFritzWindow *mainWindow, KAboutData *aboutData)
 :KSystemTrayIcon("modem", mainWindow) {
 	this->aboutData = aboutData;
@@ -47,50 +45,3 @@ KFritz::~KFritz() {
 bool KFritz::parentWidgetTrayClose() const {
 	return true;
 }
-
-int main (int argc, char *argv[]) {
-	// init KDE-stuff
-	KAboutData aboutData(
-			// The program name used internally.
-			"kfritz",
-			// The message catalog name
-			// If null, program name is used instead.
-			0,
-			// A displayable program name string.
-			ki18n("KFritz"),
-			// The program version string.
-			VERSION,
-			// Short description of what the app does.
-			ki18n("Notifies about phone activity and browses call history and telephone book \
                on your Fritz!Box"),
-			// The license this code is released under
-			KAboutData::License_GPL,
-			// Copyright Statement
-			ki18n("(c) 2008-2011"),
-			// Optional text shown in the About box.
-			// Can contain any information desired.
-			ki18n("Developed by Matthias Becker and Joachim Wilke."),
-			// The program homepage string.
-			"http://www.joachim-wilke.de/kfritz.html",
-			// The bug report email address
-			"kfritz@joachim-wilke.de");
-
-	aboutData.setProgramIconName("modem");
-
-	KCmdLineOptions options;
-	options.add("p");
-	options.add("log-personal-info", ki18n("Log personal information (e.g. passwords, \
                phone numbers, ...)"));
-	KCmdLineArgs::init( argc, argv, &aboutData );
-	KCmdLineArgs::addCmdLineOptions(options);
-
-	KApplication app;
-
-	// create GUI elements, hand-over logArea to mainWindow
-	KFritzWindow mainWindow;
-	if (!KSettings::startMinimized())
-		mainWindow.show();
-	KFritz *trayIcon 	    = new KFritz(&mainWindow, &aboutData);
-	trayIcon->show();
-	int ret = app.exec();
-	fritz::Config::Shutdown();
-	return ret;
-}
diff --git a/KFritz.cpp b/main.cpp
similarity index 86%
copy from KFritz.cpp
copy to main.cpp
index 52e18e8..daae7bc 100644
--- a/KFritz.cpp
+++ b/main.cpp
@@ -24,30 +24,12 @@
 #include <KApplication>
 #include <KAboutData>
 #include <KCmdLineArgs>
-#include <KMessageBox>
-#include <vector>
-
 #include <Config.h>
-#include <FonbookManager.h>
 
 #include "KSettings.h"
 
 static const char *VERSION        = "0.0.9";
 
-KFritz::KFritz(KFritzWindow *mainWindow, KAboutData *aboutData)
-:KSystemTrayIcon("modem", mainWindow) {
-	this->aboutData = aboutData;
-	this->mainWindow = mainWindow;
-	connect(this, SIGNAL(quitSelected()), mainWindow, SLOT(quit()));
-}
-
-KFritz::~KFritz() {
-}
-
-bool KFritz::parentWidgetTrayClose() const {
-	return true;
-}
-
 int main (int argc, char *argv[]) {
 	// init KDE-stuff
 	KAboutData aboutData(


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic