multi-account: compile with Qt4

This commit is contained in:
Olivier Goffart 2015-06-02 19:57:41 +02:00
parent 984434c728
commit e587c8e2dc
3 changed files with 12 additions and 6 deletions

View File

@ -222,7 +222,7 @@ bool FolderStatusModel::setData(const QModelIndex& index, const QVariant& value,
}
_dirty = true;
emit dirtyChanged();
dataChanged(index, index, QVector<int>() << role);
emit dataChanged(index, index, QVector<int>() << role);
return true;
}
return QAbstractItemModel::setData(index, value, role);

View File

@ -19,10 +19,6 @@
#include <QStandardItemModel>
#include <accountfwd.h>
#ifndef Q_DECL_OVERRIDE
#define Q_DECL_OVERRIDE
#endif
namespace OCC {
class Folder;
@ -96,6 +92,12 @@ private:
AccountPtr _account;
bool _dirty = false; // If the selective sync checkboxes were changed
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
//the roles argument was added in Qt5
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>())
{ emit QAbstractItemModel::dataChanged(topLeft,bottomRight); }
#endif
signals:
void dirtyChanged();
};

View File

@ -166,7 +166,11 @@ void SettingsDialog::accountAdded(AccountState *s)
_ui->stack->insertWidget(0 , accountSettings);
_actions.insert(accountAction, accountSettings);
auto group = findChild<QActionGroup*>(QString(), Qt::FindDirectChildrenOnly);
auto group = findChild<QActionGroup*>(
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QString() , Qt::FindDirectChildrenOnly
#endif
);
Q_ASSERT(group);
group->addAction(accountAction);