Skip to content
Snippets Groups Projects
Commit e1672084 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Sébastien Blin
Browse files

pluginpreferences: code change to handle windows errors

Change-Id: I885a8d8287511d6769d3c33a255c5216f12c6cac
parent 9b1899ef
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,7 @@ PreferenceItemListModel::data(const QModelIndex &index, int role) const
auto details = preferenceList.at(index.row());
int type = Type::DEFAULT;
auto it = mapType.find(details["type"]);
if (it != mapType.end())
{
if (it != mapType.end()) {
type = mapType[details["type"]];
}
......@@ -151,3 +150,9 @@ PreferenceItemListModel::setPluginId(const QString &pluginId)
{
pluginId_ = pluginId;
}
int
PreferenceItemListModel::preferencesCount()
{
return LRCInstance::pluginModel().getPluginPreferences(pluginId_).size();
}
\ No newline at end of file
......@@ -29,8 +29,17 @@ class PreferenceItemListModel : public QAbstractListModel
Q_OBJECT
Q_PROPERTY(QString pluginId READ pluginId WRITE setPluginId)
Q_PROPERTY(int preferencesCount READ preferencesCount)
public:
enum Role { PreferenceKey = Qt::UserRole + 1, PreferenceName, PreferenceSummary, PreferenceType, PreferenceDefaultValue, PreferenceEntries, PreferenceEntryValues};
enum Role {
PreferenceKey = Qt::UserRole + 1,
PreferenceName,
PreferenceSummary,
PreferenceType,
PreferenceDefaultValue,
PreferenceEntries,
PreferenceEntryValues
};
typedef enum {
LIST,
......@@ -63,8 +72,8 @@ public:
QString pluginId() const;
void setPluginId(const QString& pluginId);
// signals:
// void pluginIdChanged();
int preferencesCount();
private:
QString pluginId_;
};
......@@ -70,7 +70,8 @@ Rectangle {
}
function getSize(pluginId, show){
size = 50 * ClientWrapper.pluginModel.getPluginPreferences(pluginId).length
preferenceItemListModel.pluginId = pluginId
size = 50 * preferenceItemListModel.preferencesCount
if (show) {
height = 200 + size
pluginPreferenceView.height = size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment