Gui index config: only show the custom subtrees that come from the user config, not the standard ones from the system file
This commit is contained in:
parent
e96579568a
commit
98caf723ec
@ -295,7 +295,14 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config)
|
|||||||
SLOT(subDirChanged(QListWidgetItem *, QListWidgetItem *)));
|
SLOT(subDirChanged(QListWidgetItem *, QListWidgetItem *)));
|
||||||
connect(m_subdirs, SIGNAL(entryDeleted(QString)),
|
connect(m_subdirs, SIGNAL(entryDeleted(QString)),
|
||||||
this, SLOT(subDirDeleted(QString)));
|
this, SLOT(subDirDeleted(QString)));
|
||||||
list<string> allkeydirs = config->getSubKeys();
|
|
||||||
|
// We only retrieve the subkeys from the user's config (shallow),
|
||||||
|
// no use to confuse the user by showing the subtrees which are
|
||||||
|
// customized in the system config like .thunderbird or
|
||||||
|
// .purple. This doesn't prevent them to add and customize them
|
||||||
|
// further.
|
||||||
|
list<string> allkeydirs = config->getSubKeys(true);
|
||||||
|
|
||||||
QStringList qls;
|
QStringList qls;
|
||||||
for (list<string>::const_iterator it = allkeydirs.begin();
|
for (list<string>::const_iterator it = allkeydirs.begin();
|
||||||
it != allkeydirs.end(); it++) {
|
it != allkeydirs.end(); it++) {
|
||||||
|
|||||||
@ -105,6 +105,7 @@ public:
|
|||||||
virtual int eraseKey(const string &) = 0;
|
virtual int eraseKey(const string &) = 0;
|
||||||
virtual void listall() {};
|
virtual void listall() {};
|
||||||
virtual list<string> getSubKeys() = 0;
|
virtual list<string> getSubKeys() = 0;
|
||||||
|
virtual list<string> getSubKeys(bool) = 0;
|
||||||
virtual bool holdWrites(bool) = 0;
|
virtual bool holdWrites(bool) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -205,6 +206,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Return all subkeys
|
* Return all subkeys
|
||||||
*/
|
*/
|
||||||
|
virtual list<string> getSubKeys(bool) {return getSubKeys();}
|
||||||
virtual list<string> getSubKeys();
|
virtual list<string> getSubKeys();
|
||||||
|
|
||||||
virtual string getFilename() {return m_filename;}
|
virtual string getFilename() {return m_filename;}
|
||||||
@ -435,7 +437,8 @@ public:
|
|||||||
return nms;
|
return nms;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual list<string> getSubKeys()
|
virtual list<string> getSubKeys(){return getSubKeys(false);}
|
||||||
|
virtual list<string> getSubKeys(bool shallow)
|
||||||
{
|
{
|
||||||
list<string> sks;
|
list<string> sks;
|
||||||
typename list<T*>::iterator it;
|
typename list<T*>::iterator it;
|
||||||
@ -443,6 +446,8 @@ public:
|
|||||||
list<string> lst;
|
list<string> lst;
|
||||||
lst = (*it)->getSubKeys();
|
lst = (*it)->getSubKeys();
|
||||||
sks.insert(sks.end(), lst.begin(), lst.end());
|
sks.insert(sks.end(), lst.begin(), lst.end());
|
||||||
|
if (shallow)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
sks.sort();
|
sks.sort();
|
||||||
sks.unique();
|
sks.unique();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user