Some clazy fixes.

This commit is contained in:
Martin Rotter 2017-04-23 20:30:25 +02:00
parent 49b23532ef
commit 739ddbd10f
5 changed files with 10 additions and 10 deletions

View File

@ -86,12 +86,12 @@ QMimeData *FeedsModel::mimeData(const QModelIndexList &indexes) const {
}
}
mime_data->setData(MIME_TYPE_ITEM_POINTER, encoded_data);
mime_data->setData(QSL(MIME_TYPE_ITEM_POINTER), encoded_data);
return mime_data;
}
QStringList FeedsModel::mimeTypes() const {
return QStringList() << MIME_TYPE_ITEM_POINTER;
return QStringList() << QSL(MIME_TYPE_ITEM_POINTER);
}
bool FeedsModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) {
@ -105,7 +105,7 @@ bool FeedsModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int
return false;
}
QByteArray dragged_items_data = data->data(MIME_TYPE_ITEM_POINTER);
QByteArray dragged_items_data = data->data(QSL(MIME_TYPE_ITEM_POINTER));
if (dragged_items_data.isEmpty()) {
return false;

View File

@ -241,7 +241,7 @@ void FeedsProxyModel::invalidateReadFeedsFilter(bool set_new_value, bool show_un
setShowUnreadOnly(show_unread_only);
}
QTimer::singleShot(0, this, SLOT(invalidateFilter()));
QTimer::singleShot(0, this, &FeedsProxyModel::invalidateFilter);
}
void FeedsProxyModel::setShowUnreadOnly(bool show_unread_only) {

View File

@ -48,7 +48,7 @@ class IOFactory {
// Throws exception when no such file exists.
static QByteArray readTextFile(const QString &file_path);
static void writeTextFile(const QString &file_path, const QByteArray &data, const QString &encoding = "UTF-8");
static void writeTextFile(const QString &file_path, const QByteArray &data, const QString &encoding = QSL("UTF-8"));
// Copies file, overwrites destination.
static bool copyFile(const QString &source, const QString &destination);

View File

@ -317,11 +317,11 @@ class Settings : public QSettings {
// Getters/setters for settings values.
inline QVariant value(const QString &section, const QString &key, const QVariant &default_value = QVariant()) const {
return QSettings::value(QString("%1/%2").arg(section, key), default_value);
return QSettings::value(QString(QSL("%1/%2")).arg(section, key), default_value);
}
inline void setValue(const QString &section, const QString &key, const QVariant &value) {
QSettings::setValue(QString("%1/%2").arg(section, key), value);
QSettings::setValue(QString(QSL("%1/%2")).arg(section, key), value);
}
inline void setValue(const QString &key, const QVariant &value) {
@ -329,11 +329,11 @@ class Settings : public QSettings {
}
inline bool contains(const QString &section, const QString &key) const {
return QSettings::contains(QString("%1/%2").arg(section, key));
return QSettings::contains(QString(QSL("%1/%2")).arg(section, key));
}
inline void remove(const QString &section, const QString &key) {
QSettings::remove(QString("%1/%2").arg(section, key));
QSettings::remove(QString(QSL("%1/%2")).arg(section, key));
}
// Returns the path which contains the settings.

View File

@ -152,7 +152,7 @@ class RootItem : public QObject {
m_childItems.clear();
}
inline void setChildItems(QList<RootItem*> child_items) {
inline void setChildItems(const QList<RootItem*> &child_items) {
m_childItems = child_items;
}