|
a/src/qtgui/rclmain_w.cpp |
|
b/src/qtgui/rclmain_w.cpp |
|
... |
|
... |
64 |
#include "fragbuts.h"
|
64 |
#include "fragbuts.h"
|
65 |
#include "systray.h"
|
65 |
#include "systray.h"
|
66 |
#include "rclmain_w.h"
|
66 |
#include "rclmain_w.h"
|
67 |
#include "rclhelp.h"
|
67 |
#include "rclhelp.h"
|
68 |
#include "moc_rclmain_w.cpp"
|
68 |
#include "moc_rclmain_w.cpp"
|
|
|
69 |
|
|
|
70 |
/* Qt5 moc expands macros when defining signals. The SIGNAL() macro is
|
|
|
71 |
a stringification, so it does not expand macros. We have signals
|
|
|
72 |
where one of the types is a #define (for the variations on
|
|
|
73 |
std::shared_ptr). In qt5, the connection does not work because the
|
|
|
74 |
signal string is different between the definition and the connect
|
|
|
75 |
call, because of the different macro expansion. We have to use
|
|
|
76 |
another level of macro in Qt5 to force macro expansion, but not in
|
|
|
77 |
Qt4, so we both define the XSIGNAL and XSLOT macros here, and have
|
|
|
78 |
ifdefs in the code. What a mess... */
|
|
|
79 |
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
|
|
80 |
#define XSIGNAL(X) SIGNAL(X)
|
|
|
81 |
#define XSLOT(X) SLOT(X)
|
|
|
82 |
#endif
|
69 |
|
83 |
|
70 |
using std::pair;
|
84 |
using std::pair;
|
71 |
|
85 |
|
72 |
QString g_stringAllStem, g_stringNoStem;
|
86 |
QString g_stringAllStem, g_stringNoStem;
|
73 |
|
87 |
|
|
... |
|
... |
286 |
connect(sc, SIGNAL (activated()), sSearch, SLOT (takeFocus()));
|
300 |
connect(sc, SIGNAL (activated()), sSearch, SLOT (takeFocus()));
|
287 |
QKeySequence seql("Ctrl+l");
|
301 |
QKeySequence seql("Ctrl+l");
|
288 |
sc = new QShortcut(seql, this);
|
302 |
sc = new QShortcut(seql, this);
|
289 |
connect(sc, SIGNAL (activated()), sSearch, SLOT (takeFocus()));
|
303 |
connect(sc, SIGNAL (activated()), sSearch, SLOT (takeFocus()));
|
290 |
|
304 |
|
291 |
connect(&m_watcher, SIGNAL(fileChanged(QString)),
|
305 |
connect(&m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(idxStatus()));
|
292 |
this, SLOT(idxStatus()));
|
306 |
|
293 |
#ifdef _WIN32
|
307 |
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
294 |
connect(sSearch, SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
|
308 |
connect(sSearch,
|
|
|
309 |
XSIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
295 |
this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
|
310 |
this, XSLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
|
296 |
#else
|
311 |
#else
|
|
|
312 |
connect(sSearch,
|
297 |
connect(sSearch, SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
313 |
SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
298 |
this, SLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
|
314 |
this, SLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
|
299 |
#endif
|
315 |
#endif
|
300 |
connect(sSearch, SIGNAL(clearSearch()),
|
316 |
connect(sSearch, SIGNAL(clearSearch()),
|
301 |
this, SLOT(resetSearch()));
|
317 |
this, SLOT(resetSearch()));
|
302 |
connect(preferencesMenu, SIGNAL(triggered(QAction*)),
|
318 |
connect(preferencesMenu, SIGNAL(triggered(QAction*)),
|
|
... |
|
... |
355 |
this, SLOT(periodic100()));
|
371 |
this, SLOT(periodic100()));
|
356 |
|
372 |
|
357 |
restable->setRclMain(this, true);
|
373 |
restable->setRclMain(this, true);
|
358 |
connect(actionSaveResultsAsCSV, SIGNAL(triggered()),
|
374 |
connect(actionSaveResultsAsCSV, SIGNAL(triggered()),
|
359 |
restable, SLOT(saveAsCSV()));
|
375 |
restable, SLOT(saveAsCSV()));
|
360 |
#ifdef _WIN32
|
376 |
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
361 |
connect(this, SIGNAL(docSourceChanged(std::shared_ptr<DocSequence>)),
|
377 |
connect(this, XSIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
362 |
restable, SLOT(setDocSource(std::shared_ptr<DocSequence>)));
|
378 |
restable, XSLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
363 |
#else
|
379 |
#else
|
364 |
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
380 |
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
365 |
restable, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
381 |
restable, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
366 |
#endif
|
382 |
#endif
|
367 |
|
383 |
|
|
... |
|
... |
391 |
this, SLOT(saveDocToFile(Rcl::Doc)));
|
407 |
this, SLOT(saveDocToFile(Rcl::Doc)));
|
392 |
connect(restable, SIGNAL(showSnippets(Rcl::Doc)),
|
408 |
connect(restable, SIGNAL(showSnippets(Rcl::Doc)),
|
393 |
this, SLOT(showSnippets(Rcl::Doc)));
|
409 |
this, SLOT(showSnippets(Rcl::Doc)));
|
394 |
|
410 |
|
395 |
reslist->setRclMain(this, true);
|
411 |
reslist->setRclMain(this, true);
|
396 |
#ifdef _WIN32
|
412 |
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
397 |
connect(this, SIGNAL(docSourceChanged(std::shared_ptr<DocSequence>)),
|
413 |
connect(this, XSIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
398 |
reslist, SLOT(setDocSource(std::shared_ptr<DocSequence>)));
|
414 |
reslist, XSLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
399 |
#else
|
415 |
#else
|
400 |
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
416 |
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
401 |
reslist, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
417 |
reslist, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
402 |
#endif
|
418 |
#endif
|
403 |
connect(firstPageAction, SIGNAL(triggered()),
|
419 |
connect(firstPageAction, SIGNAL(triggered()),
|