@@ -273,12 +273,16 @@ MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings)
273
273
274
274
QList<ExtensionPluginFactory*> extensions =
275
275
plugin->pluginFactories <ExtensionPluginFactory>();
276
+ #ifndef NDEBUG
276
277
qDebug () << " Extension plugins dynamically found…" << extensions.size ();
278
+ #endif
277
279
foreach (ExtensionPluginFactory* factory, extensions) {
278
280
ExtensionPlugin* extension =
279
281
factory->createInstance (QCoreApplication::instance ());
280
282
if (extension) {
283
+ #ifdef Q_OS_WIN
281
284
qDebug () << " loading extension plugin: " << extension->name ();
285
+ #endif
282
286
extension->setParent (this );
283
287
connect (this , &MainWindow::moleculeChanged, extension,
284
288
&QtGui::ExtensionPlugin::setMolecule);
@@ -300,13 +304,19 @@ MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings)
300
304
}
301
305
302
306
// Now set up the interface.
307
+ #ifdef Q_OS_WIN
303
308
qDebug () << " setting interface " ;
309
+ #endif
304
310
setupInterface ();
305
311
306
312
// Build up the standard menus, incorporate dynamic menus.
313
+ #ifdef Q_OS_WIN
307
314
qDebug () << " building menu " ;
315
+ #endif
308
316
buildMenu ();
317
+ #ifdef Q_OS_WIN
309
318
qDebug () << " updating recent files " ;
319
+ #endif
310
320
updateRecentFiles ();
311
321
312
322
// Try to open the file(s) passed in.
@@ -315,7 +325,9 @@ MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings)
315
325
// Give the plugins 5 seconds before timing out queued files.
316
326
QTimer::singleShot (5000 , this , &MainWindow::clearQueuedFiles);
317
327
} else {
328
+ #ifdef Q_OS_WIN
318
329
qDebug () << " creating new molecule " ;
330
+ #endif
319
331
newMolecule ();
320
332
}
321
333
@@ -900,7 +912,9 @@ bool MainWindow::addScript(const QString& filePath)
900
912
}
901
913
902
914
QString destinationPath (stdPaths[i] + ' /' + typePath + ' /' + info.fileName ());
915
+ #ifndef NDEBUG
903
916
qDebug () << " copying " << filePath << " to " << destinationPath;
917
+ #endif
904
918
QFile::remove (destinationPath); // silently fail if there's nothing to remove
905
919
QFile::copy (filePath, destinationPath);
906
920
@@ -2240,7 +2254,9 @@ void MainWindow::buildTools()
2240
2254
2241
2255
int index = 1 ;
2242
2256
foreach (ToolPlugin* toolPlugin, m_tools) {
2257
+ #ifdef Q_OS_WIN
2243
2258
qDebug () << " adding tool " << toolPlugin->objectName ();
2259
+ #endif
2244
2260
// Add action to toolbar.
2245
2261
toolPlugin->setParent (this );
2246
2262
QAction* action = toolPlugin->activateAction ();
@@ -2412,7 +2428,8 @@ void MainWindow::showAboutDialog()
2412
2428
2413
2429
void MainWindow::openURL (const QString& url)
2414
2430
{
2415
- #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) || defined(Q_OS_MAC) || defined(Q_OS_WIN)
2431
+ #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) || defined(Q_OS_MAC) || \
2432
+ defined (Q_OS_WIN)
2416
2433
QDesktopServices::openUrl (url);
2417
2434
#else
2418
2435
// On Qt5, AppImage can't use QDesktopServices::openUrl, so we use QProcess:
@@ -2453,7 +2470,9 @@ void MainWindow::finishUpdateRequest(QNetworkReply* reply)
2453
2470
settings.value (" currentVersion" , AvogadroApp_VERSION).toString ();
2454
2471
// could be something like 1.97.0-36-gcd224f0
2455
2472
2456
- // qDebug() << " update comparing " << lastVersion << " to " << latestRelease;
2473
+ #ifndef NDEBUG
2474
+ qDebug () << " update comparing " << lastVersion << " to " << latestRelease;
2475
+ #endif
2457
2476
QStringList releaseComponents = latestRelease.split (' .' );
2458
2477
QStringList currentComponents = lastVersion.split (' .' );
2459
2478
if (releaseComponents.size () != 3 || currentComponents.size () != 3 )
0 commit comments