From kde-devel Mon Jan 30 23:02:15 2006 From: Luke Sandell Date: Mon, 30 Jan 2006 23:02:15 +0000 To: kde-devel Subject: Generalizing KStandardDirs::findResource() Message-Id: <200601302302.15401.ls65594 () appstate ! edu> X-MARC-Message: https://marc.info/?l=kde-devel&m=113881249918127 This post pertains to the KStandardDirs::findResource() member function. Looking at the source, the first statement is as follows: if (!QDir::isRelativePath(filename)) return filename; // absolute dirs are absolute dirs, right? :-/ This is a nice check, but unfortunately I don't think it makes much sense. I can't really think of many cases in which the programmer would pass an absolute path into findResource(). On the other hand, consider the following code segment: QString wallpaper_dir = KGlobal::dirs()->findResource("wallpaper", "/"); The programmer expects it to return the directory in which wallpapers are stored, but unfortunately "/" is interpreted as an absolute path, so "/" is all that is returned. Contrast this with QString konq_dir = KGlobal::dirs()->findResource("data", "konqueror/"); Which obviously returns the correct result. Thus, it seems to me that the absolute path check should be eliminated. -Luke Sandell >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<