Mercurial > hg > easyhg
comparison filestatuswidget.cpp @ 203:c77c4d00a4fe
Merge
author | Chris Cannam |
---|---|
date | Tue, 04 Jan 2011 14:31:30 +0000 |
parents | 3d4291d4226c 0844b4d8d911 |
children | c5fceb3fe5b4 |
comparison
equal
deleted
inserted
replaced
202:3d4291d4226c | 203:c77c4d00a4fe |
---|---|
153 void FileStatusWidget::openButtonClicked() | 153 void FileStatusWidget::openButtonClicked() |
154 { | 154 { |
155 QDir d(m_localPath); | 155 QDir d(m_localPath); |
156 if (d.exists()) { | 156 if (d.exists()) { |
157 QStringList args; | 157 QStringList args; |
158 args << d.canonicalPath(); | 158 QString path = d.canonicalPath(); |
159 #if defined Q_OS_WIN32 | |
160 // Although the Win32 API is quite happy to have | |
161 // forward slashes as directory separators, Windows | |
162 // Explorer is not | |
163 path = path.replace('/', '\\'); | |
164 args << path; | |
165 QProcess::execute("c:/windows/explorer.exe", args); | |
166 #else | |
167 args << path; | |
159 QProcess::execute( | 168 QProcess::execute( |
160 #if defined Q_OS_WIN32 | 169 #if defined Q_OS_MAC |
161 "c:/windows/explorer.exe", | |
162 #elif defined Q_OS_MAC | |
163 "/usr/bin/open", | 170 "/usr/bin/open", |
164 #else | 171 #else |
165 "/usr/bin/xdg-open", | 172 "/usr/bin/xdg-open", |
166 #endif | 173 #endif |
167 args); | 174 args); |
175 #endif | |
168 } | 176 } |
169 } | 177 } |
170 | 178 |
171 QString FileStatusWidget::labelFor(FileStates::State s, bool addHighlightExplanation) | 179 QString FileStatusWidget::labelFor(FileStates::State s, bool addHighlightExplanation) |
172 { | 180 { |