From kde-commits Mon Apr 30 23:28:39 2012 From: Allen Winter Date: Mon, 30 Apr 2012 23:28:39 +0000 To: kde-commits Subject: [kdepim-runtime] resources/google: explict ctors Message-Id: <20120430232839.A8BA7A60A9 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133582866411317 Git commit a77e6d1adb6fc4957f31a9decfe6fce697396c96 by Allen Winter. Committed on 30/04/2012 at 22:54. Pushed by winterz into branch 'master'. explict ctors include guards rename to "GOOGLE_FOO" fix deprecated i18n usage reorder a few includes and remove at least 1 duplicate include M +4 -3 resources/google/calendar/calendareditor.cpp M +2 -2 resources/google/calendar/calendareditor.h M +2 -2 resources/google/calendar/calendarresource.h M +2 -2 resources/google/calendar/defaultreminderattribute.h M +11 -11 resources/google/calendar/resource_tasks.cpp M +4 -5 resources/google/calendar/settings.h M +1 -2 resources/google/calendar/settingsdialog.cpp M +9 -10 resources/google/calendar/settingsdialog.h M +4 -4 resources/google/calendar/tasklisteditor.h M +3 -3 resources/google/contacts/contactsresource.h M +2 -2 resources/google/contacts/settings.h M +3 -4 resources/google/contacts/settingsdialog.cpp M +5 -6 resources/google/contacts/settingsdialog.h http://commits.kde.org/kdepim-runtime/a77e6d1adb6fc4957f31a9decfe6fce697396= c96 diff --git a/resources/google/calendar/calendareditor.cpp b/resources/googl= e/calendar/calendareditor.cpp index 17c012e..f1a5c6a 100644 --- a/resources/google/calendar/calendareditor.cpp +++ b/resources/google/calendar/calendareditor.cpp @@ -68,14 +68,15 @@ void CalendarEditor::accepted() Q_EMIT accepted( m_calendar ); } = - void CalendarEditor::initTimezones() { = - Q_FOREACH ( const KTimeZone tz, KSystemTimeZones::zones() ) { + Q_FOREACH ( const KTimeZone &tz, KSystemTimeZones::zones() ) { QIcon icon; = - QString flag =3D KStandardDirs::locate( "locale", QString( "l10n/%1/fl= ag.png" ).arg( tz.countryCode().toLower() ) ); + QString flag =3D + KStandardDirs::locate( "locale", + QString( "l10n/%1/flag.png" ).arg( tz.country= Code().toLower() ) ); = if ( QFile::exists( flag ) ) { icon =3D QIcon( flag ); diff --git a/resources/google/calendar/calendareditor.h b/resources/google/= calendar/calendareditor.h index 23d56de..3133db1 100644 --- a/resources/google/calendar/calendareditor.h +++ b/resources/google/calendar/calendareditor.h @@ -16,8 +16,8 @@ */ = = -#ifndef CALENDAREDITOR_H -#define CALENDAREDITOR_H +#ifndef GOOGLE_CALENDAR_CALENDAREDITOR_H +#define GOOGLE_CALENDAR_CALENDAREDITOR_H = #include = diff --git a/resources/google/calendar/calendarresource.h b/resources/googl= e/calendar/calendarresource.h index 6030f55..11e7c3d 100644 --- a/resources/google/calendar/calendarresource.h +++ b/resources/google/calendar/calendarresource.h @@ -16,8 +16,8 @@ */ = = -#ifndef CALENDARRESOURCE_H -#define CALENDARRESOURCE_H +#ifndef GOOGLE_CALENDAR_CALENDARRESOURCE_H +#define GOOGLE_CALENDAR_CALENDARRESOURCE_H = #include #include diff --git a/resources/google/calendar/defaultreminderattribute.h b/resourc= es/google/calendar/defaultreminderattribute.h index dd3cd88..c35b82d 100644 --- a/resources/google/calendar/defaultreminderattribute.h +++ b/resources/google/calendar/defaultreminderattribute.h @@ -17,8 +17,8 @@ */ = = -#ifndef DEFAULTREMINDERATTRIBUTE_H -#define DEFAULTREMINDERATTRIBUTE_H +#ifndef GOOGLE_CALENDAR_DEFAULTREMINDERATTRIBUTE_H +#define GOOGLE_CALENDAR_DEFAULTREMINDERATTRIBUTE_H = #include = diff --git a/resources/google/calendar/resource_tasks.cpp b/resources/googl= e/calendar/resource_tasks.cpp index 18bd9d7..56ddb6d 100644 --- a/resources/google/calendar/resource_tasks.cpp +++ b/resources/google/calendar/resource_tasks.cpp @@ -114,14 +114,14 @@ void CalendarResource::taskListReceived( KJob *job ) void CalendarResource::taskReceived( KGoogle::Reply *reply ) { if ( reply->error() !=3D OK ) { - cancelTask( i18n( "Failed to fetch task: %1" ).arg( reply->errorString= () ) ); + cancelTask( i18n( "Failed to fetch task: %1", reply->errorString() ) ); return; } = QList< Object * > data =3D reply->replyData(); if ( data.length() !=3D 1 ) { kWarning() << "Server send " << data.length() << "items, which is not = OK"; - cancelTask( i18n( "Expected a single item, server sent %1 items." ).ar= g( data.length() ) ); + cancelTask( i18n( "Expected a single item, server sent %1 items.", dat= a.length() ) ); return; } = @@ -143,7 +143,7 @@ void CalendarResource::taskReceived( KGoogle::Reply *re= ply ) void CalendarResource::tasksReceived( KJob *job ) { if ( job->error() ) { - cancelTask( i18n( "Failed to fetch tasks: %1" ).arg( job->errorString(= ) ) ); + cancelTask( i18n( "Failed to fetch tasks: %1", job->errorString() ) ); return; } = @@ -184,14 +184,14 @@ void CalendarResource::tasksReceived( KJob *job ) void CalendarResource::taskCreated( KGoogle::Reply *reply ) { if ( reply->error() !=3D OK ) { - cancelTask( i18n( "Failed to create a task: %1" ).arg( reply->errorStr= ing() ) ); + cancelTask( i18n( "Failed to create a task: %1", reply->errorString() = ) ); return; } = QList< Object * > data =3D reply->replyData(); if ( data.length() !=3D 1 ) { kWarning() << "Server send " << data.length() << "items, which is not = OK"; - cancelTask( i18n( "Expected a single item, server sent %1 items." ).ar= g( data.length() ) ); + cancelTask( i18n( "Expected a single item, server sent %1 items.", da= ta.length() ) ); return; } = @@ -209,14 +209,14 @@ void CalendarResource::taskCreated( KGoogle::Reply *r= eply ) void CalendarResource::taskUpdated( KGoogle::Reply *reply ) { if ( reply->error() !=3D OK ) { - cancelTask( i18n( "Failed to update task: %1" ).arg( reply->errorStrin= g() ) ); + cancelTask( i18n( "Failed to update task: %1", reply->errorString() ) = ); return; } = QList< Object * > data =3D reply->replyData(); if ( data.length() !=3D 1 ) { kWarning() << "Server send " << data.length() << "items, which is not = OK"; - cancelTask( i18n( "Expected a single item, server sent %1 items." ).ar= g( data.length() ) ); + cancelTask( i18n( "Expected a single item, server sent %1 items.", dat= a.length() ) ); return; } = @@ -231,7 +231,7 @@ void CalendarResource::taskUpdated( KGoogle::Reply *rep= ly ) void CalendarResource::removeTaskFetchJobFinished( KJob *job ) { if ( job->error() ) { - cancelTask( i18n( "Failed to delete task (1): %1" ).arg( job->errorStr= ing() ) ); + cancelTask( i18n( "Failed to delete task (1): %1", job->errorString() = ) ); return; } = @@ -241,7 +241,7 @@ void CalendarResource::removeTaskFetchJobFinished( KJob= *job ) Item::List detachItems; = Item::List items =3D fetchJob->items(); - Q_FOREACH ( Item item, items ) { + Q_FOREACH ( Item item, items ) { //krazy:exclude=3Dforeach if( !item.hasPayload< Todo::Ptr >() ) { kDebug() << "Item " << item.remoteId() << " does not have Todo paylo= ad"; continue; @@ -275,7 +275,7 @@ void CalendarResource::removeTaskFetchJobFinished( KJob= *job ) void CalendarResource::doRemoveTask( KJob *job ) { if ( job->error() ) { - cancelTask( i18n( "Failed to delete task (2): %1" ).arg( job->errorStr= ing() ) ); + cancelTask( i18n( "Failed to delete task (2): %1", job->errorString() = ) ); return; } = @@ -297,7 +297,7 @@ void CalendarResource::doRemoveTask( KJob *job ) void CalendarResource::taskRemoved( KGoogle::Reply *reply ) { if ( reply->error() !=3D NoContent ) { - cancelTask( i18n( "Failed to delete task (5): %1" ).arg( reply->errorS= tring() ) ); + cancelTask( i18n( "Failed to delete task (5): %1", reply->errorString(= ) ) ); return; } = diff --git a/resources/google/calendar/settings.h b/resources/google/calend= ar/settings.h index 17503cf..11b395b 100644 --- a/resources/google/calendar/settings.h +++ b/resources/google/calendar/settings.h @@ -15,9 +15,8 @@ along with this program. If not, see . */ = - -#ifndef SETTINGS_H -#define SETTINGS_H +#ifndef GOOGLE_CALENDAR_SETTINGS_H +#define GOOGLE_CALENDAR_SETTINGS_H = #include "settingsbase.h" = @@ -32,8 +31,8 @@ */ class Settings: public SettingsBase { - Q_OBJECT - Q_CLASSINFO( "D-Bus Interface", "org.kde.Akonadi.GoogleCalendar.Extend= edSettings" ) + Q_OBJECT + Q_CLASSINFO( "D-Bus Interface", "org.kde.Akonadi.GoogleCalendar.Extended= Settings" ) public: Settings(); void setWindowId( WId id ); diff --git a/resources/google/calendar/settingsdialog.cpp b/resources/googl= e/calendar/settingsdialog.cpp index be26db0..7b2e45a 100644 --- a/resources/google/calendar/settingsdialog.cpp +++ b/resources/google/calendar/settingsdialog.cpp @@ -15,8 +15,8 @@ along with this program. If not, see . */ = -#include "calendareditor.h" #include "settingsdialog.h" +#include "calendareditor.h" #include "settings.h" #include "tasklisteditor.h" #include "ui_settingsdialog.h" @@ -25,7 +25,6 @@ #include #include = -#include #include #include #include diff --git a/resources/google/calendar/settingsdialog.h b/resources/google/= calendar/settingsdialog.h index 030d21d..673bd76 100644 --- a/resources/google/calendar/settingsdialog.h +++ b/resources/google/calendar/settingsdialog.h @@ -15,9 +15,8 @@ along with this program. If not, see . */ = - -#ifndef SETTINGSDIALOG_H -#define SETTINGSDIALOG_H +#ifndef GOOGLE_CALENDAR_SETTINGSDIALOG_H +#define GOOGLE_CALENDAR_SETTINGSDIALOG_H = #include #include @@ -26,16 +25,16 @@ #include = namespace Ui { -class SettingsDialog; + class SettingsDialog; } = namespace KGoogle { -class Reply; -class AccessManager; + class Reply; + class AccessManager; = namespace Objects { -class Calendar; -class TaskList; + class Calendar; + class TaskList; } } = @@ -45,9 +44,9 @@ using namespace KGoogle; = class SettingsDialog : public KDialog { - Q_OBJECT + Q_OBJECT public: - SettingsDialog( WId windowId, QWidget *parent =3D 0 ); + explicit SettingsDialog( WId windowId, QWidget *parent =3D 0 ); ~SettingsDialog(); = private Q_SLOTS: diff --git a/resources/google/calendar/tasklisteditor.h b/resources/google/= calendar/tasklisteditor.h index 5923adb..ec6b98e 100644 --- a/resources/google/calendar/tasklisteditor.h +++ b/resources/google/calendar/tasklisteditor.h @@ -16,20 +16,20 @@ */ = = -#ifndef TASKLISTEDITOR_H -#define TASKLISTEDITOR_H +#ifndef GOOGLE_CALENDAR_TASKLISTEDITOR_H +#define GOOGLE_CALENDAR_TASKLISTEDITOR_H = #include = #include = namespace Ui { -class TaskListEditor; + class TaskListEditor; } = class TasklistEditor : public QDialog { - Q_OBJECT + Q_OBJECT = public: explicit TasklistEditor( KGoogle::Objects::TaskList *taskList =3D 0 ); diff --git a/resources/google/contacts/contactsresource.h b/resources/googl= e/contacts/contactsresource.h index 1480990..2d4f8ea 100644 --- a/resources/google/contacts/contactsresource.h +++ b/resources/google/contacts/contactsresource.h @@ -16,8 +16,8 @@ */ = = -#ifndef CONTACTSRESOURCE_H -#define CONTACTSRESOURCE_H +#ifndef GOOGLE_CONTACTS_CONTACTSRESOURCE_H +#define GOOGLE_CONTACTS_CONTACTSRESOURCE_H = #include #include @@ -40,7 +40,7 @@ class QNetworkReply; using namespace KGoogle; = class ContactsResource: public Akonadi::ResourceBase, - public Akonadi::AgentBase::ObserverV2 = + public Akonadi::AgentBase::ObserverV2 { Q_OBJECT = diff --git a/resources/google/contacts/settings.h b/resources/google/contac= ts/settings.h index 184620f..778246e 100644 --- a/resources/google/contacts/settings.h +++ b/resources/google/contacts/settings.h @@ -16,8 +16,8 @@ */ = = -#ifndef SETTINGS_H -#define SETTINGS_H +#ifndef GOOGLE_CONTACTS_SETTINGS_H +#define GOOGLE_CONTACTS_SETTINGS_H = #include "settingsbase.h" = diff --git a/resources/google/contacts/settingsdialog.cpp b/resources/googl= e/contacts/settingsdialog.cpp index d84576a..6ea79c0 100644 --- a/resources/google/contacts/settingsdialog.cpp +++ b/resources/google/contacts/settingsdialog.cpp @@ -15,17 +15,16 @@ along with this program. If not, see . */ = -#include -#include - #include "settingsdialog.h" #include "ui_settingsdialog.h" #include "settings.h" = +#include +#include + #include #include = - using namespace KGoogle; = enum { diff --git a/resources/google/contacts/settingsdialog.h b/resources/google/= contacts/settingsdialog.h index ac97b6c..68c4fb2 100644 --- a/resources/google/contacts/settingsdialog.h +++ b/resources/google/contacts/settingsdialog.h @@ -15,25 +15,24 @@ along with this program. If not, see . */ = - -#ifndef SETTINGSDIALOG_H -#define SETTINGSDIALOG_H +#ifndef GOOGLE_CONTACTS_SETTINGSDIALOG_H +#define GOOGLE_CONTACTS_SETTINGSDIALOG_H = #include = #include = namespace Ui { -class SettingsDialog; + class SettingsDialog; } = class QTreeWidgetItem; = class SettingsDialog : public KDialog { - Q_OBJECT + Q_OBJECT public: - SettingsDialog( WId windowId, QWidget *parent =3D 0 ); + explicit SettingsDialog( WId windowId, QWidget *parent =3D 0 ); ~SettingsDialog(); = private Q_SLOTS: