diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-08-04 05:13:02 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-08-04 05:14:04 (GMT) |
commit | 76629bf75b29a29e8532943e530bb5455ee9cdf8 (patch) | |
tree | 5990d6ea5ba065685c56bffe99f520808703f157 /demos/embedded/desktopservices | |
parent | 796fea3ddd24e8be22196607500439f4db8e8332 (diff) | |
download | Qt-76629bf75b29a29e8532943e530bb5455ee9cdf8.zip Qt-76629bf75b29a29e8532943e530bb5455ee9cdf8.tar.gz Qt-76629bf75b29a29e8532943e530bb5455ee9cdf8.tar.bz2 |
Trailing whitespace and tab/space fixes for demos/embedded
Diffstat (limited to 'demos/embedded/desktopservices')
-rw-r--r-- | demos/embedded/desktopservices/contenttab.cpp | 36 | ||||
-rw-r--r-- | demos/embedded/desktopservices/contenttab.h | 26 | ||||
-rw-r--r-- | demos/embedded/desktopservices/desktopservices.pro | 4 | ||||
-rw-r--r-- | demos/embedded/desktopservices/desktopservices.qrc | 10 | ||||
-rw-r--r-- | demos/embedded/desktopservices/desktopwidget.cpp | 36 | ||||
-rw-r--r-- | demos/embedded/desktopservices/desktopwidget.h | 16 | ||||
-rw-r--r-- | demos/embedded/desktopservices/linktab.h | 30 | ||||
-rw-r--r-- | demos/embedded/desktopservices/main.cpp | 4 |
8 files changed, 81 insertions, 81 deletions
diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index bdc5e03..619f5c0 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -53,32 +53,32 @@ #include "contenttab.h" -// CONSTRUCTORS & DESTRUCTORS -ContentTab::ContentTab(QWidget *parent) : +// CONSTRUCTORS & DESTRUCTORS +ContentTab::ContentTab(QWidget *parent) : QListWidget(parent) -{ +{ setDragEnabled(false); setIconSize(QSize(45, 45)); } - -ContentTab::~ContentTab() + +ContentTab::~ContentTab() { } // NEW PUBLIC METHODS -void ContentTab::init(const QDesktopServices::StandardLocation &location, - const QString &filter, +void ContentTab::init(const QDesktopServices::StandardLocation &location, + const QString &filter, const QString &icon) { setContentDir(location); QStringList filterList; filterList = filter.split(";"); - m_ContentDir.setNameFilters(filterList); - setIcon(icon); - + m_ContentDir.setNameFilters(filterList); + setIcon(icon); + connect(this, SIGNAL(itemClicked(QListWidgetItem *)), - this, SLOT(openItem(QListWidgetItem *))); - + this, SLOT(openItem(QListWidgetItem *))); + populateListWidget(); } @@ -98,7 +98,7 @@ void ContentTab::populateListWidget() QFileInfoList fileList = m_ContentDir.entryInfoList(QDir::Files, QDir::Time); foreach(QFileInfo item, fileList) { new QListWidgetItem(m_Icon, itemName(item), this); - } + } } QString ContentTab::itemName(const QFileInfo &item) @@ -111,21 +111,21 @@ QUrl ContentTab::itemUrl(QListWidgetItem *item) return QUrl("file:///" + m_ContentDir.absolutePath() + "/" + item->text()); } -void ContentTab::keyPressEvent(QKeyEvent *event) +void ContentTab::keyPressEvent(QKeyEvent *event) { switch(event->key()) { case Qt::Key_Up: if(currentRow() == 0) { setCurrentRow(count()-1); } else { - setCurrentRow(currentRow()-1); + setCurrentRow(currentRow()-1); } break; case Qt::Key_Down: if(currentRow() == (count()-1)) { - setCurrentRow(0); + setCurrentRow(0); } else { - setCurrentRow(currentRow()+1); + setCurrentRow(currentRow()+1); } break; case Qt::Key_Select: @@ -138,7 +138,7 @@ void ContentTab::keyPressEvent(QKeyEvent *event) void ContentTab::handleErrorInOpen(QListWidgetItem *item) { - Q_UNUSED(item); + Q_UNUSED(item); QMessageBox::warning( this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close); } diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index 8d37209..21da07f 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -61,41 +61,41 @@ QT_END_NAMESPACE /** * ContentTab class. -* +* * This class implements general purpose tab for media files. */ class ContentTab : public QListWidget { Q_OBJECT -public: // Constructors & Destructors +public: // Constructors & Destructors ContentTab(QWidget *parent); virtual ~ContentTab(); - + public: // New Methods - virtual void init(const QDesktopServices::StandardLocation &location, - const QString &filter, - const QString &icon); - + virtual void init(const QDesktopServices::StandardLocation &location, + const QString &filter, + const QString &icon); + protected: // New Methods virtual void setContentDir(const QDesktopServices::StandardLocation &location); - virtual void setIcon(const QString &icon); + virtual void setIcon(const QString &icon); virtual void populateListWidget(); virtual QString itemName(const QFileInfo &item); virtual QUrl itemUrl(QListWidgetItem *item); virtual void handleErrorInOpen(QListWidgetItem *item); protected: - void keyPressEvent(QKeyEvent *event); - + void keyPressEvent(QKeyEvent *event); + public slots: // New Slots - virtual void openItem(QListWidgetItem *item); + virtual void openItem(QListWidgetItem *item); -protected: // Owned variables +protected: // Owned variables QDir m_ContentDir; QIcon m_Icon; }; -#endif // CONTENTTAB_H_ +#endif // CONTENTTAB_H_ // End of File diff --git a/demos/embedded/desktopservices/desktopservices.pro b/demos/embedded/desktopservices/desktopservices.pro index 32cb6d9..32dfa40 100644 --- a/demos/embedded/desktopservices/desktopservices.pro +++ b/demos/embedded/desktopservices/desktopservices.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = +TARGET = INCLUDEPATH += . HEADERS += desktopwidget.h contenttab.h linktab.h @@ -18,6 +18,6 @@ DEPLOYMENT += music image include($$QT_SOURCE_TREE/demos/demobase.pri) symbian { - TARGET.UID3 = 0xA000C611 + TARGET.UID3 = 0xA000C611 ICON = ./resources/heart.svg } diff --git a/demos/embedded/desktopservices/desktopservices.qrc b/demos/embedded/desktopservices/desktopservices.qrc index d36205d..410175f 100644 --- a/demos/embedded/desktopservices/desktopservices.qrc +++ b/demos/embedded/desktopservices/desktopservices.qrc @@ -1,8 +1,8 @@ <!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="/"> - <file>resources/music.png</file> - <file>resources/photo.png</file> - <file>resources/browser.png</file> - <file>resources/message.png</file> +<qresource prefix="/"> + <file>resources/music.png</file> + <file>resources/photo.png</file> + <file>resources/browser.png</file> + <file>resources/message.png</file> </qresource> </RCC> diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp index 3abe591..f3c02dc 100644 --- a/demos/embedded/desktopservices/desktopwidget.cpp +++ b/demos/embedded/desktopservices/desktopwidget.cpp @@ -51,40 +51,40 @@ // CLASS HEADER #include "desktopwidget.h" -// CONSTRUCTORS & DESTRUCTORS +// CONSTRUCTORS & DESTRUCTORS DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent) - + { QTabWidget *tabWidget = new QTabWidget(this); // Images ContentTab* imageTab = new ContentTab(tabWidget); - imageTab->init(QDesktopServices::PicturesLocation, + imageTab->init(QDesktopServices::PicturesLocation, "*.png;*.jpg;*.jpeg;*.bmp;*.gif", ":/resources/photo.png"); - tabWidget->addTab(imageTab, tr("Images")); - + tabWidget->addTab(imageTab, tr("Images")); + // Music - ContentTab* musicTab = new ContentTab(tabWidget); - musicTab->init(QDesktopServices::MusicLocation, - "*.wav;*.mp3;*.mp4", - ":/resources/music.png"); - tabWidget->addTab(musicTab, tr("Music")); - + ContentTab* musicTab = new ContentTab(tabWidget); + musicTab->init(QDesktopServices::MusicLocation, + "*.wav;*.mp3;*.mp4", + ":/resources/music.png"); + tabWidget->addTab(musicTab, tr("Music")); + // Links - LinkTab* othersTab = new LinkTab(tabWidget);; + LinkTab* othersTab = new LinkTab(tabWidget);; // Given icon file will be overriden by LinkTab - othersTab->init(QDesktopServices::PicturesLocation, "", ""); - tabWidget->addTab(othersTab, tr("Links")); - + othersTab->init(QDesktopServices::PicturesLocation, "", ""); + tabWidget->addTab(othersTab, tr("Links")); + // Layout QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(tabWidget); - setLayout(layout); + setLayout(layout); } - + DesktopWidget::~DesktopWidget() { } - + // End of file diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h index 246ab18..6b0af79 100644 --- a/demos/embedded/desktopservices/desktopwidget.h +++ b/demos/embedded/desktopservices/desktopwidget.h @@ -55,19 +55,19 @@ QT_END_NAMESPACE // CLASS DECLARATION /** * DesktopWidget class. -* +* * Implements the main top level widget for QDesktopServices demo app. */ class DesktopWidget : public QWidget { - Q_OBJECT - -public: // Constructors & Destructors + Q_OBJECT + +public: // Constructors & Destructors DesktopWidget(QWidget *parent); ~DesktopWidget(); - + }; - -#endif // DESKTOPWIDGET_H_ - + +#endif // DESKTOPWIDGET_H_ + // End of file diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h index a9c9868..e44b785 100644 --- a/demos/embedded/desktopservices/linktab.h +++ b/demos/embedded/desktopservices/linktab.h @@ -57,30 +57,30 @@ QT_END_NAMESPACE /** * LinkTab class. -* +* * This class implements tab for opening http and mailto links. */ class LinkTab : public ContentTab { Q_OBJECT - -public: // Constructors & Destructors + +public: // Constructors & Destructors LinkTab(QWidget *parent); - ~LinkTab(); - -protected: // Derived Methods + ~LinkTab(); + +protected: // Derived Methods virtual void populateListWidget(); - virtual QUrl itemUrl(QListWidgetItem *item); + virtual QUrl itemUrl(QListWidgetItem *item); virtual void handleErrorInOpen(QListWidgetItem *item); - -private: // Used variables + +private: // Used variables QListWidgetItem *m_WebItem; - QListWidgetItem *m_MailToItem; - -private: // Owned variables - + QListWidgetItem *m_MailToItem; + +private: // Owned variables + }; -#endif // CONTENTTAB_H_ - +#endif // CONTENTTAB_H_ + // End of File diff --git a/demos/embedded/desktopservices/main.cpp b/demos/embedded/desktopservices/main.cpp index ebbcf63..0abfc78 100644 --- a/demos/embedded/desktopservices/main.cpp +++ b/demos/embedded/desktopservices/main.cpp @@ -48,8 +48,8 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); DesktopWidget* myWidget = new DesktopWidget(0); - myWidget->showMaximized(); - + myWidget->showMaximized(); + return app.exec(); } |