Solving issue 1993: "Some bundled profiles appears twice in the ProfilePanel's combobox"

This commit is contained in:
Hombre
2013-10-05 23:05:53 +02:00
parent 13d2d6f032
commit 2709154e39
4 changed files with 12 additions and 211 deletions

View File

@@ -169,7 +169,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath
if (safe_file_test (fname, Glib::FILE_TEST_IS_DIR)) {
Glib::ustring vp(Glib::build_filename(virtualPath, currDir));
Glib::ustring rp(Glib::build_filename(realPath, currDir));
parseDir (rp, vp, currDir, folder, level+1, 0);
fileFound = parseDir (rp, vp, currDir, folder, level+1, 0);
}
else {
size_t lastdot = currDir.find_last_of ('.');
@@ -396,6 +396,14 @@ void ProfileStore::removeListener(ProfileStoreListener *listener) {
listeners.remove(listener);
}
void ProfileStore::dumpFolderList() {
printf("Folder list:\n------------\n");
for (unsigned int i=0; i<folders.size(); i++) {
printf(" #%3d - %s\n", i, folders.at(i).c_str());
}
printf("\n");
}
ProfileStoreEntry::ProfileStoreEntry() : label(""), type(PSET_FOLDER), parentFolderId(0), folderId(0) {}
ProfileStoreEntry::ProfileStoreEntry(Glib::ustring label, PSEType type, unsigned short parentFolder, unsigned short folder) : label(label), type(type), parentFolderId(parentFolder), folderId(folder) {}
@@ -495,6 +503,7 @@ void ProfileStoreComboBox::updateProfileList () {
const std::vector<const ProfileStoreEntry*> *entryList = profileStore.getFileList();
Gtk::TreeModel::Row root;
//profileStore.dumpFolderList();
refreshProfileList_ (&root, entryList->at(0)->parentFolderId, true, entryList);
if (entryList->at(0)->parentFolderId != 0) {

View File

@@ -182,6 +182,8 @@ class ProfileStore {
void addListener(ProfileStoreListener *listener);
void removeListener(ProfileStoreListener *listener);
void dumpFolderList();
};
class ProfileStoreComboBox : public MyComboBox {