Mercurial > hg > easyhg
comparison hgrunner.cpp @ 210:c5fceb3fe5b4
* OS/X: Add script to run external diff; add space around tab widget; textual fixes
* Bail out of easyhg.py in uisetup rather than at extension load time if we can't load PyQt4 -- that way we find out about it in easyhg
* Ensure editing the default path works even if hgrc doesn't yet exist; ensure path and branch are reset (to empty and default) if their respective files are absent
author | Chris Cannam |
---|---|
date | Wed, 05 Jan 2011 14:31:07 +0000 |
parents | ff0d76dcb3b8 |
children | 90e70a9024f3 |
comparison
equal
deleted
inserted
replaced
209:0b040abb2aa3 | 210:c5fceb3fe5b4 |
---|---|
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 QString HgRunner::findExtension() | 66 QString HgRunner::findExtension() |
67 { | 67 { |
68 // If we haven't unbundled an extension, always do that (so that | 68 // Always unbundle the extension: even if it already exists (in |
69 // it's available in case someone wants to use it later, e.g. to | 69 // case we're upgrading) and even if we're not going to use it (so |
70 // fix a malfunctioning setup). But the path we actually prefer | 70 // that it's available in case someone wants to use it later, |
71 // is the one in the settings first, if it exists; then the | 71 // e.g. to fix a malfunctioning setup). But the path we actually |
72 // prefer is the one in the settings first, if it exists; then the | |
72 // unbundled one; then anything in the path if for some reason | 73 // unbundled one; then anything in the path if for some reason |
73 // unbundling failed | 74 // unbundling failed |
74 | 75 |
75 QSettings settings; | 76 QSettings settings; |
76 settings.beginGroup("Locations"); | 77 settings.beginGroup("Locations"); |
77 | 78 |
78 QString unbundled = getUnbundledFileName(); | 79 QString unbundled = unbundleExtension(); |
79 if (!QFile(unbundled).exists()) { | |
80 unbundled = unbundleExtension(); | |
81 } | |
82 | |
83 QString extpath = settings.value("extensionpath", "").toString(); | 80 QString extpath = settings.value("extensionpath", "").toString(); |
84 if (extpath != "" && QFile(extpath).exists()) return extpath; | 81 if (extpath != "" && QFile(extpath).exists()) return extpath; |
85 | 82 |
86 extpath = unbundled; | 83 extpath = unbundled; |
87 if (extpath == "") { | 84 if (extpath == "") { |