Revamping the build such that passing in VERBOSE in the CONFIG will
authorRusty Lynch <rusty.lynch@intel.com>
Wed, 4 Apr 2012 18:20:25 +0000 (11:20 -0700)
committerRusty Lynch <rusty.lynch@intel.com>
Wed, 4 Apr 2012 18:20:25 +0000 (11:20 -0700)
trigger trace operations and various extra verbose error messages directly
to the console, and also setting the default build (without passing wayland
or xlib to the CONFIG) will result in using the normal qt config paths.

To build with verbose mode on, run 'qmake CONFIG+=verbose'

common.pri
projects.pro
src/common.h
src/main.cpp
src/src.pro

index e7f4f13..f7d3012 100644 (file)
@@ -1,8 +1,6 @@
 VERSION = 0.2.5
 TARGET = dialer
-CONFIG += link_pkgconfig network opengl debug
-
-# DEFINES += WANT_DEBUG
+CONFIG += link_pkgconfig network opengl
 
 # Build configuration
 
index cef2ba8..a0220fa 100644 (file)
@@ -1,6 +1,6 @@
 include (common.pri)
 TEMPLATE = subdirs
-CONFIG += ordered debug
+CONFIG += ordered 
 SUBDIRS = src qml dialerassets sounds
 
 #OTHER_FILES += dialer.service
index ff3c3c9..f6b9f8a 100644 (file)
 #ifndef COMMON_H
 #define COMMON_H
 
-#ifndef WANT_DEBUG
-#define TRACE
-#else
+
+#ifdef VERBOSE 
 #include <QDebug>
-#define TRACE qDebug()<<QString("[%1] %2(): %3").arg(__FILE__).arg(__func__).arg(__LINE__);
+#define TRACE qDebug() << "[" << __FILE__ << "]" << __func__ << "():" << __LINE__;
+#else
+#define TRACE
 #endif
 
 /*
index 1bae7da..2721898 100644 (file)
 #  define CONFIG_DEFAULT_TARGET_UX "tizen-ux-components"
 #endif
 
- void myMessageOutput(QtMsgType type, const char *msg)
- {
-     QFile debugFile("/home/tizen/dialerout.txt");
-       debugFile.open(QIODevice::WriteOnly | QIODevice::Append);
-     QTextStream out(&debugFile);
-
-       out << msg << "\n";
-       debugFile.close();
- }
-
 int main(int argc, char *argv[])
 {
-  TRACE
-   qInstallMsgHandler(myMessageOutput);
-   DialerApplication app(argc, argv);  
+    TRACE
+    DialerApplication app(argc, argv);  
 
     QMLMainWindow *qmw = QMLMainWindow::instance();
-    //setResizeMode(QDeclarativeView::SizeRootObjectToView);
     qmw->tryToShow();
 
     return app.exec();
@@ -81,7 +69,7 @@ QDateTime qDateTimeFromOfono(const QString &val)
 
     // Start by trying to parse this as an ISODate "YYYY-MM-DDTHH:MM:SSTZD"
     result = QDateTime::fromString(val,Qt::ISODate);
-#ifdef WANT_DEBUG
+#ifdef VERBOSE
     qDebug() << QString("Converted %1 with Qt::ISODate: %2")
                        .arg(val)
                        .arg(result.toString());
@@ -98,7 +86,7 @@ QDateTime qDateTimeFromOfono(const QString &val)
             time_t t = mktime(&time_tm);
             if (t >= (time_t)(0)) {
                 result.setTime_t(t);
-#ifdef WANT_DEBUG
+#ifdef VERBOSE 
                 qDebug() << QString("Converted %1 with strptime: %2")
                                    .arg(val)
                                    .arg(result.toString());
index 9000eee..7862de5 100644 (file)
@@ -1,17 +1,23 @@
 include (../common.pri)
 TEMPLATE = app
 QT += dbus declarative
-CONFIG += qdbus mobility qt-mobility link_pkgconfig network debug
+CONFIG += qdbus mobility qt-mobility link_pkgconfig network
 PKGCONFIG += libpulse-mainloop-glib
 MOBILITY += contacts multimedia
 MOC_DIR = .moc
 OBJECTS_DIR = .obj
 MGEN_OUTDIR = .gen
 
+if (verbose) {
+    DEFINES += VERBOSE 
+}
+
 if (wayland) {
     PKGCONFIG += mlite-wayland ofono-qt-wayland
-} else {
+} else if (xlib) {
     PKGCONFIG += mlite-xlib ofono-qt-xlib
+} else {
+    PKGCONFIG += mlite ofono-qt
 }
 
 DEFINES += CONFIG_DEFAULT_TARGET_UX=\\\"tizen-ux-components\\\"