forked from qt-creator/qt-creator
code cosmetics
This commit is contained in:
@@ -96,9 +96,11 @@ int HistoryListModel::rowCount(const QModelIndex & parent) const
|
||||
|
||||
QVariant HistoryListModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (index.row() >= list.count() || index.column() != 0 || (role != Qt::DisplayRole && role != Qt::EditRole))
|
||||
if (index.row() >= list.count() || index.column() != 0)
|
||||
return QVariant();
|
||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||
return list.at(index.row());
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void HistoryListModel::clearHistory()
|
||||
|
||||
@@ -39,20 +39,25 @@ QT_FORWARD_DECLARE_CLASS(QSettings)
|
||||
namespace Utils {
|
||||
|
||||
class HistoryCompleterPrivate;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HistoryCompleter(QObject *parent = 0);
|
||||
QSettings *settings() const;
|
||||
int historySize() const;
|
||||
int maximalHistorySize() const;
|
||||
void setMaximalHistorySize(int numberOfEntries);
|
||||
|
||||
public Q_SLOTS:
|
||||
void clearHistory();
|
||||
void saveHistory();
|
||||
|
||||
protected:
|
||||
HistoryCompleterPrivate *d_ptr;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(HistoryCompleter);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user