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 [Licen= se: 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/konsolekalend= ar/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/konsolek= alendar/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 +#include "konsolekalendar_debug.h" #include #include = @@ -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 : %1", filename).toLocal8Bi= t().data() << endl; } else { - qDebug() << "konsolekalendar.cpp::createCalendar() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::createCalend= ar() |" << "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 =3D false; - qDebug() << "konsolekalendar.cpp::showInstance() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::show= Instance() |" << "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::showInst= ance() |" << "opened successful"; = if (m_variables->isVerbose()) { @@ -204,11 +204,11 @@ bool KonsoleKalendar::showInstance() m_variables->getExportType() !=3D ExportTypeMonthHTML)= { = if (m_variables->getAll()) { - qDebug() << "konsolekalendar.cpp::showInstance() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::= showInstance() |" << "view all events sorted list"; = Event::List sortedList =3D calendar->events(EventSortS= tartDate); - 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 =3D calendar->event(m_variables->getUID()); @@ -226,7 +226,7 @@ bool KonsoleKalendar::showInstance() status =3D printEvent(&ts, event, event->dtStart().dat= e()); = } else if (m_variables->isNext()) { - qDebug() << "konsolekalendar.cpp::showInstance() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::= showInstance() |" << "Show next activity in calendar"; = QDateTime datetime =3D m_variables->getStartDateTime(); @@ -239,17 +239,17 @@ bool KonsoleKalendar::showInstance() Event::List events =3D calendar->events(dt, timeSp= ec, EventSortSta= rtDate, SortDirectio= nAscending); - qDebug() << "2-Found" << events.count() << "events= on date" << dt; + qCDebug(KONSOLEKALENDAR_LOG) << "2-Found" << event= s.count() << "events on date" << dt; // finished here when we get the next event if (!events.isEmpty()) { - qDebug() << "konsolekalendar.cpp::showInstance= () |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalend= ar.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 =3D calendar->events(dt, timeSp= ec, EventSortSta= rtDate, SortDirectio= nAscending); - qDebug() << "3-Found" << events.count() << "events= on date: " << dt; + qCDebug(KONSOLEKALENDAR_LOG) << "3-Found" << event= s.count() << "events on date: " << dt; status =3D 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 =3D 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 supp= orted yet"). toLocal8Bit().data() << endl; return false; } else { - qDebug() << "konsolekalendar.cpp::showInstance() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::= showInstance() |" << "HTML view raw events within date range li= st"; firstdate =3D m_variables->getStartDateTime().date(); lastdate =3D m_variables->getEndDateTime().date(); @@ -346,7 +346,7 @@ bool KonsoleKalendar::printEventList(QTextStream *ts, { bool status =3D 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, con= st Event::Ptr &event, QDate switch (m_variables->getExportType()) { = case ExportTypeCSV: - qDebug() << "konsolekalendar.cpp::printEvent() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::printEve= nt() |" << "CSV export"; status =3D exports.exportAsCSV(ts, event, dt); break; = case ExportTypeTextShort: - qDebug() << "konsolekalendar.cpp::printEvent() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::printEve= nt() |" << "TEXT-SHORT export"; if (dt.daysTo(m_saveDate)) { sameDay =3D 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::printEve= nt() |" << "TEXT export"; status =3D exports.exportAsTxt(ts, event, dt); break; @@ -404,10 +404,10 @@ bool KonsoleKalendar::printEvent(QTextStream *ts, con= st 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/ko= nsolekalendar/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 + + 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 Lice= nse + 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/kons= olekalendar/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 + + 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 Lice= nse + 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 +Q_DECLARE_LOGGING_CATEGORY(KONSOLEKALENDAR_LOG) + +#endif = + diff --git a/console/konsolekalendar/konsolekalendaradd.cpp b/console/konso= lekalendar/konsolekalendaradd.cpp index 1b23492..d3d9f52 100644 --- a/console/konsolekalendar/konsolekalendaradd.cpp +++ b/console/konsolekalendar/konsolekalendaradd.cpp @@ -34,7 +34,7 @@ = #include = -#include +#include "konsolekalendar_debug.h" = #include #include @@ -72,7 +72,7 @@ bool KonsoleKalendarAdd::addEvent() { bool status =3D true; = - qDebug() << "konsolekalendaradd.cpp::addEvent()"; + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendaradd.cpp::addEvent()"; = if (m_variables->isDryRun()) { cout << i18n("Insert Event :").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 =3D calendar->incidence(event->uid()) !=3D 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::importCal= endar() |" << "Can't import file:" << m_variables->getImportFile(); return false; } - qDebug() << "konsolekalendaradd.cpp::importCalendar() |" + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendaradd.cpp::importCalen= dar() |" << "Successfully imported file:" << m_variables->getImportFile(); */ diff --git a/console/konsolekalendar/konsolekalendarchange.cpp b/console/ko= nsolekalendar/konsolekalendarchange.cpp index 6efbe7a..8cdd028 100644 --- a/console/konsolekalendar/konsolekalendarchange.cpp +++ b/console/konsolekalendar/konsolekalendarchange.cpp @@ -32,7 +32,7 @@ */ #include "konsolekalendarchange.h" = -#include +#include "konsolekalendar_debug.h" #include = #include @@ -57,7 +57,7 @@ bool KonsoleKalendarChange::changeEvent() { bool status =3D false; = - qDebug() << "konsolekalendarchange.cpp::changeEvent()"; + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendarchange.cpp::changeEven= t()"; = /* * 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:cha= ngeEvent() :" << 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::changeEven= t() | Done"; return status; } = diff --git a/console/konsolekalendar/konsolekalendardelete.cpp b/console/ko= nsolekalendar/konsolekalendardelete.cpp index 9f91bc1..3a3d6cc 100644 --- a/console/konsolekalendar/konsolekalendardelete.cpp +++ b/console/konsolekalendar/konsolekalendardelete.cpp @@ -35,7 +35,7 @@ #include #include = -#include +#include "konsolekalendar_debug.h" #include #include = @@ -55,7 +55,7 @@ bool KonsoleKalendarDelete::deleteEvent() { bool status =3D false; = - qDebug() << "konsolekalendardelete.cpp::deleteEvent()"; + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendardelete.cpp::deleteEven= t()"; = /* * 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:del= eteEvent() :" << m_variables->getUID().data(); = if (m_variables->isVerbose()) { @@ -81,7 +81,7 @@ bool KonsoleKalendarDelete::deleteEvent() QObject::connect(calendar.data(), SIGNAL(deleteFinished(bool,Q= String)), &loop, SLOT(quit())); calendar->deleteEvent(event); loop.exec(); - qDebug() << "Finished deleting"; + qCDebug(KONSOLEKALENDAR_LOG) << "Finished deleting"; status =3D calendar->incidence(event->uid()) =3D=3D 0; = if (status) { @@ -92,7 +92,7 @@ bool KonsoleKalendarDelete::deleteEvent() } } = - qDebug() << "konsolekalendardelete.cpp::deleteEvent() | Done"; + qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendardelete.cpp::deleteEven= t() | Done"; return status; } = diff --git a/console/konsolekalendar/konsolekalendarexports.cpp b/console/k= onsolekalendar/konsolekalendarexports.cpp index bac9835..e293f54 100644 --- a/console/konsolekalendar/konsolekalendarexports.cpp +++ b/console/konsolekalendar/konsolekalendarexports.cpp @@ -32,7 +32,7 @@ */ #include "konsolekalendarexports.h" = -#include +#include "konsolekalendar_debug.h" #include = #include 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 -#include +#include "konsolekalendar_debug.h" #include = #include diff --git a/console/konsolekalendar/main.cpp b/console/konsolekalendar/mai= n.cpp index eac3ebc..77c9c24 100644 --- a/console/konsolekalendar/main.cpp +++ b/console/konsolekalendar/main.cpp @@ -43,7 +43,7 @@ #include #include = -#include +#include "konsolekalendar_debug.h" #include = #include @@ -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().d= ata() << endl; return 1; } if (args->isSet("journal")) { variables.setUseJournals(true); - qDebug() << "main | parse options | use Journals"; + qCDebug(KONSOLEKALENDAR_LOG) << "main | parse options | use Journa= ls"; 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 =3D args->getOption("export-type"); = if (option.toUpper() =3D=3D QLatin1String("HTML")) { - qDebug() << "main | export-type | Export to HTML"; + qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export t= o HTML"; variables.setExportType(ExportTypeHTML); } else if (option.toUpper() =3D=3D QLatin1String("HTMLMONTH")) { - qDebug() << "main | export-type | Export to HTML by Month"; + qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export t= o HTML by Month"; variables.setExportType(ExportTypeMonthHTML); } else if (option.toUpper() =3D=3D QLatin1String("CSV")) { - qDebug() << "main | export-type | Export to CSV"; + qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export t= o CSV"; variables.setExportType(ExportTypeCSV); } else if (option.toUpper() =3D=3D QLatin1String("TEXT")) { - qDebug() << "main | export-type | Export to TEXT (default)"; + qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export t= o TEXT (default)"; variables.setExportType(ExportTypeText); } else if (option.toUpper() =3D=3D QLatin1String("SHORT")) { - qDebug() << "main | export-type | Export to TEXT-SHORT"; + qCDebug(KONSOLEKALENDAR_LOG) << "main | export-type | Export t= o TEXT-SHORT"; variables.setExportType(ExportTypeTextShort); } else { cout << i18n("Invalid Export Type Specified: %1", option).toLo= cal8Bit().data() @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) if (args->isSet("export-file")) { option =3D 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 =3D 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 =3D false; add =3D 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 =3D false; change =3D 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 =3D false; del =3D 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 =3D false; create =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D startdate; enddate =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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=3D" <<= calendar->isLoaded() << "; num incidences=3D" << calendar->incidences().co= unt(); + qCDebug(KONSOLEKALENDAR_LOG) << "Calendar loaded in" << t.elapsed() <<= "ms; success=3D" << calendar->isLoaded() << "; num incidences=3D" << calen= dar->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 =3D startdate; - qDebug() << "main | datetimestamp |" + qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |" << "setting enddate to startdate"; } else if (args->isSet("end-date") && !args->isSet("date")) { startdate =3D 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 =3D starttime.addSecs(60 * 60); // end is 1 hour af= ter start - qDebug() << "main | datetimestamp |" + qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |" << "setting endtime 1 hour after starttime"; } else if (args->isSet("epoch-start")) { startdatetime =3D epochs.epoch2QDateTime(epochstart); enddatetime =3D 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 =3D 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 =3D epochs.epoch2QDateTime(epochend); startdatetime =3D 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 =3D 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 =3D 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 =3D QDateTime(startdate, starttime); - qDebug() << "main | datetimestamp |" + qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp |" << "setting startdatetime from startdate and starttime"; } if (enddatetime.isNull()) { enddatetime =3D 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=3D" + qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp | StartDate=3D" << startdatetime.toString(Qt::TextDate); - qDebug() << "main | datetimestamp | EndDate=3D" + qCDebug(KONSOLEKALENDAR_LOG) << "main | datetimestamp | EndDate=3D" << 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; }