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

List:       kde-commits
Subject:    [kdepim-runtime] resources/google: explict ctors
From:       Allen Winter <allen.winter () kdab ! com>
Date:       2012-04-30 23:28:39
Message-ID: 20120430232839.A8BA7A60A9 () git ! kde ! org
[Download RAW message or body]

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/a77e6d1adb6fc4957f31a9decfe6fce697396c96

diff --git a/resources/google/calendar/calendareditor.cpp \
b/resources/google/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 = KStandardDirs::locate( "locale", QString( "l10n/%1/flag.png" \
).arg( tz.countryCode().toLower() ) ); +    QString flag =
+      KStandardDirs::locate( "locale",
+                             QString( "l10n/%1/flag.png" ).arg( \
tz.countryCode().toLower() ) );  
     if ( QFile::exists( flag ) ) {
       icon = 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 <QtGui/QDialog>
 
diff --git a/resources/google/calendar/calendarresource.h \
b/resources/google/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 <Akonadi/AgentBase>
 #include <Akonadi/ResourceBase>
diff --git a/resources/google/calendar/defaultreminderattribute.h \
b/resources/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 <libkgoogle/objects/calendar.h>
 
diff --git a/resources/google/calendar/resource_tasks.cpp \
b/resources/google/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() != OK ) {
-    cancelTask( i18n( "Failed to fetch task: %1" ).arg( reply->errorString() ) );
+    cancelTask( i18n( "Failed to fetch task: %1", reply->errorString() ) );
     return;
   }
 
   QList< Object * > data = reply->replyData();
   if ( data.length() != 1 ) {
     kWarning() << "Server send " << data.length() << "items, which is not OK";
-    cancelTask( i18n( "Expected a single item, server sent %1 items." ).arg( \
data.length() ) ); +    cancelTask( i18n( "Expected a single item, server sent %1 \
items.", data.length() ) );  return;
   }
 
@@ -143,7 +143,7 @@ void CalendarResource::taskReceived( KGoogle::Reply *reply )
 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() != OK ) {
-    cancelTask( i18n( "Failed to create a task: %1" ).arg( reply->errorString() ) );
+    cancelTask( i18n( "Failed to create a task: %1", reply->errorString() ) );
     return;
   }
 
   QList< Object * > data = reply->replyData();
   if ( data.length() != 1 ) {
     kWarning() << "Server send " << data.length() << "items, which is not OK";
-    cancelTask( i18n( "Expected a single item, server sent %1 items." ).arg( \
data.length() ) ); +    cancelTask( i18n( "Expected a single item, server sent %1 \
items.",  data.length() ) );  return;
   }
 
@@ -209,14 +209,14 @@ void CalendarResource::taskCreated( KGoogle::Reply *reply )
 void CalendarResource::taskUpdated( KGoogle::Reply *reply )
 {
   if ( reply->error() != OK ) {
-    cancelTask( i18n( "Failed to update task: %1" ).arg( reply->errorString() ) );
+    cancelTask( i18n( "Failed to update task: %1", reply->errorString() ) );
     return;
   }
 
   QList< Object * > data = reply->replyData();
   if ( data.length() != 1 ) {
     kWarning() << "Server send " << data.length() << "items, which is not OK";
-    cancelTask( i18n( "Expected a single item, server sent %1 items." ).arg( \
data.length() ) ); +    cancelTask( i18n( "Expected a single item, server sent %1 \
items.", data.length() ) );  return;
   }
 
@@ -231,7 +231,7 @@ void CalendarResource::taskUpdated( KGoogle::Reply *reply )
 void CalendarResource::removeTaskFetchJobFinished( KJob *job )
 {
   if ( job->error() ) {
-    cancelTask( i18n( "Failed to delete task (1): %1" ).arg( job->errorString() ) );
+    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 = fetchJob->items();
-  Q_FOREACH ( Item item, items ) {
+  Q_FOREACH ( Item item, items ) { //krazy:exclude=foreach
     if( !item.hasPayload< Todo::Ptr >() ) {
       kDebug() << "Item " << item.remoteId() << " does not have Todo payload";
       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->errorString() ) );
+    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() != NoContent ) {
-    cancelTask( i18n( "Failed to delete task (5): %1" ).arg( reply->errorString() ) \
); +    cancelTask( i18n( "Failed to delete task (5): %1", reply->errorString() ) );
     return;
   }
 
diff --git a/resources/google/calendar/settings.h \
b/resources/google/calendar/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 <http://www.gnu.org/licenses/>.
 */
 
-
-#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.ExtendedSettings" ) +  Q_OBJECT
+  Q_CLASSINFO( "D-Bus Interface", "org.kde.Akonadi.GoogleCalendar.ExtendedSettings" \
)  public:
     Settings();
     void setWindowId( WId id );
diff --git a/resources/google/calendar/settingsdialog.cpp \
b/resources/google/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 <http://www.gnu.org/licenses/>.
 */
 
-#include "calendareditor.h"
 #include "settingsdialog.h"
+#include "calendareditor.h"
 #include "settings.h"
 #include "tasklisteditor.h"
 #include "ui_settingsdialog.h"
@@ -25,7 +25,6 @@
 #include <QtGui/QIcon>
 #include <QtGui/QListWidget>
 
-#include <KMessageBox>
 #include <KWindowSystem>
 #include <KLocalizedString>
 #include <KMessageBox>
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 <http://www.gnu.org/licenses/>.
 */
 
-
-#ifndef SETTINGSDIALOG_H
-#define SETTINGSDIALOG_H
+#ifndef GOOGLE_CALENDAR_SETTINGSDIALOG_H
+#define GOOGLE_CALENDAR_SETTINGSDIALOG_H
 
 #include <KDialog>
 #include <KJob>
@@ -26,16 +25,16 @@
 #include <libkgoogle/common.h>
 
 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 = 0 );
+    explicit SettingsDialog( WId windowId, QWidget *parent = 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 <QtGui/QDialog>
 
 #include <libkgoogle/objects/tasklist.h>
 
 namespace Ui {
-class TaskListEditor;
+  class TaskListEditor;
 }
 
 class TasklistEditor : public QDialog
 {
-    Q_OBJECT
+  Q_OBJECT
 
   public:
     explicit TasklistEditor( KGoogle::Objects::TaskList *taskList = 0 );
diff --git a/resources/google/contacts/contactsresource.h \
b/resources/google/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 <Akonadi/ResourceBase>
 #include <Akonadi/AgentBase>
@@ -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/contacts/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/google/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 <http://www.gnu.org/licenses/>.
 */
 
-#include <KMessageBox>
-#include <KWindowSystem>
-
 #include "settingsdialog.h"
 #include "ui_settingsdialog.h"
 #include "settings.h"
 
+#include <KMessageBox>
+#include <KWindowSystem>
+
 #include <libkgoogle/auth.h>
 #include <libkgoogle/services/contacts.h>
 
-
 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 <http://www.gnu.org/licenses/>.
 */
 
-
-#ifndef SETTINGSDIALOG_H
-#define SETTINGSDIALOG_H
+#ifndef GOOGLE_CONTACTS_SETTINGSDIALOG_H
+#define GOOGLE_CONTACTS_SETTINGSDIALOG_H
 
 #include <KDialog>
 
 #include <libkgoogle/common.h>
 
 namespace Ui {
-class SettingsDialog;
+  class SettingsDialog;
 }
 
 class QTreeWidgetItem;
 
 class SettingsDialog : public KDialog
 {
-    Q_OBJECT
+  Q_OBJECT
   public:
-    SettingsDialog( WId windowId, QWidget *parent = 0 );
+    explicit SettingsDialog( WId windowId, QWidget *parent = 0 );
     ~SettingsDialog();
 
   private Q_SLOTS:


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

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