From 081295cb406f5284b8aae3ef0dcbcdad01241179 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 5 Nov 2015 10:05:22 -0800 Subject: Untangle Profile from MainWindow: files on command line There's no reason why this should be on the MainWindow widget. Signed-off-by: Dirk Hohndel --- profile-widget/profilewidget2.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'profile-widget') diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index a7105b8ca..6177f5b97 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -31,6 +31,9 @@ #include "mainwindow.h" #include "preferences/preferencesdialog.h" +// a couple of helpers we need +extern bool haveFilesOnCommandLine(); + /* This is the global 'Item position' variable. * it should tell you where to position things up * on the canvas. @@ -529,7 +532,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) // special handling for the first time we display things int animSpeedBackup = 0; - if (firstCall && MainWindow::instance()->filesFromCommandLine()) { + if (firstCall && haveFilesOnCommandLine()) { animSpeedBackup = prefs.animation_speed; prefs.animation_speed = 0; firstCall = false; @@ -673,7 +676,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) if (dcText.isEmpty()) dcText = tr("Unknown dive computer"); diveComputerText->setText(dcText); - if (MainWindow::instance()->filesFromCommandLine() && animSpeedBackup != 0) { + if (haveFilesOnCommandLine() && animSpeedBackup != 0) { prefs.animation_speed = animSpeedBackup; } -- cgit v1.2.3-70-g09d2