-
- // 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) {
- QUrl dirUrl(directory);
- QUrl upUrl = KIO::upUrl(dirUrl);
- int upUrlCounter = 1;
- while ((upUrlCounter < bestScore) && (upUrl != dirUrl)) {
- const QString fileName = dirUrl.path() + '/' + it.second;
- if (QFile::exists(fileName)) {
- if (upUrlCounter < bestScore) {
- bestPlugin = it.first;
- bestScore = upUrlCounter;
- }
- break;
- }
- dirUrl = upUrl;
- upUrl = KIO::upUrl(dirUrl);
- ++upUrlCounter;
- }