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

List:       kde-commits
Subject:    [kdepim] console/konsolekalendar: Port to logging categories
From:       Montel Laurent <montel () kde ! org>
Date:       2015-04-30 20:59:58
Message-ID: E1YnvYs-0005Rp-4b () scm ! kde ! org
[Download RAW message or body]

Git commit 235b7b46af095c32b2a6ef39f2c69140b38a4f73 by Montel Laurent.
Committed on 30/04/2015 at 20:59.
Pushed by mlaurent into branch 'master'.

Port to logging categories

M  +1    -0    console/konsolekalendar/CMakeLists.txt
M  +27   -27   console/konsolekalendar/konsolekalendar.cpp
A  +23   -0    console/konsolekalendar/konsolekalendar_debug.cpp     [License: LGPL \
(v2+)] A  +27   -0    console/konsolekalendar/konsolekalendar_debug.h     [License: \
LGPL (v2+)] M  +6    -6    console/konsolekalendar/konsolekalendaradd.cpp
M  +4    -4    console/konsolekalendar/konsolekalendarchange.cpp
M  +5    -5    console/konsolekalendar/konsolekalendardelete.cpp
M  +1    -1    console/konsolekalendar/konsolekalendarexports.cpp
M  +1    -1    console/konsolekalendar/konsolekalendarvariables.cpp
M  +58   -58   console/konsolekalendar/main.cpp

http://commits.kde.org/kdepim/235b7b46af095c32b2a6ef39f2c69140b38a4f73

diff --git a/console/konsolekalendar/CMakeLists.txt \
b/console/konsolekalendar/CMakeLists.txt index f0be2cf..01d967f 100644
--- a/console/konsolekalendar/CMakeLists.txt
+++ b/console/konsolekalendar/CMakeLists.txt
@@ -5,6 +5,7 @@ add_subdirectory(pics)
 ########### next target ###############
 
 set(konsolekalendar_SRCS 
+   konsolekalendar_debug.cpp
    konsolekalendarepoch.cpp 
    konsolekalendardelete.cpp 
    konsolekalendarchange.cpp 
diff --git a/console/konsolekalendar/konsolekalendar.cpp \
b/console/konsolekalendar/konsolekalendar.cpp index 3372180..f53d01f 100644
--- a/console/konsolekalendar/konsolekalendar.cpp
+++ b/console/konsolekalendar/konsolekalendar.cpp
@@ -36,7 +36,7 @@
 #include "konsolekalendardelete.h"
 #include "konsolekalendarexports.h"
 
-#include <qdebug.h>
+#include "konsolekalendar_debug.h"
 #include <KLocalizedString>
 #include <ksystemtimezone.h>
 
@@ -74,7 +74,7 @@ bool KonsoleKalendar::importCalendar()
 {
     KonsoleKalendarAdd add(m_variables);
 
-    qDebug() << "konsolecalendar.cpp::importCalendar() | importing now!";
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolecalendar.cpp::importCalendar() | \
importing now!";  return add.addImportedCalendar();
 }
 
@@ -144,7 +144,7 @@ bool KonsoleKalendar::createCalendar()
         cout << i18n("Create Calendar <Dry Run>: %1", filename).toLocal8Bit().data()
              << endl;
     } else {
-        qDebug() << "konsolekalendar.cpp::createCalendar() |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::createCalendar() |"
                  << "Creating calendar file: "
                  << filename.toLocal8Bit().data();
 
@@ -173,14 +173,14 @@ bool KonsoleKalendar::showInstance()
              << endl;
         printSpecs();
     } else {
-        qDebug() << "konsolekalendar.cpp::showInstance() |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::showInstance() |"
                  << "open export file";
 
         if (m_variables->isExportFile()) {
             f.setFileName(m_variables->getExportFile());
             if (!f.open(QIODevice::WriteOnly)) {
                 status = false;
-                qDebug() << "konsolekalendar.cpp::showInstance() |"
+                qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::showInstance() \
|"  << "unable to open export file"
                          << m_variables->getExportFile();
             }
@@ -189,7 +189,7 @@ bool KonsoleKalendar::showInstance()
         }
 
         if (status) {
-            qDebug() << "konsolekalendar.cpp::showInstance() |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::showInstance() |"
                      << "opened successful";
 
             if (m_variables->isVerbose()) {
@@ -204,11 +204,11 @@ bool KonsoleKalendar::showInstance()
                     m_variables->getExportType() != ExportTypeMonthHTML) {
 
                 if (m_variables->getAll()) {
-                    qDebug() << "konsolekalendar.cpp::showInstance() |"
+                    qCDebug(KONSOLEKALENDAR_LOG) << \
"konsolekalendar.cpp::showInstance() |"  << "view all events sorted list";
 
                     Event::List sortedList = calendar->events(EventSortStartDate);
-                    qDebug() << "Found" << sortedList.count() << "events";
+                    qCDebug(KONSOLEKALENDAR_LOG) << "Found" << sortedList.count() << \
"events";  if (!sortedList.isEmpty()) {
                         // The code that was here before the akonadi port was really \
slow with 200 events  // this is much faster:
@@ -217,7 +217,7 @@ bool KonsoleKalendar::showInstance()
                         }
                     }
                 } else if (m_variables->isUID()) {
-                    qDebug() << "konsolekalendar.cpp::showInstance() |"
+                    qCDebug(KONSOLEKALENDAR_LOG) << \
"konsolekalendar.cpp::showInstance() |"  << "view events by uid list";
                     //TODO: support a list of UIDs
                     event = calendar->event(m_variables->getUID());
@@ -226,7 +226,7 @@ bool KonsoleKalendar::showInstance()
                     status = printEvent(&ts, event, event->dtStart().date());
 
                 } else if (m_variables->isNext()) {
-                    qDebug() << "konsolekalendar.cpp::showInstance() |"
+                    qCDebug(KONSOLEKALENDAR_LOG) << \
"konsolekalendar.cpp::showInstance() |"  << "Show next activity in calendar";
 
                     QDateTime datetime = m_variables->getStartDateTime();
@@ -239,17 +239,17 @@ bool KonsoleKalendar::showInstance()
                         Event::List events = calendar->events(dt, timeSpec,
                                                               EventSortStartDate,
                                                               \
                SortDirectionAscending);
-                        qDebug() << "2-Found" << events.count() << "events on date" \
<< dt; +                        qCDebug(KONSOLEKALENDAR_LOG) << "2-Found" << \
events.count() << "events on date" << dt;  // finished here when we get the next \
event  if (!events.isEmpty()) {
-                            qDebug() << "konsolekalendar.cpp::showInstance() |"
+                            qCDebug(KONSOLEKALENDAR_LOG) << \
"konsolekalendar.cpp::showInstance() |"  << "Got the next event";
                             printEvent(&ts, events.first(), dt);
                             return true;
                         }
                     }
                 } else {
-                    qDebug() << "konsolekalendar.cpp::showInstance() |"
+                    qCDebug(KONSOLEKALENDAR_LOG) << \
"konsolekalendar.cpp::showInstance() |"  << "view raw events within date range list";
 
                     QDate dt;
@@ -259,14 +259,14 @@ bool KonsoleKalendar::showInstance()
                         Event::List events = calendar->events(dt, timeSpec,
                                                               EventSortStartDate,
                                                               \
                SortDirectionAscending);
-                        qDebug() << "3-Found" << events.count() << "events on date: \
" << dt; +                        qCDebug(KONSOLEKALENDAR_LOG) << "3-Found" << \
events.count() << "events on date: " << dt;  status = printEventList(&ts, &events, \
dt);  }
                 }
             } else {
                 QDate firstdate, lastdate;
                 if (m_variables->getAll()) {
-                    qDebug() << "konsolekalendar.cpp::showInstance() |"
+                    qCDebug(KONSOLEKALENDAR_LOG) << \
"konsolekalendar.cpp::showInstance() |"  << "HTML view all events sorted list";
                     // sort the events for this date by start date
                     // in order to determine the date range.
@@ -277,13 +277,13 @@ bool KonsoleKalendar::showInstance()
                     lastdate = events->last()->dtStart().date();
                 } else if (m_variables->isUID()) {
                     // TODO
-                    qDebug() << "konsolekalendar.cpp::showInstance() |"
+                    qCDebug(KONSOLEKALENDAR_LOG) << \
"konsolekalendar.cpp::showInstance() |"  << "HTML view events by uid list";
                     cout << i18n("Sorry, export to HTML by UID is not supported \
yet").  toLocal8Bit().data() << endl;
                     return false;
                 } else {
-                    qDebug() << "konsolekalendar.cpp::showInstance() |"
+                    qCDebug(KONSOLEKALENDAR_LOG) << \
                "konsolekalendar.cpp::showInstance() |"
                              << "HTML view raw events within date range list";
                     firstdate = m_variables->getStartDateTime().date();
                     lastdate = m_variables->getEndDateTime().date();
@@ -346,7 +346,7 @@ bool KonsoleKalendar::printEventList(QTextStream *ts,
 {
     bool status = true;
 
-    qDebug() << eventList->count();
+    qCDebug(KONSOLEKALENDAR_LOG) << eventList->count();
     if (!eventList->isEmpty()) {
         Event::Ptr singleEvent;
         Event::List::ConstIterator it;
@@ -373,13 +373,13 @@ bool KonsoleKalendar::printEvent(QTextStream *ts, const \
Event::Ptr &event, QDate  switch (m_variables->getExportType()) {
 
         case ExportTypeCSV:
-            qDebug() << "konsolekalendar.cpp::printEvent() |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::printEvent() |"
                      << "CSV export";
             status = exports.exportAsCSV(ts, event, dt);
             break;
 
         case ExportTypeTextShort:
-            qDebug() << "konsolekalendar.cpp::printEvent() |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::printEvent() |"
                      << "TEXT-SHORT export";
             if (dt.daysTo(m_saveDate)) {
                 sameDay = false;
@@ -393,7 +393,7 @@ bool KonsoleKalendar::printEvent(QTextStream *ts, const \
Event::Ptr &event, QDate  break;
 
         default:// Default export-type is ExportTypeText
-            qDebug() << "konsolekalendar.cpp::printEvent() |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::printEvent() |"
                      << "TEXT export";
             status = exports.exportAsTxt(ts, event, dt);
             break;
@@ -404,10 +404,10 @@ bool KonsoleKalendar::printEvent(QTextStream *ts, const \
Event::Ptr &event, QDate  
 bool KonsoleKalendar::addEvent()
 {
-    qDebug() << "konsolecalendar.cpp::addEvent() |"
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolecalendar.cpp::addEvent() |"
              << "Create Adding";
     KonsoleKalendarAdd add(m_variables);
-    qDebug() << "konsolecalendar.cpp::addEvent() |"
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolecalendar.cpp::addEvent() |"
              << "Adding Event now!";
     return add.addEvent();
 }
@@ -415,20 +415,20 @@ bool KonsoleKalendar::addEvent()
 bool KonsoleKalendar::changeEvent()
 {
 
-    qDebug() << "konsolecalendar.cpp::changeEvent() |"
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolecalendar.cpp::changeEvent() |"
              << "Create Changing";
     KonsoleKalendarChange change(m_variables);
-    qDebug() << "konsolecalendar.cpp::changeEvent() |"
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolecalendar.cpp::changeEvent() |"
              << "Changing Event now!";
     return change.changeEvent();
 }
 
 bool KonsoleKalendar::deleteEvent()
 {
-    qDebug() << "konsolecalendar.cpp::deleteEvent() |"
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolecalendar.cpp::deleteEvent() |"
              << "Create Deleting";
     KonsoleKalendarDelete del(m_variables);
-    qDebug() << "konsolecalendar.cpp::deleteEvent() |"
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolecalendar.cpp::deleteEvent() |"
              << "Deleting Event now!";
     return del.deleteEvent();
 }
diff --git a/console/konsolekalendar/konsolekalendar_debug.cpp \
b/console/konsolekalendar/konsolekalendar_debug.cpp new file mode 100644
index 0000000..5845ac5
--- /dev/null
+++ b/console/konsolekalendar/konsolekalendar_debug.cpp
@@ -0,0 +1,23 @@
+/*  This file is part of the KDE project
+    Copyright (C) 2015 Laurent Montel <montel@kde.org>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "konsolekalendar_debug.h"
+Q_LOGGING_CATEGORY(KONSOLEKALENDAR_LOG, "log_konsolekalendar")
+
+
diff --git a/console/konsolekalendar/konsolekalendar_debug.h \
b/console/konsolekalendar/konsolekalendar_debug.h new file mode 100644
index 0000000..8cbf96d
--- /dev/null
+++ b/console/konsolekalendar/konsolekalendar_debug.h
@@ -0,0 +1,27 @@
+/*  This file is part of the KDE project
+    Copyright (C) 2015 Laurent Montel <montel@kde.org>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KONSOLEKALENDAR_DEBUG_H
+#define KONSOLEKALENDAR_DEBUG_H
+
+#include <QLoggingCategory>
+Q_DECLARE_LOGGING_CATEGORY(KONSOLEKALENDAR_LOG)
+
+#endif 
+
diff --git a/console/konsolekalendar/konsolekalendaradd.cpp \
b/console/konsolekalendar/konsolekalendaradd.cpp index 1b23492..d3d9f52 100644
--- a/console/konsolekalendar/konsolekalendaradd.cpp
+++ b/console/konsolekalendar/konsolekalendaradd.cpp
@@ -34,7 +34,7 @@
 
 #include <calendarsupport/kcalprefs.h>
 
-#include <qdebug.h>
+#include "konsolekalendar_debug.h"
 
 #include <ksystemtimezone.h>
 #include <KLocalizedString>
@@ -72,7 +72,7 @@ bool KonsoleKalendarAdd::addEvent()
 {
     bool status = true;
 
-    qDebug() << "konsolekalendaradd.cpp::addEvent()";
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendaradd.cpp::addEvent()";
 
     if (m_variables->isDryRun()) {
         cout << i18n("Insert Event <Dry Run>:").toLocal8Bit().data()
@@ -117,7 +117,7 @@ bool KonsoleKalendarAdd::addEvent()
         }
         calendar->addEvent(event);
         loop.exec();
-        qDebug() << "Creation took " << t.elapsed() << "ms.";
+        qCDebug(KONSOLEKALENDAR_LOG) << "Creation took " << t.elapsed() << "ms.";
         status = calendar->incidence(event->uid()) != 0;
         if (status) {
             cout << i18n("Success: \"%1\" inserted",
@@ -132,7 +132,7 @@ bool KonsoleKalendarAdd::addEvent()
         }
     }
 
-    qDebug() << "konsolekalendaradd.cpp::addEvent() | Done";
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendaradd.cpp::addEvent() | Done";
     return status;
 }
 
@@ -154,12 +154,12 @@ bool KonsoleKalendarAdd::addImportedCalendar()
       if ( !cal->load( fileName ) ||
            !cal->load( m_variables->getImportFile() ) ||
            !cal->save( fileName ) ) {
-        qDebug() << "konsolekalendaradd.cpp::importCalendar() |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendaradd.cpp::importCalendar() |"
                  << "Can't import file:"
                  << m_variables->getImportFile();
         return false;
       }
-      qDebug() << "konsolekalendaradd.cpp::importCalendar() |"
+      qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendaradd.cpp::importCalendar() |"
                << "Successfully imported file:"
                << m_variables->getImportFile();
                */
diff --git a/console/konsolekalendar/konsolekalendarchange.cpp \
b/console/konsolekalendar/konsolekalendarchange.cpp index 6efbe7a..8cdd028 100644
--- a/console/konsolekalendar/konsolekalendarchange.cpp
+++ b/console/konsolekalendar/konsolekalendarchange.cpp
@@ -32,7 +32,7 @@
  */
 #include "konsolekalendarchange.h"
 
-#include <qdebug.h>
+#include "konsolekalendar_debug.h"
 #include <KLocalizedString>
 
 #include <QEventLoop>
@@ -57,7 +57,7 @@ bool KonsoleKalendarChange::changeEvent()
 {
     bool status = false;
 
-    qDebug() << "konsolekalendarchange.cpp::changeEvent()";
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendarchange.cpp::changeEvent()";
 
     /*
      * Retrieve event on the basis of the unique string ID
@@ -73,7 +73,7 @@ bool KonsoleKalendarChange::changeEvent()
                  << endl;
             printSpecs();
         } else {
-            qDebug() << "konsolekalendarchange.cpp:changeEvent() :"
+            qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendarchange.cpp:changeEvent() \
:"  << m_variables->getUID().toLocal8Bit().data();
 
             if (m_variables->isVerbose()) {
@@ -131,7 +131,7 @@ bool KonsoleKalendarChange::changeEvent()
         }
     }
 
-    qDebug() << "konsolekalendarchange.cpp::changeEvent() | Done";
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendarchange.cpp::changeEvent() | \
Done";  return status;
 }
 
diff --git a/console/konsolekalendar/konsolekalendardelete.cpp \
b/console/konsolekalendar/konsolekalendardelete.cpp index 9f91bc1..3a3d6cc 100644
--- a/console/konsolekalendar/konsolekalendardelete.cpp
+++ b/console/konsolekalendar/konsolekalendardelete.cpp
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <iostream>
 
-#include <qdebug.h>
+#include "konsolekalendar_debug.h"
 #include <KLocalizedString>
 #include <QEventLoop>
 
@@ -55,7 +55,7 @@ bool KonsoleKalendarDelete::deleteEvent()
 {
     bool status = false;
 
-    qDebug() << "konsolekalendardelete.cpp::deleteEvent()";
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendardelete.cpp::deleteEvent()";
 
     /*
      * Retrieve event on the basis of the unique string ID
@@ -67,7 +67,7 @@ bool KonsoleKalendarDelete::deleteEvent()
                  << endl;
             printSpecs(event);
         } else {
-            qDebug() << "konsolekalendardelete.cpp:deleteEvent() :"
+            qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendardelete.cpp:deleteEvent() \
:"  << m_variables->getUID().data();
 
             if (m_variables->isVerbose()) {
@@ -81,7 +81,7 @@ bool KonsoleKalendarDelete::deleteEvent()
             QObject::connect(calendar.data(), SIGNAL(deleteFinished(bool,QString)), \
&loop, SLOT(quit()));  calendar->deleteEvent(event);
             loop.exec();
-            qDebug() << "Finished deleting";
+            qCDebug(KONSOLEKALENDAR_LOG) << "Finished deleting";
             status = calendar->incidence(event->uid()) == 0;
 
             if (status) {
@@ -92,7 +92,7 @@ bool KonsoleKalendarDelete::deleteEvent()
         }
     }
 
-    qDebug() << "konsolekalendardelete.cpp::deleteEvent() | Done";
+    qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendardelete.cpp::deleteEvent() | \
Done";  return status;
 }
 
diff --git a/console/konsolekalendar/konsolekalendarexports.cpp \
b/console/konsolekalendar/konsolekalendarexports.cpp index bac9835..e293f54 100644
--- a/console/konsolekalendar/konsolekalendarexports.cpp
+++ b/console/konsolekalendar/konsolekalendarexports.cpp
@@ -32,7 +32,7 @@
  */
 #include "konsolekalendarexports.h"
 
-#include <qdebug.h>
+#include "konsolekalendar_debug.h"
 #include <klocale.h>
 
 #include <KCalCore/Event>
diff --git a/console/konsolekalendar/konsolekalendarvariables.cpp \
b/console/konsolekalendar/konsolekalendarvariables.cpp index 628f006..815bc86 100644
--- a/console/konsolekalendar/konsolekalendarvariables.cpp
+++ b/console/konsolekalendar/konsolekalendarvariables.cpp
@@ -33,7 +33,7 @@
 #include "konsolekalendarvariables.h"
 
 #include <KLocalizedString>
-#include <qdebug.h>
+#include "konsolekalendar_debug.h"
 #include <kconfig.h>
 
 #include <QtCore/QDateTime>
diff --git a/console/konsolekalendar/main.cpp b/console/konsolekalendar/main.cpp
index eac3ebc..77c9c24 100644
--- a/console/konsolekalendar/main.cpp
+++ b/console/konsolekalendar/main.cpp
@@ -43,7 +43,7 @@
 #include <KLocalizedString>
 #include <kconfig.h>
 
-#include <qdebug.h>
+#include "konsolekalendar_debug.h"
 #include <KApplication>
 
 #include <KCalCore/CalFormat>
@@ -257,18 +257,18 @@ int main(int argc, char *argv[])
      */
     if (args->isSet("event")) {
         variables.setUseEvents(true);
-        qDebug() << "main | parse options | use Events";
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options | use Events";
     }
     if (args->isSet("todo")) {
         variables.setUseTodos(true);
-        qDebug() << "main | parse options | use To-dos";
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options | use To-dos";
         cout << i18n("Sorry, To-dos are not working yet.").toLocal8Bit().data()
              << endl;
         return 1;
     }
     if (args->isSet("journal")) {
         variables.setUseJournals(true);
-        qDebug() << "main | parse options | use Journals";
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options | use Journals";
         cout << i18n("Sorry, Journals are not working yet.").toLocal8Bit().data()
              << endl;
         return 1;
@@ -278,7 +278,7 @@ int main(int argc, char *argv[])
             !args->isSet("todo") &&
             !args->isSet("journal")) {
         variables.setUseEvents(true);
-        qDebug() << "main | parse options | use Events (Default)";
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options | use Events \
(Default)";  }
 
     /*
@@ -289,19 +289,19 @@ int main(int argc, char *argv[])
         option = args->getOption("export-type");
 
         if (option.toUpper() == QLatin1String("HTML")) {
-            qDebug() << "main | export-type | Export to HTML";
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export to HTML";
             variables.setExportType(ExportTypeHTML);
         } else if (option.toUpper() == QLatin1String("HTMLMONTH")) {
-            qDebug() << "main | export-type | Export to HTML by Month";
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export to HTML by \
Month";  variables.setExportType(ExportTypeMonthHTML);
         } else if (option.toUpper() == QLatin1String("CSV")) {
-            qDebug() << "main | export-type | Export to CSV";
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export to CSV";
             variables.setExportType(ExportTypeCSV);
         } else if (option.toUpper() == QLatin1String("TEXT")) {
-            qDebug() << "main | export-type | Export to TEXT (default)";
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export to TEXT \
(default)";  variables.setExportType(ExportTypeText);
         } else if (option.toUpper() == QLatin1String("SHORT")) {
-            qDebug() << "main | export-type | Export to TEXT-SHORT";
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export to \
TEXT-SHORT";  variables.setExportType(ExportTypeTextShort);
         } else {
             cout << i18n("Invalid Export Type Specified: %1", \
option).toLocal8Bit().data() @@ -316,7 +316,7 @@ int main(int argc, char *argv[])
     if (args->isSet("export-file")) {
         option = args->getOption("export-file");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Export File:"
                  << "(" << option << ")";
 
@@ -329,7 +329,7 @@ int main(int argc, char *argv[])
     if (args->isSet("view")) {
         view = true;
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Mode: (Print incidences)";
     }
 
@@ -340,7 +340,7 @@ int main(int argc, char *argv[])
         view = false;
         add = true;
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Mode: (Add incidence)";
     }
 
@@ -351,7 +351,7 @@ int main(int argc, char *argv[])
         view = false;
         change = true;
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Mode: (Change incidence)";
     }
 
@@ -362,7 +362,7 @@ int main(int argc, char *argv[])
         view = false;
         del = true;
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Mode: (Delete incidence)";
     }
 
@@ -373,7 +373,7 @@ int main(int argc, char *argv[])
         view = false;
         create = true;
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Calendar File: (Create)";
     }
 
@@ -383,7 +383,7 @@ int main(int argc, char *argv[])
     if (args->isSet("summary")) {
         option = args->getOption("summary");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Summary:"
                  << "(" << option << ")";
 
@@ -396,7 +396,7 @@ int main(int argc, char *argv[])
     if (args->isSet("description")) {
         option = args->getOption("description");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Description:"
                  << "(" << option << ")";
 
@@ -418,7 +418,7 @@ int main(int argc, char *argv[])
     if (args->isSet("location")) {
         option = args->getOption("location");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Location:"
                  << "(" << option << ")";
 
@@ -429,7 +429,7 @@ int main(int argc, char *argv[])
      * Show next happening and exit
      */
     if (args->isSet("next")) {
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Show next incidence only";
 
         variables.setNext(true);
@@ -441,7 +441,7 @@ int main(int argc, char *argv[])
     if (args->isSet("uid")) {
         option = args->getOption("uid");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "incidence UID:"
                  << "(" << option << ")";
 
@@ -454,7 +454,7 @@ int main(int argc, char *argv[])
     if (args->isSet("date")) {
         option = args->getOption("date");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Start date before conversion:"
                  << "(" << option << ")";
 
@@ -465,7 +465,7 @@ int main(int argc, char *argv[])
                  << endl;
             return 1;
         }
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Start date after conversion:"
                  << "(" << startdate.toString() << ")";
     }
@@ -476,7 +476,7 @@ int main(int argc, char *argv[])
     if (args->isSet("time")) {
         option = args->getOption("time");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Start time before conversion :"
                  << "(" << option << ")";
 
@@ -491,12 +491,12 @@ int main(int argc, char *argv[])
                      << endl;
                 return 1;
             }
-            qDebug() << "main | parse options |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                      << "Start time after conversion:"
                      << "(" << starttime.toString() << ")";
         } else {
             variables.setFloating(true);
-            qDebug() << "main | parse options |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                      << "Floating event time specified";
         }
     }
@@ -507,7 +507,7 @@ int main(int argc, char *argv[])
     if (args->isSet("end-date")) {
         option = args->getOption("end-date");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "End date before conversion:"
                  << "(" << option << ")";
 
@@ -518,7 +518,7 @@ int main(int argc, char *argv[])
                  << endl;
             return 1;
         }
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "End date after conversion:"
                  << "(" << enddate.toString() << ")";
     }
@@ -530,7 +530,7 @@ int main(int argc, char *argv[])
         bool ok;
 
         option = args->getOption("show-next");
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Show" << option << "days ahead";
         variables.setDaysCount(option.toInt(&ok, 10));
 
@@ -542,7 +542,7 @@ int main(int argc, char *argv[])
 
         enddate = startdate;
         enddate = enddate.addDays(variables.getDaysCount());
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "End date after conversion:"
                  << "(" << enddate.toString() << ")";
     }
@@ -553,7 +553,7 @@ int main(int argc, char *argv[])
     if (args->isSet("end-time")) {
         option = args->getOption("end-time");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "End time before conversion:"
                  << "(" << option << ")";
 
@@ -569,12 +569,12 @@ int main(int argc, char *argv[])
                 return 1;
             }
 
-            qDebug() << "main | parse options |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                      << "End time after conversion:"
                      << "(" << endtime.toString() << ")";
         } else {
             variables.setFloating(true);
-            qDebug() << "main | parse options |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                      << "Floating event time specified";
         }
     }
@@ -586,7 +586,7 @@ int main(int argc, char *argv[])
     if (args->isSet("epoch-start")) {
         option = args->getOption("epoch-start");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Epoch start:"
                  << "(" << option << ")";
 
@@ -600,7 +600,7 @@ int main(int argc, char *argv[])
     if (args->isSet("epoch-end")) {
         option = args->getOption("epoch-end");
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "Epoch end:"
                  << "(" << option << ")";
 
@@ -619,7 +619,7 @@ int main(int argc, char *argv[])
         option = args->getOption("import");
         variables.setImportFile(option);
 
-        qDebug() << "main | parse options |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options |"
                  << "importing file from:"
                  << "(" << option << ")";
     }
@@ -634,11 +634,11 @@ int main(int argc, char *argv[])
     QEventLoop loop;
     Akonadi::FetchJobCalendar::Ptr calendar = Akonadi::FetchJobCalendar::Ptr(new \
                Akonadi::FetchJobCalendar());
     QObject::connect(calendar.data(), SIGNAL(loadFinished(bool,QString)), &loop, \
                SLOT(quit()));
-    qDebug() << "Starting to load calendar";
+    qCDebug(KONSOLEKALENDAR_LOG) << "Starting to load calendar";
     QElapsedTimer t;
     t.start();
     loop.exec();
-    qDebug() << "Calendar loaded in" << t.elapsed() << "ms; success=" << \
calendar->isLoaded() << "; num incidences=" << calendar->incidences().count(); +    \
qCDebug(KONSOLEKALENDAR_LOG) << "Calendar loaded in" << t.elapsed() << "ms; success=" \
<< calendar->isLoaded() << "; num incidences=" << calendar->incidences().count();  
     if (!args->isSet("import")) {
         variables.setCalendar(calendar);
@@ -653,11 +653,11 @@ int main(int argc, char *argv[])
     if (!args->isSet("end-date") && !args->isSet("show-next") &&
             args->isSet("date")) {
         enddate = startdate;
-        qDebug() << "main | datetimestamp |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                  << "setting enddate to startdate";
     } else if (args->isSet("end-date") && !args->isSet("date")) {
         startdate = enddate;
-        qDebug() << "main | datetimestamp |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                  << "setting startdate to enddate";
     }
 
@@ -669,12 +669,12 @@ int main(int argc, char *argv[])
     if (!args->isSet("end-time") && !args->isSet("epoch-end")) {
         if (args->isSet("time")) {
             endtime = starttime.addSecs(60 * 60);    // end is 1 hour after start
-            qDebug() << "main | datetimestamp |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                      << "setting endtime 1 hour after starttime";
         } else if (args->isSet("epoch-start")) {
             startdatetime = epochs.epoch2QDateTime(epochstart);
             enddatetime = startdatetime.addSecs(60 * 60);
-            qDebug() << "main | datetimestamp |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                      << "setting endtime 1 hour after epochstart";
         }
     }
@@ -685,12 +685,12 @@ int main(int argc, char *argv[])
     if (!args->isSet("time") && !args->isSet("epoch-start")) {
         if (args->isSet("end-time")) {
             starttime = endtime.addSecs(-60 * 60);    // start is 1 hour before end
-            qDebug() << "main | datetimestamp |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                      << "setting starttime 1 hour before endtime";
         } else if (args->isSet("epoch-end")) {
             enddatetime = epochs.epoch2QDateTime(epochend);
             startdatetime = enddatetime.addSecs(-60 * 60);
-            qDebug() << "main | datetimestamp |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                      << "setting starttime 1 before after epochend";
         }
     }
@@ -701,12 +701,12 @@ int main(int argc, char *argv[])
             !args->isSet("end-time") && !args->isSet("epoch-end")) {
         // set default start date/time
         startdatetime = QDateTime(startdate, starttime);
-        qDebug() << "main | datetimestamp |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                  << "setting startdatetime from"
                  << "default startdate (today) and starttime";
         // set default end date/time
         enddatetime = QDateTime(enddate, endtime);
-        qDebug() << "main | datetimestamp |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                  << "setting enddatetime from"
                  << "default enddate (today) and endtime";
     }
@@ -714,12 +714,12 @@ int main(int argc, char *argv[])
     // Set startdatetime, enddatetime if still necessary
     if (startdatetime.isNull()) {
         startdatetime = QDateTime(startdate, starttime);
-        qDebug() << "main | datetimestamp |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                  << "setting startdatetime from startdate and starttime";
     }
     if (enddatetime.isNull()) {
         enddatetime = QDateTime(enddate, endtime);
-        qDebug() << "main | datetimestamp |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |"
                  << "setting enddatetime from enddate and endtime";
     }
 
@@ -729,7 +729,7 @@ int main(int argc, char *argv[])
         if (!args->isSet("time")        && !args->isSet("end-time") &&
                 !args->isSet("epoch-start") && !args->isSet("epoch-end")) {
             variables.setFloating(true);
-            qDebug() << "main | floatingcheck |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | floatingcheck |"
                      << "turn-on floating event";
         }
     }
@@ -749,9 +749,9 @@ int main(int argc, char *argv[])
     }
 
     // Some more debug prints
-    qDebug() << "main | datetimestamp | StartDate="
+    qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp | StartDate="
              << startdatetime.toString(Qt::TextDate);
-    qDebug() << "main | datetimestamp | EndDate="
+    qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp | EndDate="
              << enddatetime.toString(Qt::TextDate);
 
     /***************************************************************************
@@ -804,7 +804,7 @@ int main(int argc, char *argv[])
     if (add) {
         if (!konsolekalendar->isEvent(startdatetime, enddatetime,
                                       variables.getSummary())) {
-            qDebug() << "main | modework |"
+            qCDebug(KONSOLEKALENDAR_LOG) << "main | modework |"
                      << "calling addEvent()";
             konsolekalendar->addEvent();
         } else {
@@ -815,7 +815,7 @@ int main(int argc, char *argv[])
     }
 
     if (change) {
-        qDebug() << "main | modework |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | modework |"
                  << "calling changeEvent()";
         if (!variables.isUID()) {
             cout << i18n("Missing event UID: "
@@ -828,12 +828,12 @@ int main(int argc, char *argv[])
                  << endl;
             return 1;
         }
-        qDebug() << "main | modework |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | modework |"
                  << "successful changeEvent()";
     }
 
     if (del) {
-        qDebug() << "main | modework |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | modework |"
                  << "calling deleteEvent()";
         if (!variables.isUID()) {
             cout << i18n("Missing event UID: "
@@ -846,12 +846,12 @@ int main(int argc, char *argv[])
                  << endl;
             return 1;
         }
-        qDebug() << "main | modework |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | modework |"
                  << "successful deleteEvent()";
     }
 
     if (view) {
-        qDebug() << "main | modework |"
+        qCDebug(KONSOLEKALENDAR_LOG) << "main | modework |"
                  << "calling showInstance() to view events";
         if (!konsolekalendar->showInstance()) {
             cout << i18n("Cannot open specified export file: %1",
@@ -863,7 +863,7 @@ int main(int argc, char *argv[])
 
     delete konsolekalendar;
 
-    qDebug() << "main | exiting";
+    qCDebug(KONSOLEKALENDAR_LOG) << "main | exiting";
 
     return 0;
 }


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

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