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: fix up some richtext formatting in the i18n Message-Id: <20120430232839.D8873A60CE () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133582866711321 Git commit 9d55bb3a1b0700a54ba7875705455fae947afc9c by Allen Winter. Committed on 01/05/2012 at 00:53. Pushed by winterz into branch 'master'. fix up some richtext formatting in the i18n coding style fixes (long lines) M +89 -47 resources/google/calendar/settingsdialog.cpp M +16 -10 resources/google/contacts/settingsdialog.cpp http://commits.kde.org/kdepim-runtime/9d55bb3a1b0700a54ba7875705455fae947af= c9c diff --git a/resources/google/calendar/settingsdialog.cpp b/resources/googl= e/calendar/settingsdialog.cpp index bf1817c..a0826e6 100644 --- a/resources/google/calendar/settingsdialog.cpp +++ b/resources/google/calendar/settingsdialog.cpp @@ -131,7 +131,6 @@ void SettingsDialog::error( KGoogle::Error code, const = QString &msg ) Q_UNUSED( code ) } = - void SettingsDialog::saveSettings() { Settings::self()->setAccount( m_ui->accountsCombo->currentText() ); @@ -173,8 +172,9 @@ void SettingsDialog::reloadAccounts() m_ui->accountsCombo->setCurrentIndex( index ); } = - if ( accCnt !=3D m_ui->accountsCombo->count() ) + if ( accCnt !=3D m_ui->accountsCombo->count() ) { accountChanged(); + } = connect( m_ui->accountsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(accountChanged()) ); @@ -198,15 +198,20 @@ void SettingsDialog::addAccountClicked() void SettingsDialog::removeAccountClicked() { KGoogle::Account::Ptr account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = if ( KMessageBox::warningYesNo( this, i18n( "Do you really want to revoke access to account %1?" - "
This will revoke access to all resources using this acc= ount!", account->accountName() ), + "

This will revoke access to all resources using this acco= unt!

", + account->accountName() ), i18n( "Revoke Access?" ), - KStandardGuiItem::yes(), KStandardGuiItem::no(), QString(), KMessa= geBox::Dangerous ) !=3D KMessageBox::Yes ) { + KStandardGuiItem::yes(), + KStandardGuiItem::no(), + QString(), + KMessageBox::Dangerous ) !=3D KMessageBox::Yes ) { = return; } @@ -240,11 +245,13 @@ void SettingsDialog::accountChanged() KGoogle::Request *request; = m_ui->calendarsList->clear(); - request =3D new KGoogle::Request( Services::Calendar::fetchCalendarsUrl(= ), Request::FetchAll, "Calendar", account ); + request =3D new KGoogle::Request( Services::Calendar::fetchCalendarsUrl(= ), + Request::FetchAll, "Calendar", account ); m_gam->queueRequest( request ); = m_ui->tasksList->clear(); - request =3D new KGoogle::Request( Services::Tasks::fetchTaskListsUrl(), = Request::FetchAll, "Tasks", account ); + request =3D new KGoogle::Request( Services::Tasks::fetchTaskListsUrl(), + Request::FetchAll, "Tasks", account ); m_gam->sendRequest( request ); } = @@ -268,8 +275,9 @@ void SettingsDialog::addCalendar( KGoogle::Objects::Cal= endar *calendar ) QByteArray data; = account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->calendarsBox->setDisabled( true ); @@ -296,16 +304,19 @@ void SettingsDialog::editCalendarClicked() QList< QListWidgetItem * > selected; = selected =3D m_ui->calendarsList->selectedItems(); - if ( selected.isEmpty() ) + if ( selected.isEmpty() ) { return; + } = item =3D selected.first(); - if ( !item ) + if ( !item ) { return; + } = calendar =3D item->data( KGoogleObjectRole ).value< KGoogle::Objects::Ca= lendar * >(); - if ( !calendar ) + if ( !calendar ) { return; + } = CalendarEditor *editor =3D new CalendarEditor( calendar ); connect( editor, SIGNAL(accepted(KGoogle::Objects::Calendar*)), @@ -325,8 +336,9 @@ void SettingsDialog::editCalendar( KGoogle::Objects::Ca= lendar *calendar ) QByteArray data; = account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->calendarsBox->setDisabled( true ); @@ -353,22 +365,30 @@ void SettingsDialog::removeCalendarClicked() QList< QListWidgetItem * > selected; = selected =3D m_ui->calendarsList->selectedItems(); - if ( selected.isEmpty() ) + if ( selected.isEmpty() ) { return; + } = item =3D selected.first(); - if ( !item ) + if ( !item ) { return; + } = calendar =3D item->data( KGoogleObjectRole ).value< KGoogle::Objects::Ca= lendar * >(); - if ( !calendar ) + if ( !calendar ) { return; + } = - if ( KMessageBox::warningYesNo( this, - i18n( "Do you really want to remove calen= dar %1?
" - "This will remove the calendar f= rom Google servers as well!", calendar->title() ), - i18n( "Remove Calendar?" ), - KStandardGuiItem::yes(), KStandardGuiItem= ::no(), QString(), KMessageBox::Dangerous ) !=3D KStandardGuiItem::Yes ) { + if ( KMessageBox::warningYesNo( + this, + i18n( "Do you really want to remove calendar %1?" + "

This will remove the calendar from Google servers as we= ll!

", + calendar->title() ), + i18n( "Remove Calendar?" ), + KStandardGuiItem::yes(), + KStandardGuiItem::no(), + QString(), + KMessageBox::Dangerous ) !=3D KStandardGuiItem::Yes ) { = return; } @@ -378,8 +398,9 @@ void SettingsDialog::removeCalendarClicked() KGoogle::Request *request; = account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->calendarsBox->setDisabled( true ); @@ -413,8 +434,9 @@ void SettingsDialog::reloadCalendarsClicked() KGoogle::Request *request; = account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->calendarsBox->setDisabled( true ); @@ -426,7 +448,8 @@ void SettingsDialog::reloadCalendarsClicked() connect( gam, SIGNAL(requestFinished(KGoogle::Request*)), gam, SLOT(deleteLater()) ); = - request =3D new KGoogle::Request( Services::Calendar::fetchCalendarsUrl(= ), Request::FetchAll, "Calendar", account ); + request =3D new KGoogle::Request( Services::Calendar::fetchCalendarsUrl(= ), + Request::FetchAll, "Calendar", account ); gam->sendRequest( request ); } = @@ -439,8 +462,9 @@ void SettingsDialog::addTaskList( TaskList *taskList ) QByteArray data; = account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->tasksBox->setDisabled( true ); @@ -451,7 +475,8 @@ void SettingsDialog::addTaskList( TaskList *taskList ) connect( gam, SIGNAL(requestFinished(KGoogle::Request*)), gam, SLOT(deleteLater()) ); = - request =3D new KGoogle::Request( Services::Tasks::createTaskListUrl(), = Request::Create, "Tasks", account ); + request =3D new KGoogle::Request( Services::Tasks::createTaskListUrl(), + Request::Create, "Tasks", account ); data =3D parser.objectToJSON( dynamic_cast< KGoogle::Object * >( taskLis= t ) ); request->setRequestData( data, "application/json" ); gam->sendRequest( request ); @@ -466,16 +491,19 @@ void SettingsDialog::editTaskListClicked() QList< QListWidgetItem * > selected; = selected =3D m_ui->tasksList->selectedItems(); - if ( selected.isEmpty() ) + if ( selected.isEmpty() ) { return; + } = item =3D selected.first(); - if ( !item ) + if ( !item ) { return; + } = taskList =3D item->data( KGoogleObjectRole ).value< KGoogle::Objects::Ta= skList * >(); - if ( !taskList ) + if ( !taskList ) { return; + } = TasklistEditor *editor =3D new TasklistEditor( taskList ); connect( editor, SIGNAL(accepted(KGoogle::Objects::TaskList*)), @@ -495,8 +523,9 @@ void SettingsDialog::editTaskList( TaskList *taskList ) QByteArray data; = account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->tasksBox->setDisabled( true ); @@ -523,22 +552,30 @@ void SettingsDialog::removeTaskListClicked() QList< QListWidgetItem * > selected; = selected =3D m_ui->calendarsList->selectedItems(); - if ( selected.isEmpty() ) + if ( selected.isEmpty() ) { return; + } = item =3D selected.first(); - if ( !item ) + if ( !item ) { return; + } = taskList =3D item->data( KGoogleObjectRole ).value< KGoogle::Objects::Ta= skList * >(); - if ( !taskList ) + if ( !taskList ) { return; + } = - if ( KMessageBox::warningYesNo( this, - i18n( "Do you really want to remove taskl= ist %1?
" - "This will remove the tasklist f= rom Google servers as well!", taskList->title() ), - i18n( "Remove tasklist?" ), - KStandardGuiItem::yes(), KStandardGuiItem= ::no(), QString(), KMessageBox::Dangerous ) !=3D KStandardGuiItem::Yes ) { + if ( KMessageBox::warningYesNo( + this, + i18n( "Do you really want to remove tasklist %1?" + "

This will remove the tasklist from Google servers as we= ll!

", + taskList->title() ), + i18n( "Remove tasklist?" ), + KStandardGuiItem::yes(), + KStandardGuiItem::no(), + QString(), + KMessageBox::Dangerous ) !=3D KStandardGuiItem::Yes ) { = return; } @@ -548,8 +585,9 @@ void SettingsDialog::removeTaskListClicked() KGoogle::Request *request; = account =3D m_ui->accountsCombo->currentAccount(); - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->tasksBox->setDisabled( true ); @@ -572,8 +610,9 @@ void SettingsDialog::reloadTaskListsClicked() KGoogle::Request *request; = account =3D m_ui->accountsCombo->currentAccount(); - if ( !account ) + if ( !account ) { return; + } = m_ui->accountsBox->setDisabled( true ); m_ui->tasksBox->setDisabled( true ); @@ -586,7 +625,8 @@ void SettingsDialog::reloadTaskListsClicked() connect( gam, SIGNAL(requestFinished(KGoogle::Request*)), gam, SLOT(deleteLater()) ); = - request =3D new KGoogle::Request( Services::Tasks::fetchTaskListsUrl(), = Request::FetchAll, "Tasks", account ); + request =3D new KGoogle::Request( Services::Tasks::fetchTaskListsUrl(), + Request::FetchAll, "Tasks", account ); gam->sendRequest( request ); } = @@ -631,7 +671,6 @@ void SettingsDialog::gam_objectCreated( Reply *reply ) delete reply; } = - void SettingsDialog::gam_objectsListReceived( Reply *reply ) { QList< KGoogle::Object * > objects =3D reply->replyData(); @@ -648,10 +687,11 @@ void SettingsDialog::gam_objectsListReceived( Reply *= reply ) item->setData( KGoogleObjectRole, qVariantFromValue( calendar ) ); item->setData( ObjectUIDRole, calendar->uid() ); = - if ( Settings::self()->calendars().contains( calendar->uid() ) ) + if ( Settings::self()->calendars().contains( calendar->uid() ) ) { item->setCheckState( Qt::Checked ); - else + } else { item->setCheckState( Qt::Unchecked ); + } = m_ui->calendarsList->addItem( item ); } @@ -661,7 +701,7 @@ void SettingsDialog::gam_objectsListReceived( Reply *re= ply ) = } else if ( reply->serviceName() =3D=3D "Tasks" ) { = - Q_FOREACH ( KGoogle::Object * object, objects ) { + Q_FOREACH ( KGoogle::Object *object, objects ) { Objects::TaskList *taskList; QListWidgetItem *item; = @@ -671,10 +711,11 @@ void SettingsDialog::gam_objectsListReceived( Reply *= reply ) item->setData( KGoogleObjectRole, qVariantFromValue( taskList ) ); item->setData( ObjectUIDRole, taskList->uid() ); = - if ( Settings::self()->taskLists().contains( taskList->uid() ) ) + if ( Settings::self()->taskLists().contains( taskList->uid() ) ) { item->setCheckState( Qt::Checked ); - else + } else { item->setCheckState( Qt::Unchecked ); + } = m_ui->tasksList->addItem( item ); } @@ -684,8 +725,9 @@ void SettingsDialog::gam_objectsListReceived( Reply *re= ply ) = } = - if ( m_ui->calendarsBox->isEnabled() && m_ui->tasksList->isEnabled() ) + if ( m_ui->calendarsBox->isEnabled() && m_ui->tasksList->isEnabled() ) { m_ui->accountsBox->setEnabled( true ); + } } = void SettingsDialog::gam_objectModified( Reply *reply ) diff --git a/resources/google/contacts/settingsdialog.cpp b/resources/googl= e/contacts/settingsdialog.cpp index 5e2bd1f..e734a3b 100644 --- a/resources/google/contacts/settingsdialog.cpp +++ b/resources/google/contacts/settingsdialog.cpp @@ -77,18 +77,17 @@ void SettingsDialog::saveSettings() Settings::self()->writeConfig(); } = - void SettingsDialog::error( KGoogle::Error errCode, const QString &msg ) { - if ( errCode =3D=3D KGoogle::OK ) + if ( errCode =3D=3D KGoogle::OK ) { return; + } = KMessageBox::error( this, msg, i18n( "An error occurred" ) ); = m_ui->accountsBox->setEnabled( true ); } = - void SettingsDialog::reloadAccounts() { m_ui->accountsCombo->reload(); @@ -96,8 +95,9 @@ void SettingsDialog::reloadAccounts() QString accName =3D Settings::self()->account(); int index =3D -1; = - if ( !accName.isEmpty() ) + if ( !accName.isEmpty() ) { index =3D m_ui->accountsCombo->findText( accName ); + } = if ( index > -1 ) { m_ui->accountsCombo->setCurrentIndex( index ); @@ -122,14 +122,20 @@ void SettingsDialog::removeAccountClicked() { KGoogle::Account::Ptr account =3D m_ui->accountsCombo->currentAccount(); = - if ( account.isNull() ) + if ( account.isNull() ) { return; + } = - if ( KMessageBox::warningYesNo( this, - i18n( "Do you really want to revoke acces= s to account %1?" - "
This will revoke access to all= resources using this account!", account->accountName() ), - i18n( "Revoke Access?" ), - KStandardGuiItem::yes(), KStandardGuiItem= ::no(), QString(), KMessageBox::Dangerous ) !=3D KMessageBox::Yes ) { + if ( KMessageBox::warningYesNo( + this, + i18n( "Do you really want to revoke access to account %1?" + "

This will revoke access to all resources using this acc= ount!

", + account->accountName() ), + i18n( "Revoke Access?" ), + KStandardGuiItem::yes(), + KStandardGuiItem::no(), + QString(), + KMessageBox::Dangerous ) !=3D KMessageBox::Yes ) { = return; }