mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 08:40:53 +01:00
L'application active desormais l'editeur d'element adequat au lieu de permettre l'ouverture d'un meme element plusieurs fois en simultane.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@878 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -434,3 +434,25 @@ QString QET::pointerString(void *ptr) {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@param first Un premier chemin vers un fichier
|
||||
@param second Un second chemin vers un fichier
|
||||
@return true si les deux chemins existent existent et sont identiques
|
||||
lorsqu'ils sont exprimes sous forme canonique
|
||||
*/
|
||||
bool QET::compareCanonicalFilePaths(const QString &first, const QString &second) {
|
||||
QString first_canonical_path = QFileInfo(first).canonicalFilePath();
|
||||
if (first_canonical_path.isEmpty()) return(false);
|
||||
|
||||
QString second_canonical_path = QFileInfo(second).canonicalFilePath();
|
||||
if (second_canonical_path.isEmpty()) return(false);
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
// sous Windows, on ramene les chemins en minuscules
|
||||
first_canonical_path = first_canonical_path.toLower();
|
||||
second_canonical_path = second_canonical_path.toLower();
|
||||
#endif
|
||||
|
||||
return(first_canonical_path == second_canonical_path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user