Unified NULL macros for C++ 11.
This commit is contained in:
parent
df91d10e3c
commit
335c5bcee6
15
rssguard.pro
15
rssguard.pro
@ -266,9 +266,9 @@ HEADERS += src/core/feeddownloader.h \
|
||||
src/gui/webviewer.h \
|
||||
src/gui/webbrowser.h \
|
||||
src/network-web/webpage.h \
|
||||
src/gui/locationlineedit.h \
|
||||
src/network-web/googlesuggest.h \
|
||||
src/gui/discoverfeedsbutton.h
|
||||
src/gui/locationlineedit.h \
|
||||
src/network-web/googlesuggest.h \
|
||||
src/gui/discoverfeedsbutton.h
|
||||
|
||||
SOURCES += src/core/feeddownloader.cpp \
|
||||
src/core/feedsmodel.cpp \
|
||||
@ -377,9 +377,9 @@ SOURCES += src/core/feeddownloader.cpp \
|
||||
src/gui/webviewer.cpp \
|
||||
src/gui/webbrowser.cpp \
|
||||
src/network-web/webpage.cpp \
|
||||
src/gui/locationlineedit.cpp \
|
||||
src/network-web/googlesuggest.cpp \
|
||||
src/gui/discoverfeedsbutton.cpp
|
||||
src/gui/locationlineedit.cpp \
|
||||
src/network-web/googlesuggest.cpp \
|
||||
src/gui/discoverfeedsbutton.cpp
|
||||
|
||||
FORMS += \
|
||||
src/gui/toolbareditor.ui \
|
||||
@ -397,8 +397,7 @@ FORMS += \
|
||||
src/services/owncloud/gui/formeditowncloudaccount.ui \
|
||||
src/services/standard/gui/formstandardcategorydetails.ui \
|
||||
src/services/standard/gui/formstandardimportexport.ui \
|
||||
src/services/tt-rss/gui/formeditaccount.ui \
|
||||
src/gui/webbrowser.ui
|
||||
src/services/tt-rss/gui/formeditaccount.ui
|
||||
|
||||
TRANSLATIONS += localization/qtbase-cs_CZ.ts \
|
||||
localization/qtbase-da_DK.ts \
|
||||
|
@ -46,8 +46,8 @@
|
||||
|
||||
FeedsModel::FeedsModel(QObject *parent)
|
||||
: QAbstractItemModel(parent), m_autoUpdateTimer(new QTimer(this)),
|
||||
m_feedDownloaderThread(NULL), m_feedDownloader(NULL),
|
||||
m_dbCleanerThread(NULL), m_dbCleaner(NULL) {
|
||||
m_feedDownloaderThread(nullptr), m_feedDownloader(nullptr),
|
||||
m_dbCleanerThread(nullptr), m_dbCleaner(nullptr) {
|
||||
setObjectName(QSL("FeedsModel"));
|
||||
|
||||
// Create root item.
|
||||
@ -87,7 +87,7 @@ void FeedsModel::quit() {
|
||||
}
|
||||
|
||||
// Close worker threads.
|
||||
if (m_feedDownloaderThread != NULL && m_feedDownloaderThread->isRunning()) {
|
||||
if (m_feedDownloaderThread != nullptr && m_feedDownloaderThread->isRunning()) {
|
||||
m_feedDownloader->stopRunningUpdate();
|
||||
|
||||
qDebug("Quitting feed downloader thread.");
|
||||
@ -99,7 +99,7 @@ void FeedsModel::quit() {
|
||||
}
|
||||
}
|
||||
|
||||
if (m_dbCleanerThread != NULL && m_dbCleanerThread->isRunning()) {
|
||||
if (m_dbCleanerThread != nullptr && m_dbCleanerThread->isRunning()) {
|
||||
qDebug("Quitting database cleaner thread.");
|
||||
m_dbCleanerThread->quit();
|
||||
|
||||
@ -110,12 +110,12 @@ void FeedsModel::quit() {
|
||||
}
|
||||
|
||||
// Close workers.
|
||||
if (m_feedDownloader != NULL) {
|
||||
if (m_feedDownloader != nullptr) {
|
||||
qDebug("Feed downloader exists. Deleting it from memory.");
|
||||
m_feedDownloader->deleteLater();
|
||||
}
|
||||
|
||||
if (m_dbCleaner != NULL) {
|
||||
if (m_dbCleaner != nullptr) {
|
||||
qDebug("Database cleaner exists. Deleting it from memory.");
|
||||
m_dbCleaner->deleteLater();
|
||||
}
|
||||
@ -133,7 +133,7 @@ void FeedsModel::updateFeeds(const QList<Feed*> &feeds) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_feedDownloader == NULL) {
|
||||
if (m_feedDownloader == nullptr) {
|
||||
m_feedDownloader = new FeedDownloader();
|
||||
m_feedDownloaderThread = new QThread();
|
||||
|
||||
@ -185,7 +185,7 @@ void FeedsModel::updateAllFeeds() {
|
||||
}
|
||||
|
||||
DatabaseCleaner *FeedsModel::databaseCleaner() {
|
||||
if (m_dbCleaner == NULL) {
|
||||
if (m_dbCleaner == nullptr) {
|
||||
m_dbCleaner = new DatabaseCleaner();
|
||||
m_dbCleanerThread = new QThread();
|
||||
|
||||
@ -446,7 +446,7 @@ void FeedsModel::removeItem(const QModelIndex &index) {
|
||||
}
|
||||
|
||||
void FeedsModel::removeItem(RootItem *deleting_item) {
|
||||
if (deleting_item != NULL) {
|
||||
if (deleting_item != nullptr) {
|
||||
QModelIndex index = indexForItem(deleting_item);
|
||||
QModelIndex parent_index = index.parent();
|
||||
RootItem *parent_item = deleting_item->parent();
|
||||
@ -464,7 +464,7 @@ void FeedsModel::reassignNodeToNewParent(RootItem *original_node, RootItem *new_
|
||||
RootItem *original_parent = original_node->parent();
|
||||
|
||||
if (original_parent != new_parent) {
|
||||
if (original_parent != NULL) {
|
||||
if (original_parent != nullptr) {
|
||||
int original_index_of_item = original_parent->childItems().indexOf(original_node);
|
||||
|
||||
if (original_index_of_item >= 0) {
|
||||
@ -510,12 +510,12 @@ StandardServiceRoot *FeedsModel::standardServiceRoot() const {
|
||||
foreach (ServiceRoot *root, serviceRoots()) {
|
||||
StandardServiceRoot *std_service_root;
|
||||
|
||||
if ((std_service_root = dynamic_cast<StandardServiceRoot*>(root)) != NULL) {
|
||||
if ((std_service_root = dynamic_cast<StandardServiceRoot*>(root)) != nullptr) {
|
||||
return std_service_root;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<Feed*> FeedsModel::feedsForScheduledUpdate(bool auto_update_now) {
|
||||
@ -577,7 +577,7 @@ RootItem *FeedsModel::itemForIndex(const QModelIndex &index) const {
|
||||
}
|
||||
|
||||
QModelIndex FeedsModel::indexForItem(const RootItem *item) const {
|
||||
if (item == NULL || item->kind() == RootItemKind::Root) {
|
||||
if (item == nullptr || item->kind() == RootItemKind::Root) {
|
||||
// Root item lies on invalid index.
|
||||
return QModelIndex();
|
||||
}
|
||||
@ -612,7 +612,7 @@ bool FeedsModel::hasAnyFeedNewMessages() const {
|
||||
}
|
||||
|
||||
bool FeedsModel::isFeedUpdateRunning() const {
|
||||
return m_feedDownloader != NULL && m_feedDownloader->isUpdateRunning();
|
||||
return m_feedDownloader != nullptr && m_feedDownloader->isUpdateRunning();
|
||||
}
|
||||
|
||||
void FeedsModel::reloadChangedLayout(QModelIndexList list) {
|
||||
@ -687,7 +687,7 @@ bool FeedsModel::restoreAllBins() {
|
||||
foreach (ServiceRoot *root, serviceRoots()) {
|
||||
RecycleBin *bin_of_root = root->recycleBin();
|
||||
|
||||
if (bin_of_root != NULL) {
|
||||
if (bin_of_root != nullptr) {
|
||||
result &= bin_of_root->restore();
|
||||
}
|
||||
}
|
||||
@ -701,7 +701,7 @@ bool FeedsModel::emptyAllBins() {
|
||||
foreach (ServiceRoot *root, serviceRoots()) {
|
||||
RecycleBin *bin_of_root = root->recycleBin();
|
||||
|
||||
if (bin_of_root != NULL) {
|
||||
if (bin_of_root != nullptr) {
|
||||
result &= bin_of_root->empty();
|
||||
}
|
||||
}
|
||||
@ -727,7 +727,7 @@ void FeedsModel::loadActivatedServiceAccounts() {
|
||||
}
|
||||
|
||||
void FeedsModel::stopRunningFeedUpdate() {
|
||||
if (m_feedDownloader != NULL) {
|
||||
if (m_feedDownloader != nullptr) {
|
||||
m_feedDownloader->stopRunningUpdate();
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
FeedsProxyModel::FeedsProxyModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent), m_selectedItem(NULL), m_showUnreadOnly(false), m_hiddenIndices(QList<QPair<int,QModelIndex> >()) {
|
||||
: QSortFilterProxyModel(parent), m_selectedItem(nullptr), m_showUnreadOnly(false), m_hiddenIndices(QList<QPair<int,QModelIndex> >()) {
|
||||
m_sourceModel = new FeedsModel(this);
|
||||
|
||||
setObjectName(QSL("FeedsProxyModel"));
|
||||
|
@ -73,7 +73,7 @@ Message::Message() {
|
||||
|
||||
Message Message::fromSqlRecord(const QSqlRecord &record, bool *result) {
|
||||
if (record.count() != MSG_DB_CUSTOM_HASH_INDEX + 1) {
|
||||
if (result != NULL) {
|
||||
if (result != nullptr) {
|
||||
*result = false;
|
||||
return Message();
|
||||
}
|
||||
@ -95,7 +95,7 @@ Message Message::fromSqlRecord(const QSqlRecord &record, bool *result) {
|
||||
message.m_customId = record.value(MSG_DB_CUSTOM_ID_INDEX).toString();
|
||||
message.m_customHash = record.value(MSG_DB_CUSTOM_HASH_INDEX).toString();
|
||||
|
||||
if (result != NULL) {
|
||||
if (result != nullptr) {
|
||||
*result = true;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ MessagesModel::MessagesModel(QObject *parent)
|
||||
// via model, but via DIRECT SQL calls are used to do persistent messages.
|
||||
setEditStrategy(QSqlTableModel::OnManualSubmit);
|
||||
setTable(QSL("Messages"));
|
||||
loadMessages(NULL);
|
||||
loadMessages(nullptr);
|
||||
}
|
||||
|
||||
MessagesModel::~MessagesModel() {
|
||||
@ -70,7 +70,7 @@ void MessagesModel::setupFonts() {
|
||||
void MessagesModel::loadMessages(RootItem *item) {
|
||||
m_selectedItem = item;
|
||||
|
||||
if (item == NULL) {
|
||||
if (item == nullptr) {
|
||||
setFilter("true != true");
|
||||
}
|
||||
else {
|
||||
|
@ -99,7 +99,7 @@ QList<Message> ParsingFactory::parseAsATOM10(const QString &data) {
|
||||
new_message.m_created = current_time;
|
||||
}
|
||||
|
||||
// WARNING: There is a difference between "" and QString() in terms of NULL SQL values!
|
||||
// WARNING: There is a difference between "" and QString() in terms of nullptr SQL values!
|
||||
// This is because of difference in QString::isNull() and QString::isEmpty(), the "" is not null
|
||||
// while QString() is.
|
||||
if (new_message.m_author.isNull()) {
|
||||
|
@ -42,5 +42,5 @@ QAction *BaseBar::findMatchingAction(const QString &action, const QList<QAction*
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ void FormAddAccount::addSelectedAccount() {
|
||||
ServiceEntryPoint *point = selectedEntryPoint();
|
||||
ServiceRoot *new_root = point->createNewRoot();
|
||||
|
||||
if (new_root != NULL) {
|
||||
if (new_root != nullptr) {
|
||||
m_model->addServiceAccount(new_root, true);
|
||||
}
|
||||
else {
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <QCloseEvent>
|
||||
|
||||
|
||||
FormDatabaseCleanup::FormDatabaseCleanup(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormDatabaseCleanup), m_cleaner(NULL) {
|
||||
FormDatabaseCleanup::FormDatabaseCleanup(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormDatabaseCleanup), m_cleaner(nullptr) {
|
||||
m_ui->setupUi(this);
|
||||
|
||||
// Set flags and attributes.
|
||||
@ -42,7 +42,7 @@ FormDatabaseCleanup::~FormDatabaseCleanup() {
|
||||
}
|
||||
|
||||
void FormDatabaseCleanup::setCleaner(DatabaseCleaner *cleaner) {
|
||||
if (m_cleaner != NULL) {
|
||||
if (m_cleaner != nullptr) {
|
||||
disconnect(this, 0, m_cleaner, 0);
|
||||
disconnect(m_cleaner, 0, this, 0);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ void FormMain::updateRecycleBinMenu() {
|
||||
RecycleBin *bin = activated_root->recycleBin();
|
||||
QList<QAction*> context_menu;
|
||||
|
||||
if (bin == NULL) {
|
||||
if (bin == nullptr) {
|
||||
QAction *no_action = new QAction(qApp->icons()->fromTheme(QSL("dialog-error")),
|
||||
tr("No recycle bin"),
|
||||
m_ui->m_menuRecycleBin);
|
||||
|
@ -52,7 +52,7 @@
|
||||
#include <QDir>
|
||||
|
||||
|
||||
FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormSettings), m_settings(NULL) {
|
||||
FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormSettings), m_settings(nullptr) {
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_settings = qApp->settings();
|
||||
@ -145,7 +145,7 @@ void FormSettings::changeDefaultBrowserArguments(int index) {
|
||||
void FormSettings::onSkinSelected(QTreeWidgetItem *current, QTreeWidgetItem *previous) {
|
||||
Q_UNUSED(previous)
|
||||
|
||||
if (current != NULL) {
|
||||
if (current != nullptr) {
|
||||
const Skin skin = current->data(0, Qt::UserRole).value<Skin>();
|
||||
m_ui->m_lblSelectedContents->setText(skin.m_visibleName);
|
||||
}
|
||||
@ -456,7 +456,7 @@ void FormSettings::loadLanguage() {
|
||||
}
|
||||
|
||||
void FormSettings::saveLanguage() {
|
||||
if (m_ui->m_treeLanguages->currentItem() == NULL) {
|
||||
if (m_ui->m_treeLanguages->currentItem() == nullptr) {
|
||||
qDebug("No localizations loaded in settings dialog, so no saving for them.");
|
||||
return;
|
||||
}
|
||||
@ -737,7 +737,7 @@ void FormSettings::loadInterface() {
|
||||
}
|
||||
}
|
||||
|
||||
if (m_ui->m_treeSkins->currentItem() == NULL &&
|
||||
if (m_ui->m_treeSkins->currentItem() == nullptr &&
|
||||
m_ui->m_treeSkins->topLevelItemCount() > 0) {
|
||||
// Currently active skin is NOT available, select another one as selected
|
||||
// if possible.
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
FormUpdate::FormUpdate(QWidget *parent)
|
||||
: QDialog(parent), m_downloader(NULL), m_readyToInstall(false), m_ui(new Ui::FormUpdate) {
|
||||
: QDialog(parent), m_downloader(nullptr), m_readyToInstall(false), m_ui(new Ui::FormUpdate) {
|
||||
m_ui->setupUi(this);
|
||||
m_btnUpdate = m_ui->m_buttonBox->addButton(tr("Download update"), QDialogButtonBox::ActionRole);
|
||||
m_btnUpdate->setToolTip(tr("Download new installation files."));
|
||||
@ -190,7 +190,7 @@ void FormUpdate::startUpdate() {
|
||||
// Nothing is downloaded yet, but update for this system
|
||||
// is available and self-update feature is present.
|
||||
|
||||
if (m_downloader == NULL) {
|
||||
if (m_downloader == nullptr) {
|
||||
// Initialie downloader.
|
||||
m_downloader = new Downloader(this);
|
||||
|
||||
|
@ -62,7 +62,7 @@ void EditTableView::removeSelected() {
|
||||
}
|
||||
|
||||
void EditTableView::removeAll() {
|
||||
if (model() != NULL) {
|
||||
if (model() != nullptr) {
|
||||
model()->removeRows(0, model()->rowCount(rootIndex()), rootIndex());
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void FeedMessageViewer::setListHeadersEnabled(bool enable) {
|
||||
void FeedMessageViewer::switchFeedComponentVisibility() {
|
||||
QAction *sen = qobject_cast<QAction*>(sender());
|
||||
|
||||
if (sen != NULL) {
|
||||
if (sen != nullptr) {
|
||||
m_feedsWidget->setVisible(sen->isChecked());
|
||||
}
|
||||
else {
|
||||
@ -168,7 +168,7 @@ void FeedMessageViewer::switchFeedComponentVisibility() {
|
||||
void FeedMessageViewer::toggleShowOnlyUnreadFeeds() {
|
||||
const QAction *origin = qobject_cast<QAction*>(sender());
|
||||
|
||||
if (origin == NULL) {
|
||||
if (origin == nullptr) {
|
||||
m_feedsView->model()->invalidateReadFeedsFilter(true, false);
|
||||
}
|
||||
else {
|
||||
@ -179,7 +179,7 @@ void FeedMessageViewer::toggleShowOnlyUnreadFeeds() {
|
||||
void FeedMessageViewer::updateMessageButtonsAvailability() {
|
||||
const bool one_message_selected = m_messagesView->selectionModel()->selectedRows().size() == 1;
|
||||
const bool atleast_one_message_selected = !m_messagesView->selectionModel()->selectedRows().isEmpty();
|
||||
const bool bin_loaded = m_messagesView->sourceModel()->loadedItem() != NULL && m_messagesView->sourceModel()->loadedItem()->kind() == RootItemKind::Bin;
|
||||
const bool bin_loaded = m_messagesView->sourceModel()->loadedItem() != nullptr && m_messagesView->sourceModel()->loadedItem()->kind() == RootItemKind::Bin;
|
||||
const FormMain *form_main = qApp->mainForm();
|
||||
|
||||
form_main->m_ui->m_actionDeleteSelectedMessages->setEnabled(atleast_one_message_selected);
|
||||
@ -196,7 +196,7 @@ void FeedMessageViewer::updateFeedButtonsAvailability() {
|
||||
const bool is_update_running = feedsView()->sourceModel()->isFeedUpdateRunning();
|
||||
const bool critical_action_running = qApp->feedUpdateLock()->isLocked();
|
||||
const RootItem *selected_item = feedsView()->selectedItem();
|
||||
const bool anything_selected = selected_item != NULL;
|
||||
const bool anything_selected = selected_item != nullptr;
|
||||
const bool feed_selected = anything_selected && selected_item->kind() == RootItemKind::Feed;
|
||||
const bool category_selected = anything_selected && selected_item->kind() == RootItemKind::Category;
|
||||
const bool service_selected = anything_selected && selected_item->kind() == RootItemKind::ServiceRoot;
|
||||
|
@ -61,7 +61,7 @@ void FeedsToolBar::loadChangeableActions(const QStringList &actions) {
|
||||
foreach (const QString &action_name, actions) {
|
||||
QAction *matching_action = findMatchingAction(action_name, available_actions);
|
||||
|
||||
if (matching_action != NULL) {
|
||||
if (matching_action != nullptr) {
|
||||
// Add existing standard action.
|
||||
addAction(matching_action);
|
||||
}
|
||||
|
@ -43,10 +43,10 @@
|
||||
|
||||
FeedsView::FeedsView(QWidget *parent)
|
||||
: QTreeView(parent),
|
||||
m_contextMenuCategories(NULL),
|
||||
m_contextMenuFeeds(NULL),
|
||||
m_contextMenuEmptySpace(NULL),
|
||||
m_contextMenuOtherItems(NULL) {
|
||||
m_contextMenuCategories(nullptr),
|
||||
m_contextMenuFeeds(nullptr),
|
||||
m_contextMenuEmptySpace(nullptr),
|
||||
m_contextMenuOtherItems(nullptr) {
|
||||
setObjectName(QSL("FeedsView"));
|
||||
|
||||
// Allocate models.
|
||||
@ -89,11 +89,11 @@ RootItem *FeedsView::selectedItem() const {
|
||||
const QModelIndexList selected_rows = selectionModel()->selectedRows();
|
||||
|
||||
if (selected_rows.isEmpty()) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
RootItem *selected_item = m_sourceModel->itemForIndex(m_proxyModel->mapToSource(selected_rows.at(0)));
|
||||
return selected_item == m_sourceModel->rootItem() ? NULL : selected_item;
|
||||
return selected_item == m_sourceModel->rootItem() ? nullptr : selected_item;
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ void FeedsView::sortByColumn(int column, Qt::SortOrder order) {
|
||||
void FeedsView::addFeedIntoSelectedAccount() {
|
||||
const RootItem *selected = selectedItem();
|
||||
|
||||
if (selected != NULL) {
|
||||
if (selected != nullptr) {
|
||||
ServiceRoot *root = selected->getParentServiceRoot();
|
||||
|
||||
if (root->supportsFeedAdding()) {
|
||||
@ -173,7 +173,7 @@ void FeedsView::addFeedIntoSelectedAccount() {
|
||||
void FeedsView::addCategoryIntoSelectedAccount() {
|
||||
const RootItem *selected = selectedItem();
|
||||
|
||||
if (selected != NULL) {
|
||||
if (selected != nullptr) {
|
||||
ServiceRoot *root = selected->getParentServiceRoot();
|
||||
|
||||
if (root->supportsCategoryAdding()) {
|
||||
@ -265,7 +265,7 @@ void FeedsView::deleteSelectedItem() {
|
||||
|
||||
RootItem *selected_item = selectedItem();
|
||||
|
||||
if (selected_item != NULL) {
|
||||
if (selected_item != nullptr) {
|
||||
if (selected_item->canBeDeleted()) {
|
||||
// Ask user first.
|
||||
if (MessageBox::show(qApp->mainForm(),
|
||||
@ -360,7 +360,7 @@ void FeedsView::expandItemDelayed(const QModelIndex &idx) {
|
||||
}
|
||||
|
||||
QMenu *FeedsView::initializeContextMenuCategories(RootItem *clicked_item) {
|
||||
if (m_contextMenuCategories == NULL) {
|
||||
if (m_contextMenuCategories == nullptr) {
|
||||
m_contextMenuCategories = new QMenu(tr("Context menu for categories"), this);
|
||||
}
|
||||
else {
|
||||
@ -386,7 +386,7 @@ QMenu *FeedsView::initializeContextMenuCategories(RootItem *clicked_item) {
|
||||
}
|
||||
|
||||
QMenu *FeedsView::initializeContextMenuFeeds(RootItem *clicked_item) {
|
||||
if (m_contextMenuFeeds == NULL) {
|
||||
if (m_contextMenuFeeds == nullptr) {
|
||||
m_contextMenuFeeds = new QMenu(tr("Context menu for categories"), this);
|
||||
}
|
||||
else {
|
||||
@ -412,7 +412,7 @@ QMenu *FeedsView::initializeContextMenuFeeds(RootItem *clicked_item) {
|
||||
}
|
||||
|
||||
QMenu *FeedsView::initializeContextMenuEmptySpace() {
|
||||
if (m_contextMenuEmptySpace == NULL) {
|
||||
if (m_contextMenuEmptySpace == nullptr) {
|
||||
m_contextMenuEmptySpace = new QMenu(tr("Context menu for empty space"), this);
|
||||
m_contextMenuEmptySpace->addAction(qApp->mainForm()->m_ui->m_actionUpdateAllItems);
|
||||
m_contextMenuEmptySpace->addSeparator();
|
||||
@ -422,7 +422,7 @@ QMenu *FeedsView::initializeContextMenuEmptySpace() {
|
||||
}
|
||||
|
||||
QMenu *FeedsView::initializeContextMenuOtherItem(RootItem *clicked_item) {
|
||||
if (m_contextMenuOtherItems == NULL) {
|
||||
if (m_contextMenuOtherItems == nullptr) {
|
||||
m_contextMenuOtherItems = new QMenu(tr("Context menu for other items"), this);
|
||||
}
|
||||
else {
|
||||
|
@ -70,7 +70,7 @@ void MessagesToolBar::loadChangeableActions(const QStringList& actions) {
|
||||
foreach (const QString &action_name, actions) {
|
||||
QAction *matching_action = findMatchingAction(action_name, available_actions);
|
||||
|
||||
if (matching_action != NULL) {
|
||||
if (matching_action != nullptr) {
|
||||
// Add existing standard action.
|
||||
addAction(matching_action);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
MessagesView::MessagesView(QWidget *parent)
|
||||
: QTreeView(parent),
|
||||
m_contextMenu(NULL),
|
||||
m_contextMenu(nullptr),
|
||||
m_columnsAdjusted(false),
|
||||
m_batchUnreadSwitch(false) {
|
||||
m_proxyModel = new MessagesProxyModel(this);
|
||||
@ -147,7 +147,7 @@ void MessagesView::contextMenuEvent(QContextMenuEvent *event) {
|
||||
}
|
||||
|
||||
void MessagesView::initializeContextMenu() {
|
||||
if (m_contextMenu == NULL) {
|
||||
if (m_contextMenu == nullptr) {
|
||||
m_contextMenu = new QMenu(tr("Context menu for messages"), this);
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ void MessagesView::initializeContextMenu() {
|
||||
qApp->mainForm()->m_ui->m_actionSwitchImportanceOfSelectedMessages <<
|
||||
qApp->mainForm()->m_ui->m_actionDeleteSelectedMessages);
|
||||
|
||||
if (m_sourceModel->loadedItem() != NULL && m_sourceModel->loadedItem()->kind() == RootItemKind::Bin) {
|
||||
if (m_sourceModel->loadedItem() != nullptr && m_sourceModel->loadedItem()->kind() == RootItemKind::Bin) {
|
||||
m_contextMenu->addAction(qApp->mainForm()->m_ui->m_actionRestoreSelectedMessages);
|
||||
}
|
||||
}
|
||||
|
@ -67,9 +67,9 @@ void PlainToolButton::setChecked(bool checked) {
|
||||
}
|
||||
|
||||
void PlainToolButton::reactOnActionChange(QAction *action) {
|
||||
QAction *real_action = action == NULL ? qobject_cast<QAction*>(sender()) : action;
|
||||
QAction *real_action = action == nullptr ? qobject_cast<QAction*>(sender()) : action;
|
||||
|
||||
if (real_action != NULL) {
|
||||
if (real_action != nullptr) {
|
||||
setEnabled(real_action->isEnabled());
|
||||
setCheckable(real_action->isCheckable());
|
||||
setChecked(real_action->isChecked());
|
||||
|
@ -156,7 +156,7 @@ void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
||||
action_to_add->setProperty("type", SPACER_ACTION_NAME);
|
||||
action_to_add->setProperty("name", tr("Toolbar spacer"));
|
||||
}
|
||||
else if (matching_action != NULL) {
|
||||
else if (matching_action != nullptr) {
|
||||
// Add originally toolbar action.
|
||||
PlainToolButton *tool_button = new PlainToolButton(this);
|
||||
tool_button->reactOnActionChange(matching_action);
|
||||
@ -168,16 +168,16 @@ void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
||||
connect(matching_action, SIGNAL(changed()), tool_button, SLOT(reactOnActionChange()));
|
||||
}
|
||||
else {
|
||||
action_to_add = NULL;
|
||||
widget_to_add = NULL;
|
||||
action_to_add = nullptr;
|
||||
widget_to_add = nullptr;
|
||||
}
|
||||
|
||||
if (action_to_add != NULL) {
|
||||
if (action_to_add != nullptr) {
|
||||
action_to_add->setProperty("should_remove_widget", true);
|
||||
}
|
||||
}
|
||||
|
||||
if (action_to_add != NULL && widget_to_add != NULL) {
|
||||
if (action_to_add != nullptr && widget_to_add != nullptr) {
|
||||
action_to_add->setProperty("widget", QVariant::fromValue((void*) widget_to_add));
|
||||
addPermanentWidget(widget_to_add);
|
||||
addAction(action_to_add);
|
||||
@ -198,13 +198,13 @@ bool StatusBar::eventFilter(QObject *watched, QEvent *event) {
|
||||
void StatusBar::clear() {
|
||||
while (!actions().isEmpty()) {
|
||||
QAction *act = actions().at(0);
|
||||
QWidget *widget = act->property("widget").isValid() ? static_cast<QWidget*>(act->property("widget").value<void*>()) : NULL;
|
||||
QWidget *widget = act->property("widget").isValid() ? static_cast<QWidget*>(act->property("widget").value<void*>()) : nullptr;
|
||||
bool should_remove_widget = act->property("should_remove_widget").isValid();
|
||||
bool should_remove_action = act->property("should_remove_action").isValid();
|
||||
|
||||
removeAction(act);
|
||||
|
||||
if (widget != NULL) {
|
||||
if (widget != nullptr) {
|
||||
removeWidget(widget);
|
||||
widget->setVisible(false);
|
||||
|
||||
|
@ -35,7 +35,7 @@ TrayIconMenu::~TrayIconMenu() {
|
||||
}
|
||||
|
||||
bool TrayIconMenu::event(QEvent *event) {
|
||||
if (event->type() == QEvent::Show && Application::activeModalWidget() != NULL) {
|
||||
if (event->type() == QEvent::Show && Application::activeModalWidget() != nullptr) {
|
||||
QTimer::singleShot(0, this, SLOT(hide()));
|
||||
qApp->showGuiMessage(QSL(STRFY(APP_LONG_NAME)),
|
||||
tr("Close opened modal dialogs first."),
|
||||
@ -51,8 +51,8 @@ SystemTrayIcon::SystemTrayIcon(const QString &normal_icon, const QString &plain_
|
||||
m_normalIcon(normal_icon),
|
||||
m_plainPixmap(plain_icon),
|
||||
m_font(QFont()),
|
||||
m_bubbleClickTarget(NULL),
|
||||
m_bubbleClickSlot(NULL) {
|
||||
m_bubbleClickTarget(nullptr),
|
||||
m_bubbleClickSlot(nullptr) {
|
||||
qDebug("Creating SystemTrayIcon instance.");
|
||||
|
||||
m_font.setBold(true);
|
||||
@ -167,7 +167,7 @@ void SystemTrayIcon::setNumber(int number, bool any_new_message) {
|
||||
|
||||
void SystemTrayIcon::showMessage(const QString &title, const QString &message, QSystemTrayIcon::MessageIcon icon,
|
||||
int milliseconds_timeout_hint, QObject *click_target, const char *click_slot) {
|
||||
if (m_bubbleClickTarget != NULL && m_bubbleClickSlot != NULL) {
|
||||
if (m_bubbleClickTarget != nullptr && m_bubbleClickSlot != nullptr) {
|
||||
// Disconnect previous bubble click signalling.
|
||||
disconnect(this, SIGNAL(messageClicked()), m_bubbleClickTarget, m_bubbleClickSlot);
|
||||
}
|
||||
@ -175,7 +175,7 @@ void SystemTrayIcon::showMessage(const QString &title, const QString &message, Q
|
||||
m_bubbleClickSlot = (char*) click_slot;
|
||||
m_bubbleClickTarget = click_target;
|
||||
|
||||
if (click_target != NULL && click_slot != NULL) {
|
||||
if (click_target != nullptr && click_slot != nullptr) {
|
||||
// Establish new connection for bubble click.
|
||||
connect(this, SIGNAL(messageClicked()), click_target, click_slot);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ void TabBar::closeTabViaButton() {
|
||||
0,
|
||||
this));
|
||||
|
||||
if (close_button != NULL) {
|
||||
if (close_button != nullptr) {
|
||||
// Find index of tab for this close button.
|
||||
for (int i = 0; i < count(); i++) {
|
||||
if (tabButton(i, button_position) == close_button) {
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <QToolButton>
|
||||
|
||||
|
||||
TabWidget::TabWidget(QWidget *parent) : QTabWidget(parent), m_menuMain(NULL) {
|
||||
TabWidget::TabWidget(QWidget *parent) : QTabWidget(parent), m_menuMain(nullptr) {
|
||||
setTabBar(new TabBar(this));
|
||||
setupMainMenuButton();
|
||||
createConnections();
|
||||
@ -53,7 +53,7 @@ void TabWidget::setupMainMenuButton() {
|
||||
}
|
||||
|
||||
void TabWidget::openMainMenu() {
|
||||
if (m_menuMain == NULL) {
|
||||
if (m_menuMain == nullptr) {
|
||||
m_menuMain = new QMenu(tr("Main menu"), this);
|
||||
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuFile);
|
||||
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuView);
|
||||
|
@ -20,8 +20,6 @@
|
||||
|
||||
#include "gui/tabcontent.h"
|
||||
|
||||
//#include "ui_webbrowser.h"
|
||||
|
||||
#include "core/message.h"
|
||||
#include "network-web/webpage.h"
|
||||
#include "services/abstract/rootitem.h"
|
||||
@ -30,10 +28,6 @@
|
||||
#include <QToolBar>
|
||||
|
||||
|
||||
/*namespace Ui {
|
||||
class MessagePreviewer;
|
||||
}*/
|
||||
|
||||
class QToolButton;
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
@ -99,8 +93,6 @@ class WebBrowser : public TabContent {
|
||||
QAction *m_actionReload;
|
||||
QAction *m_actionStop;
|
||||
|
||||
//QScopedPointer<Ui::WebBrowser> m_ui;
|
||||
|
||||
QList<Message> m_messages;
|
||||
QPointer<RootItem> m_root;
|
||||
};
|
||||
|
@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>WebBrowser</class>
|
||||
<widget class="QWidget" name="WebBrowser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>502</width>
|
||||
<height>396</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="m_layout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="WebViewer" name="m_webMessage" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>WebViewer</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>webviewer.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
WidgetWithStatus::WidgetWithStatus(QWidget *parent)
|
||||
: QWidget(parent), m_wdgInput(NULL) {
|
||||
: QWidget(parent), m_wdgInput(nullptr) {
|
||||
m_layout = new QHBoxLayout(this);
|
||||
m_btnStatus = new PlainToolButton(this);
|
||||
m_btnStatus->setFocusPolicy(Qt::NoFocus);
|
||||
|
@ -42,9 +42,9 @@
|
||||
|
||||
Application::Application(const QString &id, int &argc, char **argv)
|
||||
: QtSingleApplication(id, argc, argv),
|
||||
m_updateFeedsLock(NULL), m_updateMessagesLock(NULL), m_feedServices(QList<ServiceEntryPoint*>()), m_userActions(QList<QAction*>()), m_mainForm(NULL),
|
||||
m_trayIcon(NULL), m_settings(NULL), m_system(NULL), m_skins(NULL),
|
||||
m_localization(NULL), m_icons(NULL), m_database(NULL), m_downloadManager(NULL) {
|
||||
m_updateFeedsLock(nullptr), m_updateMessagesLock(nullptr), m_feedServices(QList<ServiceEntryPoint*>()), m_userActions(QList<QAction*>()), m_mainForm(nullptr),
|
||||
m_trayIcon(nullptr), m_settings(nullptr), m_system(nullptr), m_skins(nullptr),
|
||||
m_localization(nullptr), m_icons(nullptr), m_database(nullptr), m_downloadManager(nullptr) {
|
||||
connect(this, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit()));
|
||||
connect(this, SIGNAL(commitDataRequest(QSessionManager&)), this, SLOT(onCommitData(QSessionManager&)));
|
||||
connect(this, SIGNAL(saveStateRequest(QSessionManager&)), this, SLOT(onSaveState(QSessionManager&)));
|
||||
@ -69,7 +69,7 @@ QList<ServiceEntryPoint*> Application::feedServices() {
|
||||
}
|
||||
|
||||
QList<QAction*> Application::userActions() {
|
||||
if (m_mainForm != NULL && m_userActions.isEmpty()) {
|
||||
if (m_mainForm != nullptr && m_userActions.isEmpty()) {
|
||||
m_userActions = m_mainForm->allActions();
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ void Application::eliminateFirstRun(const QString &version) {
|
||||
}
|
||||
|
||||
IconFactory *Application::icons() {
|
||||
if (m_icons == NULL) {
|
||||
if (m_icons == nullptr) {
|
||||
m_icons = new IconFactory(this);
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ IconFactory *Application::icons() {
|
||||
}
|
||||
|
||||
DownloadManager *Application::downloadManager() {
|
||||
if (m_downloadManager == NULL) {
|
||||
if (m_downloadManager == nullptr) {
|
||||
m_downloadManager = new DownloadManager();
|
||||
|
||||
connect(m_downloadManager, SIGNAL(downloadFinished()), mainForm()->statusBar(), SLOT(clearProgressDownload()));
|
||||
@ -193,7 +193,7 @@ void Application::processExecutionMessage(const QString &message) {
|
||||
// Application was running, and someone wants to add new feed.
|
||||
StandardServiceRoot *root = qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->standardServiceRoot();
|
||||
|
||||
if (root != NULL) {
|
||||
if (root != nullptr) {
|
||||
root->checkArgumentForFeedAdding(msg);
|
||||
}
|
||||
else {
|
||||
@ -207,7 +207,7 @@ void Application::processExecutionMessage(const QString &message) {
|
||||
}
|
||||
|
||||
SystemTrayIcon *Application::trayIcon() {
|
||||
if (m_trayIcon == NULL) {
|
||||
if (m_trayIcon == nullptr) {
|
||||
m_trayIcon = new SystemTrayIcon(APP_ICON_PATH, APP_ICON_PLAIN_PATH, m_mainForm);
|
||||
connect(m_trayIcon, SIGNAL(shown()),
|
||||
m_mainForm->tabWidget()->feedMessageViewer()->feedsView()->sourceModel(), SLOT(notifyWithCounts()));
|
||||
@ -222,11 +222,11 @@ void Application::showTrayIcon() {
|
||||
}
|
||||
|
||||
void Application::deleteTrayIcon() {
|
||||
if (m_trayIcon != NULL) {
|
||||
if (m_trayIcon != nullptr) {
|
||||
qDebug("Disabling tray icon, deleting it and raising main application window.");
|
||||
m_mainForm->display();
|
||||
delete m_trayIcon;
|
||||
m_trayIcon = NULL;
|
||||
m_trayIcon = nullptr;
|
||||
|
||||
// Make sure that application quits when last window is closed.
|
||||
setQuitOnLastWindowClosed(true);
|
||||
|
@ -645,7 +645,7 @@ QSqlDatabase DatabaseFactory::mysqlInitializeDatabase(const QString &connection_
|
||||
// Also, we set the SQLite driver as active one.
|
||||
qApp->settings()->setValue(GROUP(Database), Database::ActiveDriver, APP_DB_SQLITE_DRIVER);
|
||||
determineDriver();
|
||||
MessageBox::show(NULL, QMessageBox::Critical, tr("MySQL database not available"),
|
||||
MessageBox::show(nullptr, QMessageBox::Critical, tr("MySQL database not available"),
|
||||
tr("%1 cannot use MySQL storage, it is not available. %1 is now switching to SQLite database. Start your MySQL server "
|
||||
"and make adjustments in application settings.").arg(STRFY(APP_NAME)));
|
||||
|
||||
|
90
src/miscellaneous/databasequeries.cpp
Normal file → Executable file
90
src/miscellaneous/databasequeries.cpp
Normal file → Executable file
@ -214,12 +214,12 @@ QMap<int,QPair<int,int> > DatabaseQueries::getMessageCountsForCategory(QSqlDatab
|
||||
}
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -261,12 +261,12 @@ QMap<int,QPair<int,int> > DatabaseQueries::getMessageCountsForAccount(QSqlDataba
|
||||
}
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -292,14 +292,14 @@ int DatabaseQueries::getMessageCountsForFeed(QSqlDatabase db, int feed_custom_id
|
||||
q.bindValue(QSL(":account_id"), account_id);
|
||||
|
||||
if (q.exec() && q.next()) {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
return q.value(0).toInt();
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
|
||||
@ -323,14 +323,14 @@ int DatabaseQueries::getMessageCountsForBin(QSqlDatabase db, int account_id, boo
|
||||
q.bindValue(QSL(":account_id"), account_id);
|
||||
|
||||
if (q.exec() && q.next()) {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
return q.value(0).toInt();
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
|
||||
@ -359,12 +359,12 @@ QList<Message> DatabaseQueries::getUndeletedMessagesForFeed(QSqlDatabase db, int
|
||||
}
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -392,12 +392,12 @@ QList<Message> DatabaseQueries::getUndeletedMessagesForBin(QSqlDatabase db, int
|
||||
}
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -424,12 +424,12 @@ QList<Message> DatabaseQueries::getUndeletedMessagesForAccount(QSqlDatabase db,
|
||||
}
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -606,7 +606,7 @@ int DatabaseQueries::updateMessages(QSqlDatabase db,
|
||||
// just to keep the data consistent.
|
||||
if (db.exec("UPDATE Messages "
|
||||
"SET custom_id = (SELECT id FROM Messages t WHERE t.id = Messages.id) "
|
||||
"WHERE Messages.custom_id IS NULL OR Messages.custom_id = '';").lastError().isValid()) {
|
||||
"WHERE Messages.custom_id IS nullptr OR Messages.custom_id = '';").lastError().isValid()) {
|
||||
qWarning("Failed to set custom ID for all messages.");
|
||||
}
|
||||
|
||||
@ -614,12 +614,12 @@ int DatabaseQueries::updateMessages(QSqlDatabase db,
|
||||
db.rollback();
|
||||
qDebug("Transaction commit for message downloader failed.");
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
@ -794,7 +794,7 @@ QStringList DatabaseQueries::customIdsOfMessagesFromAccount(QSqlDatabase db, int
|
||||
q.prepare(QSL("SELECT custom_id FROM Messages WHERE is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;"));
|
||||
q.bindValue(QSL(":account_id"), account_id);
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = q.exec();
|
||||
}
|
||||
else {
|
||||
@ -815,7 +815,7 @@ QStringList DatabaseQueries::customIdsOfMessagesFromBin(QSqlDatabase db, int acc
|
||||
q.prepare(QSL("SELECT custom_id FROM Messages WHERE is_deleted = 1 AND is_pdeleted = 0 AND account_id = :account_id;"));
|
||||
q.bindValue(QSL(":account_id"), account_id);
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = q.exec();
|
||||
}
|
||||
else {
|
||||
@ -837,7 +837,7 @@ QStringList DatabaseQueries::customIdsOfMessagesFromFeed(QSqlDatabase db, int fe
|
||||
q.bindValue(QSL(":account_id"), account_id);
|
||||
q.bindValue(QSL(":feed"), feed_custom_id);
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = q.exec();
|
||||
}
|
||||
else {
|
||||
@ -869,14 +869,14 @@ QList<ServiceRoot*> DatabaseQueries::getOwnCloudAccounts(QSqlDatabase db, bool *
|
||||
roots.append(root);
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qWarning("OwnCloud: Getting list of activated accounts failed: '%s'.", qPrintable(query.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -905,14 +905,14 @@ QList<ServiceRoot*> DatabaseQueries::getTtRssAccounts(QSqlDatabase db, bool *ok)
|
||||
roots.append(root);
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qWarning("TT-RSS: Getting list of activated accounts failed: '%s'.", qPrintable(query.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -981,7 +981,7 @@ int DatabaseQueries::createAccount(QSqlDatabase db, const QString &code, bool *o
|
||||
if (!q.exec("SELECT max(id) FROM Accounts;") || !q.next()) {
|
||||
qWarning("Getting max ID from Accounts table failed: '%s'.", qPrintable(q.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
|
||||
@ -995,14 +995,14 @@ int DatabaseQueries::createAccount(QSqlDatabase db, const QString &code, bool *o
|
||||
q.bindValue(QSL(":type"), code);
|
||||
|
||||
if (q.exec()) {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
return id_to_assign;
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
|
||||
@ -1023,7 +1023,7 @@ Assignment DatabaseQueries::getOwnCloudCategories(QSqlDatabase db, int account_i
|
||||
if (!q.exec()) {
|
||||
qFatal("ownCloud: Query for obtaining categories failed. Error message: '%s'.", qPrintable(q.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -1036,7 +1036,7 @@ Assignment DatabaseQueries::getOwnCloudCategories(QSqlDatabase db, int account_i
|
||||
categories << pair;
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
@ -1054,7 +1054,7 @@ Assignment DatabaseQueries::getOwnCloudFeeds(QSqlDatabase db, int account_id, bo
|
||||
if (!q.exec()) {
|
||||
qFatal("ownCloud: Query for obtaining feeds failed. Error message: '%s'.", qPrintable(q.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -1067,7 +1067,7 @@ Assignment DatabaseQueries::getOwnCloudFeeds(QSqlDatabase db, int account_id, bo
|
||||
feeds << pair;
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
@ -1125,7 +1125,7 @@ int DatabaseQueries::addCategory(QSqlDatabase db, int parent_id, int account_id,
|
||||
if (!q.exec()) {
|
||||
qDebug("Failed to add category to database: '%s'.", qPrintable(q.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
|
||||
@ -1133,7 +1133,7 @@ int DatabaseQueries::addCategory(QSqlDatabase db, int parent_id, int account_id,
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
@ -1209,14 +1209,14 @@ int DatabaseQueries::addFeed(QSqlDatabase db, int parent_id, int account_id, con
|
||||
q.bindValue(QSL(":id"), new_id);
|
||||
q.exec();
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
return new_id;
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
|
||||
@ -1292,12 +1292,12 @@ QList<ServiceRoot*> DatabaseQueries::getAccounts(QSqlDatabase db, bool *ok) {
|
||||
roots.append(root);
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
@ -1318,12 +1318,12 @@ Assignment DatabaseQueries::getCategories(QSqlDatabase db, int account_id, bool
|
||||
qFatal("Query for obtaining categories failed. Error message: '%s'.",
|
||||
qPrintable(q.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
@ -1351,12 +1351,12 @@ Assignment DatabaseQueries::getFeeds(QSqlDatabase db, int account_id, bool *ok)
|
||||
qFatal("Query for obtaining feeds failed. Error message: '%s'.",
|
||||
qPrintable(q.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
@ -1463,12 +1463,12 @@ Assignment DatabaseQueries::getTtRssCategories(QSqlDatabase db, int account_id,
|
||||
if (!query_categories.exec()) {
|
||||
qFatal("Query for obtaining categories failed. Error message: '%s'.", qPrintable(query_categories.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
@ -1496,12 +1496,12 @@ Assignment DatabaseQueries::getTtRssFeeds(QSqlDatabase db, int account_id, bool
|
||||
if (!query_feeds.exec()) {
|
||||
qFatal("Query for obtaining feeds failed. Error message: '%s'.", qPrintable(query_feeds.lastError().text()));
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = true;
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ Skin SkinFactory::skinInfo(const QString &skin_name, bool *ok) const {
|
||||
skin_file.close();
|
||||
skin_file.deleteLater();
|
||||
|
||||
if (ok != NULL) {
|
||||
if (ok != nullptr) {
|
||||
*ok = !skin.m_author.isEmpty() && !skin.m_version.isEmpty() &&
|
||||
!skin.m_baseName.isEmpty() && !skin.m_email.isEmpty() &&
|
||||
!skin.m_layoutMarkup.isEmpty();
|
||||
|
@ -291,6 +291,6 @@ void SystemFactory::checkForUpdatesOnStartup() {
|
||||
qApp->showGuiMessage(tr("New version available"),
|
||||
tr("Click the bubble for more information."),
|
||||
QSystemTrayIcon::Information,
|
||||
NULL, true, qApp->mainForm(), SLOT(showUpdates()));
|
||||
nullptr, true, qApp->mainForm(), SLOT(showUpdates()));
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
Downloader::Downloader(QObject *parent)
|
||||
: QObject(parent), m_activeReply(NULL), m_downloadManager(new SilentNetworkAccessManager(this)),
|
||||
: QObject(parent), m_activeReply(nullptr), m_downloadManager(new SilentNetworkAccessManager(this)),
|
||||
m_timer(new QTimer(this)), m_customHeaders(QHash<QByteArray, QByteArray>()), m_inputData(QByteArray()),
|
||||
m_targetProtected(false), m_targetUsername(QString()), m_targetPassword(QString()),
|
||||
m_lastOutputData(QByteArray()), m_lastOutputError(QNetworkReply::NoError), m_lastContentType(QVariant()) {
|
||||
@ -110,7 +110,7 @@ void Downloader::finished() {
|
||||
}
|
||||
|
||||
m_activeReply->deleteLater();
|
||||
m_activeReply = NULL;
|
||||
m_activeReply = nullptr;
|
||||
|
||||
if (reply_operation == QNetworkAccessManager::GetOperation) {
|
||||
runGetRequest(request);
|
||||
@ -133,7 +133,7 @@ void Downloader::finished() {
|
||||
m_lastOutputError = reply->error();
|
||||
|
||||
m_activeReply->deleteLater();
|
||||
m_activeReply = NULL;
|
||||
m_activeReply = nullptr;
|
||||
|
||||
emit completed(m_lastOutputError, m_lastOutputData);
|
||||
}
|
||||
@ -204,7 +204,7 @@ QVariant Downloader::lastContentType() const {
|
||||
}
|
||||
|
||||
void Downloader::cancel() {
|
||||
if (m_activeReply != NULL) {
|
||||
if (m_activeReply != nullptr) {
|
||||
// Download action timed-out, too slow connection or target is not reachable.
|
||||
m_activeReply->abort();
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ DownloadItem::~DownloadItem() {
|
||||
}
|
||||
|
||||
void DownloadItem::init() {
|
||||
if (m_reply == NULL) {
|
||||
if (m_reply == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -442,7 +442,7 @@ void DownloadItem::updateInfoAndUrlLabel() {
|
||||
|
||||
DownloadManager::DownloadManager(QWidget *parent) : TabContent(parent), m_ui(new Ui::DownloadManager),
|
||||
m_autoSaver(new AutoSaver(this)), m_model(new DownloadModel(this)),
|
||||
m_networkManager(SilentNetworkAccessManager::instance()), m_iconProvider(NULL), m_removePolicy(Never) {
|
||||
m_networkManager(SilentNetworkAccessManager::instance()), m_iconProvider(nullptr), m_removePolicy(Never) {
|
||||
m_ui->setupUi(this);
|
||||
m_ui->m_viewDownloads->setShowGrid(false);
|
||||
m_ui->m_viewDownloads->verticalHeader()->hide();
|
||||
@ -505,7 +505,7 @@ void DownloadManager::download(const QUrl &url) {
|
||||
}
|
||||
|
||||
void DownloadManager::handleUnsupportedContent(QNetworkReply *reply) {
|
||||
if (reply == NULL || reply->url().isEmpty()) {
|
||||
if (reply == nullptr || reply->url().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
4
src/qtsingleapplication/qtlocalpeer.cpp
Normal file → Executable file
4
src/qtsingleapplication/qtlocalpeer.cpp
Normal file → Executable file
@ -109,7 +109,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
||||
}
|
||||
|
||||
QtLocalPeer::~QtLocalPeer() {
|
||||
if (server != NULL) {
|
||||
if (server != nullptr) {
|
||||
server->close();
|
||||
}
|
||||
}
|
||||
@ -157,7 +157,7 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout)
|
||||
Sleep(DWORD(ms));
|
||||
#else
|
||||
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
|
||||
nanosleep(&ts, NULL);
|
||||
nanosleep(&ts, nullptr);
|
||||
#endif
|
||||
}
|
||||
if (!connOk)
|
||||
|
12
src/services/abstract/accountcheckmodel.cpp
Normal file → Executable file
12
src/services/abstract/accountcheckmodel.cpp
Normal file → Executable file
@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
AccountCheckModel::AccountCheckModel(QObject *parent)
|
||||
: QAbstractItemModel(parent), m_rootItem(NULL), m_checkStates(QHash<RootItem*, Qt::CheckState>()), m_recursiveChange(false) {
|
||||
: QAbstractItemModel(parent), m_rootItem(nullptr), m_checkStates(QHash<RootItem*, Qt::CheckState>()), m_recursiveChange(false) {
|
||||
}
|
||||
|
||||
AccountCheckModel::~AccountCheckModel() {
|
||||
@ -43,7 +43,7 @@ RootItem *AccountCheckModel::rootItem() const {
|
||||
}
|
||||
|
||||
void AccountCheckModel::setRootItem(RootItem *root_item) {
|
||||
if (m_rootItem != NULL) {
|
||||
if (m_rootItem != nullptr) {
|
||||
delete m_rootItem;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ void AccountCheckModel::setRootItem(RootItem *root_item) {
|
||||
}
|
||||
|
||||
void AccountCheckModel::checkAllItems() {
|
||||
if (m_rootItem != NULL) {
|
||||
if (m_rootItem != nullptr) {
|
||||
foreach (RootItem *root_child, m_rootItem->childItems()) {
|
||||
if (root_child->kind() == RootItemKind::Feed || root_child->kind() == RootItemKind::Category) {
|
||||
setItemChecked(root_child, Qt::Checked);
|
||||
@ -61,7 +61,7 @@ void AccountCheckModel::checkAllItems() {
|
||||
}
|
||||
|
||||
void AccountCheckModel::uncheckAllItems() {
|
||||
if (m_rootItem != NULL) {
|
||||
if (m_rootItem != nullptr) {
|
||||
foreach (RootItem *root_child, m_rootItem->childItems()) {
|
||||
if (root_child->kind() == RootItemKind::Feed || root_child->kind() == RootItemKind::Category) {
|
||||
setData(indexForItem(root_child), Qt::Unchecked, Qt::CheckStateRole);
|
||||
@ -87,7 +87,7 @@ QModelIndex AccountCheckModel::index(int row, int column, const QModelIndex &par
|
||||
}
|
||||
|
||||
QModelIndex AccountCheckModel::indexForItem(RootItem *item) const {
|
||||
if (item == NULL || item->kind() == RootItemKind::ServiceRoot || item->kind() == RootItemKind::Root) {
|
||||
if (item == nullptr || item->kind() == RootItemKind::ServiceRoot || item->kind() == RootItemKind::Root) {
|
||||
// Root item lies on invalid index.
|
||||
return QModelIndex();
|
||||
}
|
||||
@ -150,7 +150,7 @@ int AccountCheckModel::rowCount(const QModelIndex &parent) const {
|
||||
else {
|
||||
RootItem *item = itemForIndex(parent);
|
||||
|
||||
if (item != NULL) {
|
||||
if (item != nullptr) {
|
||||
return item->childCount();
|
||||
}
|
||||
else {
|
||||
|
@ -168,7 +168,7 @@ int Feed::updateMessages(const QList<Message> &messages) {
|
||||
updateCounts(true);
|
||||
items_to_update.append(this);
|
||||
|
||||
if (getParentServiceRoot()->recycleBin() != NULL && anything_updated) {
|
||||
if (getParentServiceRoot()->recycleBin() != nullptr && anything_updated) {
|
||||
getParentServiceRoot()->recycleBin()->updateCounts(true);
|
||||
items_to_update.append(getParentServiceRoot()->recycleBin());
|
||||
}
|
||||
|
10
src/services/abstract/gui/formfeeddetails.cpp
Normal file → Executable file
10
src/services/abstract/gui/formfeeddetails.cpp
Normal file → Executable file
@ -42,7 +42,7 @@
|
||||
|
||||
FormFeedDetails::FormFeedDetails(ServiceRoot *service_root, QWidget *parent)
|
||||
: QDialog(parent),
|
||||
m_editableFeed(NULL),
|
||||
m_editableFeed(nullptr),
|
||||
m_serviceRoot(service_root) {
|
||||
initialize();
|
||||
createConnections();
|
||||
@ -62,7 +62,7 @@ int FormFeedDetails::exec(Feed *input_feed, RootItem *parent_to_select, const QS
|
||||
// Load categories.
|
||||
loadCategories(m_serviceRoot->getSubTreeCategories(), m_serviceRoot);
|
||||
|
||||
if (input_feed == NULL) {
|
||||
if (input_feed == nullptr) {
|
||||
// User is adding new category.
|
||||
setWindowTitle(tr("Add new feed"));
|
||||
|
||||
@ -76,7 +76,7 @@ int FormFeedDetails::exec(Feed *input_feed, RootItem *parent_to_select, const QS
|
||||
m_ui->m_cmbEncoding->setCurrentIndex(default_encoding_index);
|
||||
}
|
||||
|
||||
if (parent_to_select != NULL) {
|
||||
if (parent_to_select != nullptr) {
|
||||
if (parent_to_select->kind() == RootItemKind::Category) {
|
||||
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
||||
}
|
||||
@ -217,7 +217,7 @@ void FormFeedDetails::guessFeed() {
|
||||
m_ui->m_txtUsername->lineEdit()->text(),
|
||||
m_ui->m_txtPassword->lineEdit()->text());
|
||||
|
||||
if (result.first != NULL) {
|
||||
if (result.first != nullptr) {
|
||||
// Icon or whole feed was guessed.
|
||||
m_ui->m_btnIcon->setIcon(result.first->icon());
|
||||
m_ui->m_txtTitle->lineEdit()->setText(result.first->title());
|
||||
@ -261,7 +261,7 @@ void FormFeedDetails::guessIconOnly() {
|
||||
m_ui->m_txtUsername->lineEdit()->text(),
|
||||
m_ui->m_txtPassword->lineEdit()->text());
|
||||
|
||||
if (result.first != NULL) {
|
||||
if (result.first != nullptr) {
|
||||
// Icon or whole feed was guessed.
|
||||
m_ui->m_btnIcon->setIcon(result.first->icon());
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
|
||||
RootItem::RootItem(RootItem *parent_item)
|
||||
: QObject(NULL),
|
||||
: QObject(nullptr),
|
||||
m_kind(RootItemKind::Root),
|
||||
m_id(NO_PARENT_CATEGORY),
|
||||
m_customId(NO_PARENT_CATEGORY),
|
||||
@ -46,7 +46,7 @@ RootItem::~RootItem() {
|
||||
|
||||
QString RootItem::hashCode() const {
|
||||
ServiceRoot *root = getParentServiceRoot();
|
||||
int acc_id = root == NULL ? 0 : root->accountId();
|
||||
int acc_id = root == nullptr ? 0 : root->accountId();
|
||||
|
||||
return
|
||||
QString::number(acc_id) + QL1S("-") +
|
||||
@ -217,7 +217,7 @@ int RootItem::countOfAllMessages() const {
|
||||
}
|
||||
|
||||
bool RootItem::isChildOf(const RootItem *root) const {
|
||||
if (root == NULL) {
|
||||
if (root == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ bool RootItem::isChildOf(const RootItem *root) const {
|
||||
}
|
||||
|
||||
bool RootItem::isParentOf(const RootItem *child) const {
|
||||
if (child == NULL) {
|
||||
if (child == nullptr) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
@ -373,7 +373,7 @@ ServiceRoot *RootItem::getParentServiceRoot() const {
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool RootItem::removeChild(RootItem *child) {
|
||||
|
@ -152,7 +152,7 @@ bool ServiceRoot::cleanFeeds(QList<Feed*> items, bool clean_read_only) {
|
||||
|
||||
RecycleBin *bin = recycleBin();
|
||||
|
||||
if (bin != NULL) {
|
||||
if (bin != nullptr) {
|
||||
bin->updateCounts(true);
|
||||
itemss.append(bin);
|
||||
}
|
||||
@ -172,7 +172,7 @@ void ServiceRoot::storeNewFeedTree(RootItem *root) {
|
||||
if (DatabaseQueries::storeAccountTree(database, root, accountId())) {
|
||||
RecycleBin *bin = recycleBin();
|
||||
|
||||
if (bin != NULL && !childItems().contains(bin)) {
|
||||
if (bin != nullptr && !childItems().contains(bin)) {
|
||||
// As the last item, add recycle bin, which is needed.
|
||||
appendChild(bin);
|
||||
bin->updateCounts(true);
|
||||
@ -224,7 +224,7 @@ void ServiceRoot::syncIn() {
|
||||
|
||||
RootItem *new_tree = obtainNewTreeForSyncIn();
|
||||
|
||||
if (new_tree != NULL) {
|
||||
if (new_tree != nullptr) {
|
||||
// Purge old data from SQL and clean all model items.
|
||||
requestItemExpandStateSave(this);
|
||||
|
||||
@ -243,7 +243,7 @@ void ServiceRoot::syncIn() {
|
||||
removeLeftOverMessages();
|
||||
|
||||
foreach (RootItem *top_level_item, new_tree->childItems()) {
|
||||
top_level_item->setParent(NULL);
|
||||
top_level_item->setParent(nullptr);
|
||||
requestItemReassignment(top_level_item, this);
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ void ServiceRoot::syncIn() {
|
||||
}
|
||||
|
||||
RootItem *ServiceRoot::obtainNewTreeForSyncIn() const {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QStringList ServiceRoot::customIDSOfMessagesForItem(RootItem *item) {
|
||||
@ -449,7 +449,7 @@ bool ServiceRoot::onAfterMessagesDelete(RootItem *selected_item, const QList<Mes
|
||||
itemChanged(QList<RootItem*>() << bin);
|
||||
}
|
||||
else {
|
||||
if (bin != NULL) {
|
||||
if (bin != nullptr) {
|
||||
bin->updateCounts(true);
|
||||
itemChanged(QList<RootItem*>() << selected_item << bin);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
FormEditOwnCloudAccount::FormEditOwnCloudAccount(QWidget *parent)
|
||||
: QDialog(parent), m_ui(new Ui::FormEditOwnCloudAccount), m_editableRoot(NULL) {
|
||||
: QDialog(parent), m_ui(new Ui::FormEditOwnCloudAccount), m_editableRoot(nullptr) {
|
||||
m_ui->setupUi(this);
|
||||
m_btnOk = m_ui->m_buttonBox->button(QDialogButtonBox::Ok);
|
||||
|
||||
@ -131,7 +131,7 @@ void FormEditOwnCloudAccount::performTest() {
|
||||
void FormEditOwnCloudAccount::onClickedOk() {
|
||||
bool editing_account = true;
|
||||
|
||||
if (m_editableRoot == NULL) {
|
||||
if (m_editableRoot == nullptr) {
|
||||
// We want to confirm newly created account.
|
||||
// So save new account into DB, setup its properties.
|
||||
m_editableRoot = new OwnCloudServiceRoot();
|
||||
|
2
src/services/owncloud/gui/formowncloudfeeddetails.cpp
Normal file → Executable file
2
src/services/owncloud/gui/formowncloudfeeddetails.cpp
Normal file → Executable file
@ -40,7 +40,7 @@ FormOwnCloudFeedDetails::FormOwnCloudFeedDetails(ServiceRoot *service_root, QWid
|
||||
}
|
||||
|
||||
void FormOwnCloudFeedDetails::apply() {
|
||||
if (m_editableFeed != NULL) {
|
||||
if (m_editableFeed != nullptr) {
|
||||
bool renamed = false;
|
||||
|
||||
if (m_ui->m_txtTitle->lineEdit()->text() != m_editableFeed->title()) {
|
||||
|
@ -26,7 +26,7 @@ OwnCloudCategory::OwnCloudCategory(RootItem *parent) : Category(parent) {
|
||||
setIcon(qApp->icons()->fromTheme(QSL("folder")));
|
||||
}
|
||||
|
||||
OwnCloudCategory::OwnCloudCategory(const QSqlRecord &record) : Category(NULL) {
|
||||
OwnCloudCategory::OwnCloudCategory(const QSqlRecord &record) : Category(nullptr) {
|
||||
setIcon(qApp->icons()->fromTheme(QSL("folder")));
|
||||
setId(record.value(CAT_DB_ID_INDEX).toInt());
|
||||
setTitle(record.value(CAT_DB_TITLE_INDEX).toString());
|
||||
|
@ -30,7 +30,7 @@
|
||||
OwnCloudFeed::OwnCloudFeed(RootItem *parent) : Feed(parent) {
|
||||
}
|
||||
|
||||
OwnCloudFeed::OwnCloudFeed(const QSqlRecord &record) : Feed(NULL) {
|
||||
OwnCloudFeed::OwnCloudFeed(const QSqlRecord &record) : Feed(nullptr) {
|
||||
setTitle(record.value(FDS_DB_TITLE_INDEX).toString());
|
||||
setId(record.value(FDS_DB_ID_INDEX).toInt());
|
||||
setIcon(qApp->icons()->fromByteArray(record.value(FDS_DB_ICON_INDEX).toByteArray()));
|
||||
@ -49,7 +49,7 @@ bool OwnCloudFeed::canBeEdited() const {
|
||||
bool OwnCloudFeed::editViaGui() {
|
||||
QPointer<FormOwnCloudFeedDetails> form_pointer = new FormOwnCloudFeedDetails(serviceRoot(), qApp->mainForm());
|
||||
|
||||
form_pointer.data()->exec(this, NULL);
|
||||
form_pointer.data()->exec(this, nullptr);
|
||||
delete form_pointer.data();
|
||||
return false;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
OwnCloudServiceRoot::OwnCloudServiceRoot(RootItem *parent)
|
||||
: ServiceRoot(parent), m_recycleBin(new OwnCloudRecycleBin(this)),
|
||||
m_actionSyncIn(NULL), m_serviceMenu(QList<QAction*>()), m_network(new OwnCloudNetworkFactory()) {
|
||||
m_actionSyncIn(nullptr), m_serviceMenu(QList<QAction*>()), m_network(new OwnCloudNetworkFactory()) {
|
||||
setIcon(OwnCloudServiceEntryPoint().icon());
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ void OwnCloudServiceRoot::addNewFeed(const QString &url) {
|
||||
|
||||
QScopedPointer<FormOwnCloudFeedDetails> form_pointer(new FormOwnCloudFeedDetails(this, qApp->mainForm()));
|
||||
|
||||
form_pointer.data()->exec(NULL, this, url);
|
||||
form_pointer.data()->exec(nullptr, this, url);
|
||||
qApp->feedUpdateLock()->unlock();
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ RootItem *OwnCloudServiceRoot::obtainNewTreeForSyncIn() const {
|
||||
return feed_cats_response.feedsCategories(true);
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
|
||||
FormStandardCategoryDetails::FormStandardCategoryDetails(StandardServiceRoot *service_root, QWidget *parent)
|
||||
: QDialog(parent), m_editableCategory(NULL), m_serviceRoot(service_root) {
|
||||
: QDialog(parent), m_editableCategory(nullptr), m_serviceRoot(service_root) {
|
||||
initialize();
|
||||
createConnections();
|
||||
|
||||
@ -79,7 +79,7 @@ int FormStandardCategoryDetails::exec(StandardCategory *input_category, RootItem
|
||||
// Load categories.
|
||||
loadCategories(m_serviceRoot->getSubTreeCategories(), m_serviceRoot, input_category);
|
||||
|
||||
if (input_category == NULL) {
|
||||
if (input_category == nullptr) {
|
||||
// User is adding new category.
|
||||
setWindowTitle(tr("Add new category"));
|
||||
|
||||
@ -88,7 +88,7 @@ int FormStandardCategoryDetails::exec(StandardCategory *input_category, RootItem
|
||||
m_actionUseDefaultIcon->trigger();
|
||||
|
||||
// Load parent from suggested item.
|
||||
if (parent_to_select != NULL) {
|
||||
if (parent_to_select != nullptr) {
|
||||
if (parent_to_select->kind() == RootItemKind::Category) {
|
||||
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
||||
}
|
||||
@ -120,7 +120,7 @@ void FormStandardCategoryDetails::apply() {
|
||||
new_category->setDescription(m_ui->m_txtDescription->lineEdit()->text());
|
||||
new_category->setIcon(m_ui->m_btnIcon->icon());
|
||||
|
||||
if (m_editableCategory == NULL) {
|
||||
if (m_editableCategory == nullptr) {
|
||||
// Add the category.
|
||||
if (new_category->addItself(parent)) {
|
||||
m_serviceRoot->requestItemReassignment(new_category, parent);
|
||||
@ -251,7 +251,7 @@ void FormStandardCategoryDetails::loadCategories(const QList<Category*> categori
|
||||
QVariant::fromValue((void*) root_item));
|
||||
|
||||
foreach (Category *category, categories) {
|
||||
if (input_category != NULL && (category == input_category || category->isChildOf(input_category))) {
|
||||
if (input_category != nullptr && (category == input_category || category->isChildOf(input_category))) {
|
||||
// This category cannot be selected as the new
|
||||
// parent for currently edited category, so
|
||||
// don't add it.
|
||||
|
@ -45,7 +45,7 @@ void FormStandardFeedDetails::apply() {
|
||||
new_feed->setAutoUpdateType(static_cast<Feed::AutoUpdateType>(m_ui->m_cmbAutoUpdateType->itemData(m_ui->m_cmbAutoUpdateType->currentIndex()).toInt()));
|
||||
new_feed->setAutoUpdateInitialInterval(m_ui->m_spinAutoUpdateInterval->value());
|
||||
|
||||
if (m_editableFeed == NULL) {
|
||||
if (m_editableFeed == nullptr) {
|
||||
// Add the feed.
|
||||
if (new_feed->addItself(parent)) {
|
||||
m_serviceRoot->requestItemReassignment(new_feed, parent);
|
||||
|
@ -37,7 +37,7 @@ StandardCategory::StandardCategory(RootItem *parent_item) : Category(parent_item
|
||||
}
|
||||
|
||||
StandardCategory::StandardCategory(const StandardCategory &other)
|
||||
: Category(NULL) {
|
||||
: Category(nullptr) {
|
||||
setId(other.id());
|
||||
setCustomId(other.customId());
|
||||
setTitle(other.title());
|
||||
@ -100,7 +100,7 @@ bool StandardCategory::performDragDropChange(RootItem *target_item) {
|
||||
bool StandardCategory::editViaGui() {
|
||||
QScopedPointer<FormStandardCategoryDetails> form_pointer(new FormStandardCategoryDetails(serviceRoot(), qApp->mainForm()));
|
||||
|
||||
form_pointer.data()->exec(this, NULL);
|
||||
form_pointer.data()->exec(this, nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ bool StandardCategory::editItself(StandardCategory *new_category_data) {
|
||||
}
|
||||
}
|
||||
|
||||
StandardCategory::StandardCategory(const QSqlRecord &record) : Category(NULL) {
|
||||
StandardCategory::StandardCategory(const QSqlRecord &record) : Category(nullptr) {
|
||||
setId(record.value(CAT_DB_ID_INDEX).toInt());
|
||||
setCustomId(id());
|
||||
setTitle(record.value(CAT_DB_TITLE_INDEX).toString());
|
||||
|
@ -53,7 +53,7 @@ StandardFeed::StandardFeed(RootItem *parent_item)
|
||||
}
|
||||
|
||||
StandardFeed::StandardFeed(const StandardFeed &other)
|
||||
: Feed(NULL) {
|
||||
: Feed(nullptr) {
|
||||
m_passwordProtected = other.passwordProtected();
|
||||
m_username = other.username();
|
||||
m_password = other.password();
|
||||
@ -94,7 +94,7 @@ StandardServiceRoot *StandardFeed::serviceRoot() const {
|
||||
|
||||
bool StandardFeed::editViaGui() {
|
||||
QScopedPointer<FormStandardFeedDetails> form_pointer(new FormStandardFeedDetails(serviceRoot(), qApp->mainForm()));
|
||||
form_pointer.data()->exec(this, NULL);
|
||||
form_pointer.data()->exec(this, nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ QString StandardFeed::typeToString(StandardFeed::Type type) {
|
||||
void StandardFeed::fetchMetadataForItself() {
|
||||
QPair<StandardFeed*,QNetworkReply::NetworkError> metadata = guessFeed(url(), username(), password());
|
||||
|
||||
if (metadata.first != NULL && metadata.second == QNetworkReply::NoError) {
|
||||
if (metadata.first != nullptr && metadata.second == QNetworkReply::NoError) {
|
||||
// Some properties are not updated when new metadata are fetched.
|
||||
metadata.first->setParent(parent());
|
||||
metadata.first->setUrl(url());
|
||||
@ -211,7 +211,7 @@ void StandardFeed::fetchMetadataForItself() {
|
||||
QPair<StandardFeed*,QNetworkReply::NetworkError> StandardFeed::guessFeed(const QString &url,
|
||||
const QString &username,
|
||||
const QString &password) {
|
||||
QPair<StandardFeed*,QNetworkReply::NetworkError> result; result.first = NULL;
|
||||
QPair<StandardFeed*,QNetworkReply::NetworkError> result; result.first = nullptr;
|
||||
|
||||
QByteArray feed_contents;
|
||||
NetworkResult network_result = NetworkFactory::downloadFeedFile(url,
|
||||
@ -239,13 +239,13 @@ QPair<StandardFeed*,QNetworkReply::NetworkError> StandardFeed::guessFeed(const Q
|
||||
xml_schema_encoding = encoding_rexp.cap(0);
|
||||
}
|
||||
|
||||
if (result.first == NULL) {
|
||||
if (result.first == nullptr) {
|
||||
result.first = new StandardFeed();
|
||||
}
|
||||
|
||||
QTextCodec *custom_codec = QTextCodec::codecForName(xml_schema_encoding.toLocal8Bit());
|
||||
|
||||
if (custom_codec != NULL) {
|
||||
if (custom_codec != nullptr) {
|
||||
// Feed encoding was probably guessed.
|
||||
xml_contents_encoded = custom_codec->toUnicode(feed_contents);
|
||||
result.first->setEncoding(xml_schema_encoding);
|
||||
@ -450,7 +450,7 @@ QList<Message> StandardFeed::obtainNewMessages() {
|
||||
QTextCodec *codec = QTextCodec::codecForName(encoding().toLocal8Bit());
|
||||
QString formatted_feed_contents;
|
||||
|
||||
if (codec == NULL) {
|
||||
if (codec == nullptr) {
|
||||
// No suitable codec for this encoding was found.
|
||||
// Use non-converted data.
|
||||
formatted_feed_contents = feed_contents;
|
||||
@ -487,7 +487,7 @@ QNetworkReply::NetworkError StandardFeed::networkError() const {
|
||||
return m_networkError;
|
||||
}
|
||||
|
||||
StandardFeed::StandardFeed(const QSqlRecord &record) : Feed(NULL) {
|
||||
StandardFeed::StandardFeed(const QSqlRecord &record) : Feed(nullptr) {
|
||||
setTitle(record.value(FDS_DB_TITLE_INDEX).toString());
|
||||
setId(record.value(FDS_DB_ID_INDEX).toInt());
|
||||
setCustomId(id());
|
||||
|
@ -36,7 +36,7 @@ FeedsImportExportModel::FeedsImportExportModel(QObject *parent)
|
||||
}
|
||||
|
||||
FeedsImportExportModel::~FeedsImportExportModel() {
|
||||
if (m_rootItem != NULL && m_mode == Import) {
|
||||
if (m_rootItem != nullptr && m_mode == Import) {
|
||||
// Delete all model items, but only if we are in import mode. Export mode shares
|
||||
// root item with main feed model, thus cannot be deleted from memory now.
|
||||
delete m_rootItem;
|
||||
@ -139,7 +139,7 @@ bool FeedsImportExportModel::exportToOMPL20(QByteArray &result) {
|
||||
void FeedsImportExportModel::importAsOPML20(const QByteArray &data, bool fetch_metadata_online) {
|
||||
emit parsingStarted();
|
||||
emit layoutAboutToBeChanged();
|
||||
setRootItem(NULL);
|
||||
setRootItem(nullptr);
|
||||
emit layoutChanged();
|
||||
|
||||
QDomDocument opml_document;
|
||||
@ -279,7 +279,7 @@ bool FeedsImportExportModel::exportToTxtURLPerLine(QByteArray &result) {
|
||||
void FeedsImportExportModel::importAsTxtURLPerLine(const QByteArray &data, bool fetch_metadata_online) {
|
||||
emit parsingStarted();
|
||||
emit layoutAboutToBeChanged();
|
||||
setRootItem(NULL);
|
||||
setRootItem(nullptr);
|
||||
emit layoutChanged();
|
||||
|
||||
int completed = 0, succeded = 0, failed = 0;
|
||||
|
@ -70,7 +70,7 @@ ServiceRoot *StandardServiceEntryPoint::createNewRoot() const {
|
||||
return root;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,8 @@
|
||||
|
||||
StandardServiceRoot::StandardServiceRoot(RootItem *parent)
|
||||
: ServiceRoot(parent), m_recycleBin(new RecycleBin(this)),
|
||||
m_actionExportFeeds(NULL), m_actionImportFeeds(NULL), m_serviceMenu(QList<QAction*>()),
|
||||
m_feedContextMenu(QList<QAction*>()), m_actionFeedFetchMetadata(NULL) {
|
||||
m_actionExportFeeds(nullptr), m_actionImportFeeds(nullptr), m_serviceMenu(QList<QAction*>()),
|
||||
m_feedContextMenu(QList<QAction*>()), m_actionFeedFetchMetadata(nullptr) {
|
||||
|
||||
setTitle(qApp->system()->getUsername() + QL1S("@") + QL1S(STRFY(APP_LOW_NAME)));
|
||||
setIcon(StandardServiceEntryPoint().icon());
|
||||
@ -142,7 +142,7 @@ void StandardServiceRoot::addNewFeed(const QString &url) {
|
||||
}
|
||||
|
||||
QScopedPointer<FormStandardFeedDetails> form_pointer(new FormStandardFeedDetails(this, qApp->mainForm()));
|
||||
form_pointer.data()->exec(NULL, NULL, url);
|
||||
form_pointer.data()->exec(nullptr, nullptr, url);
|
||||
|
||||
qApp->feedUpdateLock()->unlock();
|
||||
}
|
||||
@ -224,7 +224,7 @@ void StandardServiceRoot::checkArgumentForFeedAdding(const QString &argument) {
|
||||
QList<QAction*> StandardServiceRoot::getContextMenuForFeed(StandardFeed *feed) {
|
||||
if (m_feedContextMenu.isEmpty()) {
|
||||
// Initialize.
|
||||
m_actionFeedFetchMetadata = new QAction(qApp->icons()->fromTheme(QSL("emblem-downloads")), tr("Fetch metadata"), NULL);
|
||||
m_actionFeedFetchMetadata = new QAction(qApp->icons()->fromTheme(QSL("emblem-downloads")), tr("Fetch metadata"), nullptr);
|
||||
m_feedContextMenu.append(m_actionFeedFetchMetadata);
|
||||
}
|
||||
|
||||
@ -273,14 +273,14 @@ bool StandardServiceRoot::mergeImportExportModel(FeedsImportExportModel *model,
|
||||
// Add category failed, but this can mean that the same category (with same title)
|
||||
// already exists. If such a category exists in current parent, then find it and
|
||||
// add descendants to it.
|
||||
RootItem *existing_category = NULL;
|
||||
RootItem *existing_category = nullptr;
|
||||
foreach (RootItem *child, target_parent->childItems()) {
|
||||
if (child->kind() == RootItemKind::Category && child->title() == new_category_title) {
|
||||
existing_category = child;
|
||||
}
|
||||
}
|
||||
|
||||
if (existing_category != NULL) {
|
||||
if (existing_category != nullptr) {
|
||||
original_parents.push(existing_category);
|
||||
new_parents.push(source_category);
|
||||
}
|
||||
@ -328,7 +328,7 @@ void StandardServiceRoot::addNewCategory() {
|
||||
}
|
||||
|
||||
QScopedPointer<FormStandardCategoryDetails> form_pointer(new FormStandardCategoryDetails(this, qApp->mainForm()));
|
||||
form_pointer.data()->exec(NULL, NULL);
|
||||
form_pointer.data()->exec(nullptr, nullptr);
|
||||
|
||||
qApp->feedUpdateLock()->unlock();
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
FormEditAccount::FormEditAccount(QWidget *parent)
|
||||
: QDialog(parent), m_ui(new Ui::FormEditAccount), m_editableRoot(NULL) {
|
||||
: QDialog(parent), m_ui(new Ui::FormEditAccount), m_editableRoot(nullptr) {
|
||||
m_ui->setupUi(this);
|
||||
m_btnOk = m_ui->m_buttonBox->button(QDialogButtonBox::Ok);
|
||||
|
||||
@ -175,7 +175,7 @@ void FormEditAccount::performTest() {
|
||||
void FormEditAccount::onClickedOk() {
|
||||
bool editing_account = true;
|
||||
|
||||
if (m_editableRoot == NULL) {
|
||||
if (m_editableRoot == nullptr) {
|
||||
// We want to confirm newly created account.
|
||||
// So save new account into DB, setup its properties.
|
||||
m_editableRoot = new TtRssServiceRoot();
|
||||
|
2
src/services/tt-rss/gui/formttrssfeeddetails.cpp
Normal file → Executable file
2
src/services/tt-rss/gui/formttrssfeeddetails.cpp
Normal file → Executable file
@ -41,7 +41,7 @@ FormTtRssFeedDetails::FormTtRssFeedDetails(ServiceRoot *service_root, QWidget *p
|
||||
}
|
||||
|
||||
void FormTtRssFeedDetails::apply() {
|
||||
if (m_editableFeed != NULL) {
|
||||
if (m_editableFeed != nullptr) {
|
||||
// User edited auto-update status. Save it.
|
||||
TtRssFeed *new_feed_data = new TtRssFeed();
|
||||
|
||||
|
@ -31,7 +31,7 @@ TtRssCategory::TtRssCategory(RootItem *parent) : Category(parent) {
|
||||
setIcon(qApp->icons()->fromTheme(QSL("folder")));
|
||||
}
|
||||
|
||||
TtRssCategory::TtRssCategory(const QSqlRecord &record) : Category(NULL) {
|
||||
TtRssCategory::TtRssCategory(const QSqlRecord &record) : Category(nullptr) {
|
||||
setIcon(qApp->icons()->fromTheme(QSL("folder")));
|
||||
setId(record.value(CAT_DB_ID_INDEX).toInt());
|
||||
setTitle(record.value(CAT_DB_TITLE_INDEX).toString());
|
||||
|
@ -36,7 +36,7 @@ TtRssFeed::TtRssFeed(RootItem *parent)
|
||||
: Feed(parent) {
|
||||
}
|
||||
|
||||
TtRssFeed::TtRssFeed(const QSqlRecord &record) : Feed(NULL) {
|
||||
TtRssFeed::TtRssFeed(const QSqlRecord &record) : Feed(nullptr) {
|
||||
setTitle(record.value(FDS_DB_TITLE_INDEX).toString());
|
||||
setId(record.value(FDS_DB_ID_INDEX).toInt());
|
||||
setIcon(qApp->icons()->fromByteArray(record.value(FDS_DB_ICON_INDEX).toByteArray()));
|
||||
@ -102,7 +102,7 @@ bool TtRssFeed::canBeEdited() const {
|
||||
bool TtRssFeed::editViaGui() {
|
||||
QPointer<FormTtRssFeedDetails> form_pointer = new FormTtRssFeedDetails(serviceRoot(), qApp->mainForm());
|
||||
|
||||
form_pointer.data()->exec(this, NULL);
|
||||
form_pointer.data()->exec(this, nullptr);
|
||||
delete form_pointer.data();
|
||||
return false;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
TtRssServiceRoot::TtRssServiceRoot(RootItem *parent)
|
||||
: ServiceRoot(parent), m_recycleBin(new TtRssRecycleBin(this)),
|
||||
m_actionSyncIn(NULL), m_serviceMenu(QList<QAction*>()), m_network(new TtRssNetworkFactory()) {
|
||||
m_actionSyncIn(nullptr), m_serviceMenu(QList<QAction*>()), m_network(new TtRssNetworkFactory()) {
|
||||
setIcon(TtRssServiceEntryPoint().icon());
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ void TtRssServiceRoot::addNewFeed(const QString &url) {
|
||||
|
||||
QScopedPointer<FormTtRssFeedDetails> form_pointer(new FormTtRssFeedDetails(this, qApp->mainForm()));
|
||||
|
||||
form_pointer.data()->exec(NULL, this, url);
|
||||
form_pointer.data()->exec(nullptr, this, url);
|
||||
qApp->feedUpdateLock()->unlock();
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ RootItem *TtRssServiceRoot::obtainNewTreeForSyncIn() const {
|
||||
return feed_cats_response.feedsCategories(true, m_network->url());
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user