mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
Split creation, configuration and use of FileLister objects
The constructor now has zero arguments. showDirectories and showFiles are now set using setter methods. FileLister::browse is now the sole way to start a scan for files and directories, replacing the initial path in the constructor and the setPath method. It allows merging results from multiple directories as before. This is all to make explicit how many times the costly task of browsing a directory is actually carried out.
This commit is contained in:
committed by
Maarten ter Huurne
parent
1508ac87ac
commit
1dec6f6f11
@@ -46,28 +46,26 @@ bool WallpaperDialog::exec()
|
||||
fl.setFilter("png");
|
||||
|
||||
string filepath = GMenu2X::getHome() + "/skins/"
|
||||
+ gmenu2x->confStr["skin"] + "/wallpapers";
|
||||
if (fileExists(filepath))
|
||||
fl.setPath(filepath, true);
|
||||
+ gmenu2x->confStr["skin"] + "/wallpapers";
|
||||
if (fileExists(filepath)) {
|
||||
fl.browse(filepath, true);
|
||||
}
|
||||
|
||||
filepath = GMENU2X_SYSTEM_DIR "/skins/"
|
||||
+ gmenu2x->confStr["skin"] + "/wallpapers";
|
||||
+ gmenu2x->confStr["skin"] + "/wallpapers";
|
||||
if (fileExists(filepath)) {
|
||||
fl.setPath(filepath, false);
|
||||
fl.browse(false);
|
||||
fl.browse(filepath, false);
|
||||
}
|
||||
|
||||
if (gmenu2x->confStr["skin"] != "Default") {
|
||||
filepath = GMenu2X::getHome() + "/skins/Default/wallpapers";
|
||||
if (fileExists(filepath)) {
|
||||
fl.setPath(filepath, false);
|
||||
fl.browse(false);
|
||||
fl.browse(filepath, false);
|
||||
}
|
||||
|
||||
filepath = GMENU2X_SYSTEM_DIR "/skins/Default/wallpapers";
|
||||
if (fileExists(filepath)) {
|
||||
fl.setPath(filepath, false);
|
||||
fl.browse(false);
|
||||
fl.browse(filepath, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user