From e3b1daaadf9daff424c71ddcf642986f1bc1be8c Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 4 Aug 2009 12:20:05 +0300 Subject: Fixed some Qt coding style deviations for desktopservices demo --- demos/embedded/desktopservices/contenttab.cpp | 18 +++++++++--------- demos/embedded/desktopservices/linktab.cpp | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index 619f5c0..e2618b0 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -55,7 +55,7 @@ // CONSTRUCTORS & DESTRUCTORS ContentTab::ContentTab(QWidget *parent) : - QListWidget(parent) + QListWidget(parent) { setDragEnabled(false); setIconSize(QSize(45, 45)); @@ -113,19 +113,19 @@ QUrl ContentTab::itemUrl(QListWidgetItem *item) void ContentTab::keyPressEvent(QKeyEvent *event) { - switch(event->key()) { + switch (event->key()) { case Qt::Key_Up: - if(currentRow() == 0) { - setCurrentRow(count()-1); + if (currentRow() == 0) { + setCurrentRow(count() - 1); } else { - setCurrentRow(currentRow()-1); + setCurrentRow(currentRow() - 1); } break; case Qt::Key_Down: - if(currentRow() == (count()-1)) { + if (currentRow() == (count() - 1)) { setCurrentRow(0); } else { - setCurrentRow(currentRow()+1); + setCurrentRow(currentRow() + 1); } break; case Qt::Key_Select: @@ -139,14 +139,14 @@ void ContentTab::keyPressEvent(QKeyEvent *event) void ContentTab::handleErrorInOpen(QListWidgetItem *item) { Q_UNUSED(item); - QMessageBox::warning( this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close); + QMessageBox::warning(this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close); } // NEW SLOTS void ContentTab::openItem(QListWidgetItem *item) { bool ret = QDesktopServices::openUrl(itemUrl(item)); - if(!ret) + if (!ret) handleErrorInOpen(item); } diff --git a/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp index 32411fe..67dbccf 100644 --- a/demos/embedded/desktopservices/linktab.cpp +++ b/demos/embedded/desktopservices/linktab.cpp @@ -50,7 +50,7 @@ #include "linktab.h" LinkTab::LinkTab(QWidget *parent) : - ContentTab(parent) + ContentTab(parent) { } @@ -66,9 +66,9 @@ void LinkTab::populateListWidget() QUrl LinkTab::itemUrl(QListWidgetItem *item) { - if(m_WebItem == item) { + if (m_WebItem == item) { return QUrl(tr("http://www.qtsoftware.com")); - } else if(m_MailToItem == item) { + } else if (m_MailToItem == item) { return QUrl(tr("mailto:qts60-feedback@trolltech.com?subject=QtS60 feedback&body=Hello")); } else { // We should never endup here @@ -78,8 +78,8 @@ QUrl LinkTab::itemUrl(QListWidgetItem *item) } void LinkTab::handleErrorInOpen(QListWidgetItem *item) { - if(m_MailToItem == item) { - QMessageBox::warning( this, tr("Operation Failed"), tr("Please check that you have\ne-mail account defined."), QMessageBox::Close); + if (m_MailToItem == item) { + QMessageBox::warning(this, tr("Operation Failed"), tr("Please check that you have\ne-mail account defined."), QMessageBox::Close); } else { ContentTab::handleErrorInOpen(item); } -- cgit v0.12