Skip to content

Commit 5d8a673

Browse files
authored
Merge pull request #546 from ghutchis/only-debug-on-windows
Only output debugging bits on Windows (for Win10 launch issues)
2 parents 54d5689 + ec77c5e commit 5d8a673

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

avogadro/mainwindow.cpp

+21-2
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,16 @@ MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings)
273273

274274
QList<ExtensionPluginFactory*> extensions =
275275
plugin->pluginFactories<ExtensionPluginFactory>();
276+
#ifndef NDEBUG
276277
qDebug() << "Extension plugins dynamically found…" << extensions.size();
278+
#endif
277279
foreach (ExtensionPluginFactory* factory, extensions) {
278280
ExtensionPlugin* extension =
279281
factory->createInstance(QCoreApplication::instance());
280282
if (extension) {
283+
#ifdef Q_OS_WIN
281284
qDebug() << " loading extension plugin: " << extension->name();
285+
#endif
282286
extension->setParent(this);
283287
connect(this, &MainWindow::moleculeChanged, extension,
284288
&QtGui::ExtensionPlugin::setMolecule);
@@ -300,13 +304,19 @@ MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings)
300304
}
301305

302306
// Now set up the interface.
307+
#ifdef Q_OS_WIN
303308
qDebug() << " setting interface ";
309+
#endif
304310
setupInterface();
305311

306312
// Build up the standard menus, incorporate dynamic menus.
313+
#ifdef Q_OS_WIN
307314
qDebug() << " building menu ";
315+
#endif
308316
buildMenu();
317+
#ifdef Q_OS_WIN
309318
qDebug() << " updating recent files ";
319+
#endif
310320
updateRecentFiles();
311321

312322
// Try to open the file(s) passed in.
@@ -315,7 +325,9 @@ MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings)
315325
// Give the plugins 5 seconds before timing out queued files.
316326
QTimer::singleShot(5000, this, &MainWindow::clearQueuedFiles);
317327
} else {
328+
#ifdef Q_OS_WIN
318329
qDebug() << " creating new molecule ";
330+
#endif
319331
newMolecule();
320332
}
321333

@@ -900,7 +912,9 @@ bool MainWindow::addScript(const QString& filePath)
900912
}
901913

902914
QString destinationPath(stdPaths[i] + '/' + typePath + '/' + info.fileName());
915+
#ifndef NDEBUG
903916
qDebug() << " copying " << filePath << " to " << destinationPath;
917+
#endif
904918
QFile::remove(destinationPath); // silently fail if there's nothing to remove
905919
QFile::copy(filePath, destinationPath);
906920

@@ -2240,7 +2254,9 @@ void MainWindow::buildTools()
22402254

22412255
int index = 1;
22422256
foreach (ToolPlugin* toolPlugin, m_tools) {
2257+
#ifdef Q_OS_WIN
22432258
qDebug() << " adding tool " << toolPlugin->objectName();
2259+
#endif
22442260
// Add action to toolbar.
22452261
toolPlugin->setParent(this);
22462262
QAction* action = toolPlugin->activateAction();
@@ -2412,7 +2428,8 @@ void MainWindow::showAboutDialog()
24122428

24132429
void MainWindow::openURL(const QString& url)
24142430
{
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)
24162433
QDesktopServices::openUrl(url);
24172434
#else
24182435
// On Qt5, AppImage can't use QDesktopServices::openUrl, so we use QProcess:
@@ -2453,7 +2470,9 @@ void MainWindow::finishUpdateRequest(QNetworkReply* reply)
24532470
settings.value("currentVersion", AvogadroApp_VERSION).toString();
24542471
// could be something like 1.97.0-36-gcd224f0
24552472

2456-
// qDebug() << " update comparing " << lastVersion << " to " << latestRelease;
2473+
#ifndef NDEBUG
2474+
qDebug() << " update comparing " << lastVersion << " to " << latestRelease;
2475+
#endif
24572476
QStringList releaseComponents = latestRelease.split('.');
24582477
QStringList currentComponents = lastVersion.split('.');
24592478
if (releaseComponents.size() != 3 || currentComponents.size() != 3)

0 commit comments

Comments
 (0)