mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 00:30:53 +01:00
Rapatriement dans la branche 0.3 des revisions 870 a 903.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@904 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -446,3 +446,25 @@ qreal QET::correctAngle(const qreal &angle) {
|
||||
while (corrected_angle >= 360.0) corrected_angle -= 360.0;
|
||||
return(corrected_angle);
|
||||
}
|
||||
|
||||
/**
|
||||
@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