Changeset View
Changeset View
Standalone View
Standalone View
krusader/krslots.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | |||||
90 | 90 | | |||
91 | #ifdef SYNCHRONIZER_ENABLED | 91 | #ifdef SYNCHRONIZER_ENABLED | ||
92 | #include "Synchronizer/synchronizergui.h" | 92 | #include "Synchronizer/synchronizergui.h" | ||
93 | #endif | 93 | #endif | ||
94 | 94 | | |||
95 | 95 | | |||
96 | #define ACTIVE_VIEW _mainWindow->activeView() | 96 | #define ACTIVE_VIEW _mainWindow->activeView() | ||
97 | 97 | | |||
98 | static const QStringList kKioSupportCompareApps = {"kdiff3", "kompare"}; | ||||
pino: static please | |||||
99 | | ||||
98 | 100 | | |||
99 | KRslots::KRslots(QObject *parent) : QObject(parent), _mainWindow(krApp) | 101 | KRslots::KRslots(QObject *parent) : QObject(parent), _mainWindow(krApp) | ||
100 | { | 102 | { | ||
101 | } | 103 | } | ||
102 | 104 | | |||
103 | void KRslots::sendFileByEmail(const QList<QUrl> &urls) | 105 | void KRslots::sendFileByEmail(const QList<QUrl> &urls) | ||
104 | { | 106 | { | ||
105 | if (urls.count() == 0) { | 107 | if (urls.count() == 0) { | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 206 | { | |||
207 | if (lst.contains("DIFF")) diffProg = lst[lst.indexOf("DIFF") + 1]; | 209 | if (lst.contains("DIFF")) diffProg = lst[lst.indexOf("DIFF") + 1]; | ||
208 | else { | 210 | else { | ||
209 | KMessageBox::error(nullptr, i18n("Krusader cannot find any of the supported diff-frontends. Please install one to your path. Hint: Krusader supports Kompare, KDiff3 and Xxdiff.")); | 211 | KMessageBox::error(nullptr, i18n("Krusader cannot find any of the supported diff-frontends. Please install one to your path. Hint: Krusader supports Kompare, KDiff3 and Xxdiff.")); | ||
210 | return; | 212 | return; | ||
211 | } | 213 | } | ||
212 | 214 | | |||
213 | QString tmp1; | 215 | QString tmp1; | ||
214 | QString tmp2; | 216 | QString tmp2; | ||
215 | 217 | if (kKioSupportCompareApps.contains(QUrl::fromLocalFile(diffProg).fileName())) { | |||
216 | // kdiff3 sucks with spaces | | |||
217 | if (QUrl::fromLocalFile(diffProg).fileName() == "kdiff3" && !url1.toDisplayString().contains(" ") && !url2.toDisplayString().contains(" ")) { | | |||
218 | tmp1 = url1.toDisplayString(); | 218 | tmp1 = url1.toDisplayString(); | ||
219 | tmp2 = url2.toDisplayString(); | 219 | tmp2 = url2.toDisplayString(); | ||
why not QList::contains()? also, the checks for spaces in url1 and url2 are removed, which seems another unrelated change pino: why not QList::contains()?
also, the checks for spaces in url1 and url2 are removed, which… | |||||
eh, of course.
See the Git comment/Differential summary. It is not necessary anymore. abika: > why not QList::contains()?
eh, of course.
> also, the checks for spaces in url1 and url2… | |||||
220 | } else { | 220 | } else { | ||
221 | if (!url1.isLocalFile()) { | 221 | if (!url1.isLocalFile()) { | ||
222 | if (!downloadToTemp(url1, tmp1)) { | 222 | if (!downloadToTemp(url1, tmp1)) { | ||
223 | return; | 223 | return; | ||
224 | } | 224 | } | ||
225 | } else tmp1 = url1.path(); | 225 | } else tmp1 = url1.path(); | ||
226 | if (!url2.isLocalFile()) { | 226 | if (!url2.isLocalFile()) { | ||
227 | if (!downloadToTemp(url2, tmp2)) { | 227 | if (!downloadToTemp(url2, tmp2)) { | ||
228 | if (tmp1 != url1.path()) | 228 | if (tmp1 != url1.path()) { | ||
229 | QFile::remove(tmp1); | 229 | QFile::remove(tmp1); | ||
230 | } | ||||
230 | return; | 231 | return; | ||
pino: please avoid unrelated changes | |||||
Although this is unrelated, these are safe changes nearby which make the code a bit cleaner. -> "Boy Scout rule" abika: Although this is unrelated, these are safe changes nearby which make the code a bit cleaner. ->… | |||||
231 | } | 232 | } | ||
232 | } else tmp2 = url2.path(); | 233 | } else tmp2 = url2.path(); | ||
233 | } | 234 | } | ||
234 | 235 | | |||
235 | KrProcess *p = new KrProcess(tmp1 != url1.path() ? tmp1 : QString(), | 236 | KrProcess *p = new KrProcess(tmp1 != url1.path() ? tmp1 : QString(), | ||
236 | tmp2 != url2.path() ? tmp2 : QString()); | 237 | tmp2 != url2.path() ? tmp2 : QString()); | ||
237 | *p << diffProg << tmp1 << tmp2; | 238 | *p << diffProg << tmp1 << tmp2; | ||
238 | p->start(); | 239 | p->start(); | ||
239 | if (!p->waitForStarted()) | 240 | if (!p->waitForStarted()) { | ||
240 | KMessageBox::error(nullptr, i18n("Error executing %1.", diffProg)); | 241 | KMessageBox::error(nullptr, i18n("Error executing %1.", diffProg)); | ||
241 | } | 242 | } | ||
243 | } | ||||
pino: ditto | |||||
242 | 244 | | |||
243 | // GUI toggle slots | 245 | // GUI toggle slots | ||
244 | void KRslots::toggleFnkeys() | 246 | void KRslots::toggleFnkeys() | ||
245 | { | 247 | { | ||
246 | if (MAIN_VIEW->fnKeys()->isVisible()) | 248 | if (MAIN_VIEW->fnKeys()->isVisible()) | ||
247 | MAIN_VIEW->fnKeys()->hide(); | 249 | MAIN_VIEW->fnKeys()->hide(); | ||
248 | else MAIN_VIEW->fnKeys()->show(); | 250 | else MAIN_VIEW->fnKeys()->show(); | ||
249 | } | 251 | } | ||
▲ Show 20 Lines • Show All 499 Lines • Show Last 20 Lines |
static please