Some clazy fixes.

This commit is contained in:
Martin Rotter 2017-04-23 20:52:31 +02:00
parent 739ddbd10f
commit ec886d15ee
8 changed files with 14 additions and 12 deletions

View File

@ -65,7 +65,7 @@ QString Enclosures::encodeEnclosuresToString(const QList<Enclosure> &enclosures)
} }
Message::Message() { Message::Message() {
m_title = m_url = m_author = m_contents = m_feedId = m_customId = m_customHash = ""; m_title = m_url = m_author = m_contents = m_feedId = m_customId = m_customHash = QSL("");
m_enclosures = QList<Enclosure>(); m_enclosures = QList<Enclosure>();
m_accountId = m_id = 0; m_accountId = m_id = 0;
m_isRead = m_isImportant = false; m_isRead = m_isImportant = false;

View File

@ -74,7 +74,7 @@ void MessagesModel::loadMessages(RootItem *item) {
} }
else { else {
if (!item->getParentServiceRoot()->loadMessagesForItem(item, this)) { if (!item->getParentServiceRoot()->loadMessagesForItem(item, this)) {
setFilter("true != true"); setFilter(QSL("true != true"));
qWarning("Loading of messages from item '%s' failed.", qPrintable(item->title())); qWarning("Loading of messages from item '%s' failed.", qPrintable(item->title()));
qApp->showGuiMessage(tr("Loading of messages from item '%1' failed.").arg(item->title()), qApp->showGuiMessage(tr("Loading of messages from item '%1' failed.").arg(item->title()),
tr("Loading of messages failed, maybe messages could not be downloaded."), tr("Loading of messages failed, maybe messages could not be downloaded."),
@ -201,7 +201,7 @@ QVariant MessagesModel::data(const QModelIndex &idx, int role) const {
else if (index_column == MSG_DB_AUTHOR_INDEX) { else if (index_column == MSG_DB_AUTHOR_INDEX) {
const QString author_name = QSqlTableModel::data(idx, role).toString(); const QString author_name = QSqlTableModel::data(idx, role).toString();
return author_name.isEmpty() ? "-" : author_name; return author_name.isEmpty() ? QSL("-") : author_name;
} }
else if (index_column != MSG_DB_IMPORTANT_INDEX && index_column != MSG_DB_READ_INDEX) { else if (index_column != MSG_DB_IMPORTANT_INDEX && index_column != MSG_DB_READ_INDEX) {
return QSqlTableModel::data(idx, role); return QSqlTableModel::data(idx, role);

View File

@ -72,7 +72,8 @@ void ShortcutButton::keyPressEvent(QKeyEvent *event) {
} }
if (!m_catcher->m_isRecording) { if (!m_catcher->m_isRecording) {
return QPushButton::keyPressEvent(event); QPushButton::keyPressEvent(event);
return;
} }
event->accept(); event->accept();
@ -124,7 +125,8 @@ void ShortcutButton::keyReleaseEvent(QKeyEvent *event) {
} }
if (!m_catcher->m_isRecording) { if (!m_catcher->m_isRecording) {
return QPushButton::keyReleaseEvent(event); QPushButton::keyReleaseEvent(event);
return;
} }
event->accept(); event->accept();

View File

@ -35,7 +35,7 @@ BaseToolBar::~BaseToolBar() {
qDebug("Destroying BaseToolBar instance."); qDebug("Destroying BaseToolBar instance.");
} }
QAction *BaseBar::findMatchingAction(const QString &action, const QList<QAction*> actions) const { QAction *BaseBar::findMatchingAction(const QString &action, const QList<QAction*> &actions) const {
foreach (QAction *act, actions) { foreach (QAction *act, actions) {
if (act->objectName() == action) { if (act->objectName() == action) {
return act; return act;

View File

@ -38,7 +38,7 @@ class BaseBar {
virtual void loadChangeableActions() = 0; virtual void loadChangeableActions() = 0;
protected: protected:
QAction *findMatchingAction(const QString &action, const QList<QAction*> actions) const; QAction *findMatchingAction(const QString &action, const QList<QAction *> &actions) const;
}; };
class BaseToolBar : public QToolBar, public BaseBar { class BaseToolBar : public QToolBar, public BaseBar {

View File

@ -191,7 +191,7 @@ void FormMain::prepareMenus() {
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
m_trayMenu = new TrayIconMenu(APP_NAME, this); m_trayMenu = new TrayIconMenu(APP_NAME, this);
#else #else
m_trayMenu = new QMenu(APP_NAME, this); m_trayMenu = new QMenu(QSL(APP_NAME), this);
#endif #endif
// Add needed items to the menu. // Add needed items to the menu.
@ -252,7 +252,7 @@ void FormMain::updateAddItemMenu() {
m_ui->m_menuAddItem); m_ui->m_menuAddItem);
root_menu->addAction(action_new_feed); root_menu->addAction(action_new_feed);
// NOTE: Because of default arguments. // NOTE: Because of default arguments.
connect(action_new_feed, SIGNAL(triggered()), activated_root, SLOT(addNewFeed())); connect(action_new_feed, SIGNAL(triggered(bool)), activated_root, SLOT(addNewFeed()));
} }
if (!specific_root_actions.isEmpty()) { if (!specific_root_actions.isEmpty()) {
@ -349,7 +349,7 @@ void FormMain::updateAccountsMenu() {
m_ui->m_menuAccounts->addAction(m_ui->m_actionServiceDelete); m_ui->m_menuAccounts->addAction(m_ui->m_actionServiceDelete);
} }
void FormMain::onFeedUpdatesFinished(FeedDownloadResults results) { void FormMain::onFeedUpdatesFinished(const FeedDownloadResults &results) {
Q_UNUSED(results) Q_UNUSED(results)
statusBar()->clearProgressFeeds(); statusBar()->clearProgressFeeds();

View File

@ -75,7 +75,7 @@ class FormMain : public QMainWindow {
void onFeedUpdatesStarted(); void onFeedUpdatesStarted();
void onFeedUpdatesProgress(const Feed *feed, int current, int total); void onFeedUpdatesProgress(const Feed *feed, int current, int total);
void onFeedUpdatesFinished(FeedDownloadResults results); void onFeedUpdatesFinished(const FeedDownloadResults &results);
// Displays various dialogs. // Displays various dialogs.
void backupDatabaseSettings(); void backupDatabaseSettings();

View File

@ -87,7 +87,7 @@ class StandardFeed : public Feed {
return m_type; return m_type;
} }
inline void setType(const Type &type) { inline void setType(Type type) {
m_type = type; m_type = type;
} }