From c8991206e38fdde270602dbaa945012bb10944bb Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 31 Jan 2014 14:01:28 +0100 Subject: [PATCH] Some cleanups. --- src/core/feedsmodelstandardfeed.cpp | 2 -- src/core/settings.cpp | 2 -- src/gui/feedmessageviewer.cpp | 3 --- src/gui/feedsview.cpp | 32 ++++++----------------------- src/gui/feedsview.h | 12 ----------- src/gui/formstandardfeeddetails.cpp | 7 +++---- src/gui/lineeditwithstatus.h | 6 ------ src/gui/messagesview.cpp | 2 +- src/gui/systemtrayicon.cpp | 2 +- src/main.cpp | 3 --- 10 files changed, 11 insertions(+), 60 deletions(-) diff --git a/src/core/feedsmodelstandardfeed.cpp b/src/core/feedsmodelstandardfeed.cpp index a046d70ee..f4a7d43d7 100755 --- a/src/core/feedsmodelstandardfeed.cpp +++ b/src/core/feedsmodelstandardfeed.cpp @@ -148,8 +148,6 @@ void FeedsModelStandardFeed::update() { case FeedsModelFeed::StandardAtom10: messages = ParsingFactory::parseAsATOM10(formatted_feed_contents); - // TODO: Add support for other standard formats. - default: break; } diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 1d2219d1a..392dc43ef 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -56,8 +56,6 @@ QSettings::Status Settings::setupSettings() { s_instance = new Settings(app_path_file, QSettings::IniFormat, Settings::Portable, qApp); - // TODO: Separate web settings into another unit if - // MORE web/network-related settings will be needed. // Construct icon cache in the same path. QString web_path = app_path + QDir::separator() + QString(APP_DB_WEB_PATH); QDir(web_path).mkpath(web_path); diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index d51e6a534..48cb941ea 100644 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -87,9 +87,6 @@ void FeedMessageViewer::loadSize() { settings->value(APP_CFG_GUI, KEY_MESSAGES_VIEW + QString::number(MSG_DB_DCREATED_INDEX), default_msg_section_size).toInt()); - - // TODO: Perhaps make toolbar icon size changeable, - // this concerns toolbars of web browsers too. } void FeedMessageViewer::quitDownloader() { diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index a13dc363b..79efe6405 100644 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -43,14 +43,14 @@ void FeedsView::setSortingEnabled(bool enable) { header()->setSortIndicatorShown(false); } -QList FeedsView::selectedFeeds() const { +QList FeedsView::selectedFeeds() const { QModelIndexList selection = selectionModel()->selectedRows(); QModelIndexList mapped_selection = m_proxyModel->mapListToSource(selection); return m_sourceModel->feedsForIndexes(mapped_selection); } -QList FeedsView::allFeeds() const { +QList FeedsView::allFeeds() const { return m_sourceModel->allFeeds(); } @@ -98,12 +98,7 @@ void FeedsView::addNewStandardCategory() { QPointer form_pointer = new FormStandardCategoryDetails(m_sourceModel, this); - if (form_pointer.data()->exec(NULL) == QDialog::Accepted) { - // TODO: nova kategorie pridana - } - else { - // TODO: nova kategorie nepridana - } + form_pointer.data()->exec(NULL); delete form_pointer.data(); @@ -114,12 +109,7 @@ void FeedsView::addNewStandardCategory() { void FeedsView::editStandardCategory(FeedsModelStandardCategory *category) { QPointer form_pointer = new FormStandardCategoryDetails(m_sourceModel, this); - if (form_pointer.data()->exec(category) == QDialog::Accepted) { - // TODO: kategorie upravena - } - else { - // TODO: kategorie neupravena (uživatel zrušil dialog) - } + form_pointer.data()->exec(category); delete form_pointer.data(); } @@ -147,12 +137,7 @@ void FeedsView::addNewStandardFeed() { QPointer form_pointer = new FormStandardFeedDetails(m_sourceModel, this); - if (form_pointer.data()->exec(NULL) == QDialog::Accepted) { - // TODO: nova kategorie pridana - } - else { - // TODO: nova kategorie nepridana - } + form_pointer.data()->exec(NULL); delete form_pointer.data(); @@ -163,12 +148,7 @@ void FeedsView::addNewStandardFeed() { void FeedsView::editStandardFeed(FeedsModelStandardFeed *feed) { QPointer form_pointer = new FormStandardFeedDetails(m_sourceModel, this); - if (form_pointer.data()->exec(feed) == QDialog::Accepted) { - // TODO: kategorie upravena - } - else { - // TODO: kategorie neupravena (uživatel zrušil dialog) - } + form_pointer.data()->exec(feed); delete form_pointer.data(); } diff --git a/src/gui/feedsview.h b/src/gui/feedsview.h index 316d671fe..99219d3d0 100644 --- a/src/gui/feedsview.h +++ b/src/gui/feedsview.h @@ -7,18 +7,6 @@ #include "core/feedsmodel.h" -// TODO: http://soundguyrob.files.wordpress.com/2011/03/screen-shot-2011-03-01-at-7-45-23-pm.jpg -// přepsat počet nepřečtených zpráv podle screenshotu (tedy smazat asi sloupec "unread") -// a počet nepřečtených přes drawRow kreslit do prvního sloupce -// taky použít ten layout pro zobrazení zprávy -// NEBO pouzit delegaty (QItemDelegate nebo QStyledItemDelegate) - https://qt-project.org/forums/viewthread/24493 -// + NEWSPAPER view -> v currentChanged MessagesView se -// vytáhnou všechny vybrané zprávy, dají se do QList -// a bude se emitovat signal ze se maji tyto zpravy zobrazit -// - na tohle navazat metodu v WebBrowseru, neco -// jako navigateToMessages(const QList &messages), mrknout -// do navigateToMessage - class FeedsProxyModel; class FeedsModelFeed; class FeedsModelCategory; diff --git a/src/gui/formstandardfeeddetails.cpp b/src/gui/formstandardfeeddetails.cpp index 3068e13cc..95fe09974 100644 --- a/src/gui/formstandardfeeddetails.cpp +++ b/src/gui/formstandardfeeddetails.cpp @@ -173,7 +173,7 @@ void FormStandardFeedDetails::apply() { FeedsModelStandardFeed::Type type = static_cast(m_ui->m_cmbType->itemData(m_ui->m_cmbType->currentIndex()).value()); FeedsModelStandardFeed *new_feed = new FeedsModelStandardFeed(); - // TODO: Setup data for new_feed. + // Setup data for new_feed. new_feed->setTitle(m_ui->m_txtTitle->lineEdit()->text()); new_feed->setCreationDate(QDateTime::currentDateTime()); new_feed->setDescription(m_ui->m_txtDescription->lineEdit()->text()); @@ -184,8 +184,7 @@ void FormStandardFeedDetails::apply() { new_feed->setParent(parent); if (m_editableFeed == NULL) { - // TODO: Add the feed. - // Add the category. + // Add the feed. if (m_feedsModel->addStandardFeed(new_feed, parent)) { accept(); } @@ -194,7 +193,7 @@ void FormStandardFeedDetails::apply() { } } else { - // TODO: Edit the feed. + // Edit the feed. if (m_feedsModel->editStandardFeed(m_editableFeed, new_feed)) { accept(); } diff --git a/src/gui/lineeditwithstatus.h b/src/gui/lineeditwithstatus.h index c183cb637..676fc170f 100644 --- a/src/gui/lineeditwithstatus.h +++ b/src/gui/lineeditwithstatus.h @@ -24,12 +24,6 @@ class LineEditWithStatus : public QWidget { explicit LineEditWithStatus(QWidget *parent = 0); virtual ~LineEditWithStatus(); - // TODO: napsat metodu setStatus(enum-statusu, qstring) - // kde enum-statusu bude Ok, Warning, Error a qstring bude text kerej se objevi jako - // tooltip na toolbuttonu - // pak bude proste navazani na textEdited() a tam si bude uzivatel - // widgetu nastavovat pres to setStatus co chce on - // Sets custom status for this control. void setStatus(StatusType status, const QString &tooltip_text); diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp index 12ee46981..21f60e4d1 100644 --- a/src/gui/messagesview.cpp +++ b/src/gui/messagesview.cpp @@ -200,7 +200,7 @@ void MessagesView::currentChanged(const QModelIndex ¤t, void MessagesView::loadFeeds(const QList &feed_ids) { // Load messages. // TODO: Here we could load user-defined default sorting - // column/order AND possibly hide/show user-defined columns. + // column/order AND possibly hide/show user-defined columns for the feed(s). m_sourceModel->loadMessages(feed_ids); // Make sure that initial sorting is that unread messages are visible diff --git a/src/gui/systemtrayicon.cpp b/src/gui/systemtrayicon.cpp index dda156f3e..5e4b9f943 100644 --- a/src/gui/systemtrayicon.cpp +++ b/src/gui/systemtrayicon.cpp @@ -74,7 +74,7 @@ bool SystemTrayIcon::isSystemTrayAvailable() { } bool SystemTrayIcon::isSystemTrayActivated() { - // TODO: check if this can be rewritten for bigger speed. + // TODO: Check if this can be rewritten for bigger speed. return SystemTrayIcon::isSystemTrayAvailable() && Settings::instance()->value(APP_CFG_GUI, "use_tray_icon", true).toBool(); diff --git a/src/main.cpp b/src/main.cpp index 999426372..a3e4f0fca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,9 +23,6 @@ #include -// TODO: lepsi paint bez framu balloontip -// http://windowdetective.sourceforge.net/files/Window%20Detective/src/ui/custom_widgets/BalloonTip.cpp - // TODO: Check if extra UNIX signalling is needed. // Use header for it - signal function and catch SIGHUP // void my_terminate (int param) {