+
+ // Version control systems like Git provide the version information
+ // file only in the root directory. Check whether the version information file can
+ // be found in one of the parent directories. For performance reasons this
+ // step is only done, if the previous directory was marked as versioned by
+ // m_versionedDirectory. Drawback: Until e. g. Git is recognized, the root directory
+ // must be shown at least once.
+ if (m_versionedDirectory) {
+ KUrl upUrl = dirUrl.upUrl();
+ while (upUrl != dirUrl) {
+ const QString filePath = dirUrl.pathOrUrl(KUrl::AddTrailingSlash) + plugin->fileName();
+ QFileInfo file(filePath);
+ if (file.exists()) {
+ return plugin;
+ }
+ dirUrl = upUrl;
+ upUrl = dirUrl.upUrl();
+ }
+ }