diff --git a/qtsolutions/segmentcontrol/qtsegmentcontrol.cpp b/qtsolutions/segmentcontrol/qtsegmentcontrol.cpp index 20c50fa6c..fd9f74b45 100644 --- a/qtsolutions/segmentcontrol/qtsegmentcontrol.cpp +++ b/qtsolutions/segmentcontrol/qtsegmentcontrol.cpp @@ -1,10 +1,10 @@ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "qtsegmentcontrol.h" diff --git a/qtsolutions/segmentcontrol/qtsegmentcontrol.h b/qtsolutions/segmentcontrol/qtsegmentcontrol.h index 2d2107666..b3791f0fa 100644 --- a/qtsolutions/segmentcontrol/qtsegmentcontrol.h +++ b/qtsolutions/segmentcontrol/qtsegmentcontrol.h @@ -2,7 +2,7 @@ A whole bunch of stuff here. */ -#include +#include class QMenu; class QStyleOption; diff --git a/qtsolutions/soap/qtsoap.cpp b/qtsolutions/soap/qtsoap.cpp index eb7347f38..c33f0978b 100644 --- a/qtsolutions/soap/qtsoap.cpp +++ b/qtsolutions/soap/qtsoap.cpp @@ -3147,7 +3147,7 @@ void QtSoapHttpTransport::submitRequest(QtSoapMessage &request, const QString &p { QNetworkRequest networkReq; networkReq.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("text/xml;charset=utf-8")); - networkReq.setRawHeader("SOAPAction", soapAction.toAscii()); + networkReq.setRawHeader("SOAPAction", soapAction.toLatin1()); url.setPath(path); networkReq.setUrl(url); diff --git a/src/ANT.cpp b/src/ANT.cpp index 8a67fb1e0..85f3b221c 100644 --- a/src/ANT.cpp +++ b/src/ANT.cpp @@ -834,7 +834,7 @@ int ANT::openPort() // a USB1 stick so default to 4 channels channels = 4; - if ((devicePort=open(deviceFilename.toAscii(),O_RDWR | O_NOCTTY | O_NONBLOCK)) == -1) + if ((devicePort=open(deviceFilename.toLatin1(),O_RDWR | O_NOCTTY | O_NONBLOCK)) == -1) return errno; tcflush(devicePort, TCIOFLUSH); // clear out the garbage diff --git a/src/ANTlocalController.h b/src/ANTlocalController.h index ae98c12be..14e587e52 100644 --- a/src/ANTlocalController.h +++ b/src/ANTlocalController.h @@ -23,6 +23,8 @@ #include "ANTLogger.h" #include "ConfigDialog.h" +#include + // Abstract base class for Realtime device controllers #ifndef _GC_ANTlocalController_h diff --git a/src/AddDeviceWizard.h b/src/AddDeviceWizard.h index 2253d51df..c5b1021ba 100644 --- a/src/AddDeviceWizard.h +++ b/src/AddDeviceWizard.h @@ -36,7 +36,13 @@ #include "ANTChannel.h" #include "NullController.h" #include "Settings.h" + #include +#include +#include +#include +#include +#include class DeviceScanner; diff --git a/src/AddIntervalDialog.h b/src/AddIntervalDialog.h index eb3febf86..1289c73a2 100644 --- a/src/AddIntervalDialog.h +++ b/src/AddIntervalDialog.h @@ -21,6 +21,13 @@ #include "GoldenCheetah.h" #include +#include +#include +#include +#include +#include +#include +#include class Context; class RideFile; diff --git a/src/Aerolab.h b/src/Aerolab.h index 6a6c591f3..3cd690809 100644 --- a/src/Aerolab.h +++ b/src/Aerolab.h @@ -23,6 +23,11 @@ #include #include #include + +#include +#include +#include + #include "LTMWindow.h" // for tooltip/canvaspicker // forward references diff --git a/src/AerolabWindow.cpp b/src/AerolabWindow.cpp index ac55bc8d4..aaa695e2c 100644 --- a/src/AerolabWindow.cpp +++ b/src/AerolabWindow.cpp @@ -29,7 +29,6 @@ AerolabWindow::AerolabWindow(Context *context) : GcWindow(context), context(context) { - setInstanceName("Aerolab Window"); setControls(NULL); // Aerolab tab layout: diff --git a/src/AerolabWindow.h b/src/AerolabWindow.h index 452a4c575..40e42b6f6 100644 --- a/src/AerolabWindow.h +++ b/src/AerolabWindow.h @@ -21,6 +21,7 @@ #include "GoldenCheetah.h" #include +#include class Aerolab; class Context; diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index 40ad68a8e..0ae8524cb 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -43,6 +43,8 @@ #include #include +#include // for memcpy + class IntervalPlotData : public QwtSeriesData { public: @@ -245,8 +247,6 @@ AllPlot::AllPlot(AllPlotWindow *parent, Context *context): context(context), parent(parent) { - setInstanceName("AllPlot"); - referencePlot = NULL; if (appsettings->value(this, GC_SHADEZONES, true).toBool()==false) @@ -1420,7 +1420,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) tempCurve->setData(xaxis, smoothTE, stopidx-startidx); QVector tmpWND(stopidx-startidx); - qMemCopy( tmpWND.data(), smoothRS, (stopidx-startidx) * sizeof( QwtIntervalSample ) ); + memcpy(tmpWND.data(), smoothRS, (stopidx-startidx) * sizeof(QwtIntervalSample)); windCurve->setData(new QwtIntervalSeriesData(tmpWND)); torqueCurve->setData(xaxis, smoothNM, stopidx-startidx); balanceLCurve->setData(xaxis, smoothBALL, stopidx-startidx); diff --git a/src/AllPlot.h b/src/AllPlot.h index c732fc45c..87626c5c5 100644 --- a/src/AllPlot.h +++ b/src/AllPlot.h @@ -28,6 +28,10 @@ #include #include +#include +#include +#include + class QwtPlotCurve; class QwtPlotIntervalCurve; class QwtPlotGrid; diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index 62f2a462f..48bc2f039 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -45,7 +45,8 @@ // span slider specials #include -#include +#include +#include // tooltip #include "LTMWindow.h" @@ -56,8 +57,6 @@ AllPlotWindow::AllPlotWindow(Context *context) : GcChartWindow(context), current(NULL), context(context), active(false), stale(true), setupStack(false) { - setInstanceName("Ride Plot Window"); - QWidget *c = new QWidget; QVBoxLayout *clv = new QVBoxLayout(c); QHBoxLayout *cl = new QHBoxLayout; @@ -230,7 +229,6 @@ AllPlotWindow::AllPlotWindow(Context *context) : palette.setBrush(QPalette::Background, QBrush(GColor(CRIDEPLOTBACKGROUND))); allPlot = new AllPlot(this, context); - allPlot->setInstanceName("allPlot"); allPlot->setContentsMargins(0,0,0,0); //allPlot->axisWidget(QwtPlot::yLeft)->installEventFilter(this); @@ -355,14 +353,13 @@ AllPlotWindow::AllPlotWindow(Context *context) : // BUG in QMacStyle and painting of spanSlider // so we use a plain style to avoid it, but only // on a MAC, since win and linux are fine - QCleanlooksStyle *style = new QCleanlooksStyle(); + QStyle *style = QStyleFactory::create("fusion"); spanSlider->setStyle(style); scrollLeft->setStyle(style); scrollRight->setStyle(style); #endif fullPlot = new AllPlot(this, context); - fullPlot->setInstanceName("fullPlot"); fullPlot->grid->enableY(false); fullPlot->setFixedHeight(100); fullPlot->setCanvasBackground(GColor(CRIDEPLOTBACKGROUND)); @@ -1702,7 +1699,6 @@ AllPlotWindow::setupStackPlots() // create that plot AllPlot *_allPlot = new AllPlot(this, context); - _allPlot->setInstanceName("stackPlot"); _allPlot->setAutoFillBackground(false); _allPlot->setPalette(palette); diff --git a/src/AllPlotWindow.h b/src/AllPlotWindow.h index 59321145a..604a5010e 100644 --- a/src/AllPlotWindow.h +++ b/src/AllPlotWindow.h @@ -22,6 +22,9 @@ #include #include // for Q_PROPERTY +#include +#include +#include class AllPlot; class Context; diff --git a/src/Athlete.h b/src/Athlete.h index 370b50e0e..4383ed5be 100644 --- a/src/Athlete.h +++ b/src/Athlete.h @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/src/BatchExportDialog.h b/src/BatchExportDialog.h index 68a697ef9..b6349e2ab 100644 --- a/src/BatchExportDialog.h +++ b/src/BatchExportDialog.h @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/src/BestIntervalDialog.h b/src/BestIntervalDialog.h index 30eb4c66c..814d45822 100644 --- a/src/BestIntervalDialog.h +++ b/src/BestIntervalDialog.h @@ -21,6 +21,12 @@ #include "GoldenCheetah.h" #include +#include +#include +#include +#include +#include +#include class Context; class RideFile; diff --git a/src/BinRideFile.cpp b/src/BinRideFile.cpp index 7c36ab092..d8350d3fe 100644 --- a/src/BinRideFile.cpp +++ b/src/BinRideFile.cpp @@ -774,9 +774,9 @@ struct BinFileReaderState foreach(int num, set) { int record_type = unexpected_format_identifiers_for_record_types.keys(set).takeFirst(); errors << QString("unexpected format identifier \"%1\" (%2) in \"%3\" (%4)\n") - .arg(global_format_identifiers[num].toAscii().constData()) + .arg(global_format_identifiers[num].toLatin1().constData()) .arg(num) - .arg(global_record_types[record_type].toAscii().constData()) + .arg(global_record_types[record_type].toLatin1().constData()) .arg(record_type); } } diff --git a/src/BingMap.cpp b/src/BingMap.cpp index 0917119ac..af7869a15 100644 --- a/src/BingMap.cpp +++ b/src/BingMap.cpp @@ -33,7 +33,6 @@ BingMap::BingMap(Context *context) : GcWindow(context), context(context), range(-1), current(NULL) { - setInstanceName("Google Map"); setControls(NULL); setContentsMargins(0,0,0,0); layout = new QVBoxLayout(); diff --git a/src/BingMap.h b/src/BingMap.h index 07b0065e4..389f7e889 100644 --- a/src/BingMap.h +++ b/src/BingMap.h @@ -21,7 +21,9 @@ #include "GoldenCheetah.h" #include -#include +#include +#include +#include #include #include #include diff --git a/src/BlankState.h b/src/BlankState.h index 9d4e3f65e..9a28ed0fe 100644 --- a/src/BlankState.h +++ b/src/BlankState.h @@ -21,7 +21,10 @@ #include "GoldenCheetah.h" #include "Settings.h" + #include +#include +#include struct ShortCut { diff --git a/src/CalDAV.h b/src/CalDAV.h index 44bcadd50..975e07f2f 100644 --- a/src/CalDAV.h +++ b/src/CalDAV.h @@ -27,6 +27,9 @@ #include #include +// diag messages +#include + // set user and password #include #include "Context.h" diff --git a/src/CalendarDownload.h b/src/CalendarDownload.h index 9725fd5fd..91040c81c 100644 --- a/src/CalendarDownload.h +++ b/src/CalendarDownload.h @@ -23,6 +23,8 @@ #include #include #include +#include + #include "Context.h" #include "Settings.h" /* #include "CalendarParser.h" */ diff --git a/src/ChooseCyclistDialog.h b/src/ChooseCyclistDialog.h index 3184185a5..6ef272b81 100644 --- a/src/ChooseCyclistDialog.h +++ b/src/ChooseCyclistDialog.h @@ -22,6 +22,12 @@ #include #include +#include +#include +#include +#include +#include +#include class QListWidget; class QListWidgetItem; diff --git a/src/ComparePane.h b/src/ComparePane.h index adc7046b6..dd5901374 100644 --- a/src/ComparePane.h +++ b/src/ComparePane.h @@ -20,6 +20,9 @@ #define _GC_ComparePane_h 1 #include +#include +#include + #include "GcSideBarItem.h" class ComparePane : public QWidget diff --git a/src/Computrainer.cpp b/src/Computrainer.cpp index b261b469d..2d977d1af 100644 --- a/src/Computrainer.cpp +++ b/src/Computrainer.cpp @@ -809,7 +809,7 @@ int Computrainer::openPort() int ldisc=N_TTY; // LINUX #endif - if ((devicePort=open(deviceFilename.toAscii(),O_RDWR | O_NOCTTY | O_NONBLOCK)) == -1) return errno; + if ((devicePort=open(deviceFilename.toLatin1(),O_RDWR | O_NOCTTY | O_NONBLOCK)) == -1) return errno; tcflush(devicePort, TCIOFLUSH); // clear out the garbage diff --git a/src/ComputrainerController.cpp b/src/ComputrainerController.cpp index f087c07ef..9e8156faf 100644 --- a/src/ComputrainerController.cpp +++ b/src/ComputrainerController.cpp @@ -20,6 +20,8 @@ #include "Computrainer.h" #include "RealtimeData.h" +#include + ComputrainerController::ComputrainerController(TrainSidebar *parent, DeviceConfiguration *dc) : RealtimeController(parent, dc) { myComputrainer = new Computrainer (parent, dc ? dc->portSpec : ""); // we may get NULL passed when configuring diff --git a/src/ConfigDialog.h b/src/ConfigDialog.h index 309251de7..642593daf 100644 --- a/src/ConfigDialog.h +++ b/src/ConfigDialog.h @@ -22,6 +22,9 @@ #include #include +#include +#include + #include "Pages.h" #include "Context.h" diff --git a/src/CpintPlot.cpp b/src/CpintPlot.cpp index d97f5a591..de33c43ff 100644 --- a/src/CpintPlot.cpp +++ b/src/CpintPlot.cpp @@ -55,7 +55,6 @@ CpintPlot::CpintPlot(Context *context, QString p, const Zones *zones, bool range shadeMode(2), rangemode(rangemode) { - setInstanceName("CP Plot"); setAutoFillBackground(true); setAxisTitle(xBottom, tr("Interval Length")); diff --git a/src/CpintPlot.h b/src/CpintPlot.h index bb3ffe13b..9a37abe4e 100644 --- a/src/CpintPlot.h +++ b/src/CpintPlot.h @@ -27,7 +27,9 @@ #include #include #include + #include +#include class QwtPlotCurve; class QwtPlotGrid; diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index 10c438787..9b8790d68 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -44,8 +44,6 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, bool rangemode) : GcChartWindow(context), _dateRange("{00000000-0000-0000-0000-000000000001}"), home(home), context(context), currentRide(NULL), rangemode(rangemode), isfiltered(false), stale(true), useCustom(false), useToToday(false), active(false) { - setInstanceName("Critical Power Window"); - // // reveal controls widget // @@ -872,7 +870,7 @@ void CriticalPowerWindow::seasonSelected(int iSeason) { if (iSeason >= seasons->seasons.count() || iSeason < 0) return; Season season = seasons->seasons.at(iSeason); - _dateRange = season.id(); + //XXX BROKEM CODE IN 5.1 PORT // _dateRange = season.id(); cpintPlot->changeSeason(season.getStart(), season.getEnd()); cpintPlot->calculate(currentRide); } diff --git a/src/CriticalPowerWindow.h b/src/CriticalPowerWindow.h index 5ab644ebf..4376a5db2 100644 --- a/src/CriticalPowerWindow.h +++ b/src/CriticalPowerWindow.h @@ -20,14 +20,15 @@ #define _GC_CriticalPowerWindow_h 1 #include "GoldenCheetah.h" #include "MainWindow.h" // for isfiltered and filters - -#include #include "Season.h" #include "RideFile.h" #ifdef GC_HAVE_LUCENE #include "SearchFilterBox.h" #endif +#include +#include + class CpintPlot; class QwtPlotCurve; class Context; diff --git a/src/DBAccess.h b/src/DBAccess.h index 24ddc5f30..5f3580e31 100644 --- a/src/DBAccess.h +++ b/src/DBAccess.h @@ -25,6 +25,8 @@ #include #include #include +#include + #include "SummaryMetrics.h" #include "Context.h" #include "Season.h" diff --git a/src/DataFilter.cpp b/src/DataFilter.cpp index 9e9a58f13..8a7d8b3cf 100644 --- a/src/DataFilter.cpp +++ b/src/DataFilter.cpp @@ -18,7 +18,6 @@ #include "DataFilter.h" #include "Context.h" -#include "Context.h" #include "Athlete.h" #include "RideNavigator.h" #include "RideFileCache.h" diff --git a/src/DataProcessor.h b/src/DataProcessor.h index 9d16cd9b1..39fe8f440 100644 --- a/src/DataProcessor.h +++ b/src/DataProcessor.h @@ -23,10 +23,17 @@ #include "RideFile.h" #include "RideFileCommand.h" #include "RideItem.h" + +#include +#include +#include #include #include +#include #include #include +#include +#include #include #include @@ -46,9 +53,6 @@ // dataprocessor on the current ride and is called from the mainWindow menus // - -#include - // every data processor must supply a configuration Widget // when its processorConfig member is called class DataProcessorConfig : public QWidget diff --git a/src/DialWindow.cpp b/src/DialWindow.cpp index a743cf04a..2e7c5d94a 100644 --- a/src/DialWindow.cpp +++ b/src/DialWindow.cpp @@ -27,7 +27,6 @@ DialWindow::DialWindow(Context *context) : rolling.resize(150); // enough for 30 seconds at 5hz setContentsMargins(0,0,0,0); - setInstanceName("Dial"); QWidget *c = new QWidget; QVBoxLayout *cl = new QVBoxLayout(c); diff --git a/src/DialWindow.h b/src/DialWindow.h index 5ecb96d06..cedb219ce 100644 --- a/src/DialWindow.h +++ b/src/DialWindow.h @@ -22,7 +22,9 @@ #include #include // for Q_PROPERTY - +#include +#include +#include #include "Context.h" #include "Zones.h" // for data series types diff --git a/src/DiaryWindow.cpp b/src/DiaryWindow.cpp index f82166a89..ced913e85 100644 --- a/src/DiaryWindow.cpp +++ b/src/DiaryWindow.cpp @@ -25,7 +25,6 @@ DiaryWindow::DiaryWindow(Context *context) : GcWindow(context), context(context), active(false) { - setInstanceName("Diary Window"); setControls(NULL); // get config @@ -66,8 +65,8 @@ DiaryWindow::DiaryWindow(Context *context) : monthlyView = new QTableView(this); monthlyView->setItemDelegate(new GcCalendarDelegate); monthlyView->setModel(calendarModel); - monthlyView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); - monthlyView->verticalHeader()->setResizeMode(QHeaderView::Stretch); + monthlyView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + monthlyView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch); monthlyView->verticalHeader()->hide(); monthlyView->viewport()->installEventFilter(this); monthlyView->setGridStyle(Qt::DotLine); diff --git a/src/DownloadRideDialog.h b/src/DownloadRideDialog.h index ce76fad0b..e7c3a59c7 100644 --- a/src/DownloadRideDialog.h +++ b/src/DownloadRideDialog.h @@ -21,7 +21,12 @@ #include "GoldenCheetah.h" #include "CommPort.h" + #include +#include +#include +#include +#include class Context; diff --git a/src/ErgDB.h b/src/ErgDB.h index c4c167366..5f1c621b0 100644 --- a/src/ErgDB.h +++ b/src/ErgDB.h @@ -20,7 +20,6 @@ #define _Gc_ErgDB_h #include "GoldenCheetah.h" #include "ErgFile.h" -#include #include #include #include diff --git a/src/ErgFilePlot.cpp b/src/ErgFilePlot.cpp index e346ecf94..c86cc52c4 100644 --- a/src/ErgFilePlot.cpp +++ b/src/ErgFilePlot.cpp @@ -85,8 +85,6 @@ QPointF NowData::sample(size_t i) const ErgFilePlot::ErgFilePlot(Context *context) : context(context) { - setInstanceName("ErgFile Plot"); - //insertLegend(new QwtLegend(), QwtPlot::BottomLegend); setCanvasBackground(GColor(CRIDEPLOTBACKGROUND)); canvas()->setFrameStyle(QFrame::NoFrame); diff --git a/src/FitlogParser.cpp b/src/FitlogParser.cpp index c71c02e2f..094586ac7 100644 --- a/src/FitlogParser.cpp +++ b/src/FitlogParser.cpp @@ -102,7 +102,7 @@ FitlogParser::startElement( const QString&, const QString&, point.watts,point.alt,point.lon,point.lat, point.headwind, 0.0, RideFile::noTemp, 0.0, point.interval); } - return TRUE; + return true; } bool @@ -207,12 +207,12 @@ FitlogParser::endElement( const QString&, const QString&, const QString& qName) rideFile->setTag("Notes", buffer); } - return TRUE; + return true; } bool FitlogParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } static const double EARTH_RADIUS = 6378.140; // in km diff --git a/src/Fortius.h b/src/Fortius.h index 6ac17651a..1798fecf6 100644 --- a/src/Fortius.h +++ b/src/Fortius.h @@ -34,6 +34,7 @@ #include "GoldenCheetah.h" #include +#include #include #include #include diff --git a/src/FortiusController.h b/src/FortiusController.h index ab0bf30ec..4b84d8604 100644 --- a/src/FortiusController.h +++ b/src/FortiusController.h @@ -20,6 +20,8 @@ #include "RealtimeController.h" #include "Fortius.h" +#include + // Abstract base class for Realtime device controllers #ifndef _GC_FortiusController_h diff --git a/src/GcCalendarModel.h b/src/GcCalendarModel.h index 0c887bf42..6ffd84885 100644 --- a/src/GcCalendarModel.h +++ b/src/GcCalendarModel.h @@ -38,6 +38,9 @@ #include "MainWindow.h" #include +#include +#include +#include #include #include "qxtscheduleview.h" #include "Context.h" @@ -132,7 +135,7 @@ public slots: arr->append(j); dateToRows.insert(dateTime.date(), arr); } - reset(); + resetInternalData(); } diff --git a/src/GcCrashDialog.cpp b/src/GcCrashDialog.cpp index b5ad2bce5..e6d06146a 100644 --- a/src/GcCrashDialog.cpp +++ b/src/GcCrashDialog.cpp @@ -214,14 +214,6 @@ QString GcCrashDialog::versionHTML() clucene = _CL_VERSION; #endif - // -- LION SUPPORT ---- - #ifdef Q_OS_MAC - QString lionSupport = "no"; - #ifdef GC_HAVE_LION - lionSupport = "yes"; - #endif - #endif - #ifdef GC_HAVE_WFAPI QString wfapi = WFApi::getInstance()->apiVersion(); #else @@ -262,9 +254,6 @@ QString GcCrashDialog::versionHTML() "Wahoo API%12" "VLC%13" "LUCENE%14" - #ifdef Q_OS_MAC - "LION SUPPORT%15" - #endif "" ) .arg(QT_VERSION_STR) @@ -281,9 +270,6 @@ QString GcCrashDialog::versionHTML() .arg(wfapi) .arg(vlc) .arg(clucene) - #ifdef Q_OS_MAC - .arg(lionSupport) - #endif ; QString versionText = QString("
" + gc_version + lib_version + "
"); diff --git a/src/GcCrashDialog.h b/src/GcCrashDialog.h index da5f63ea0..fa83c751f 100644 --- a/src/GcCrashDialog.h +++ b/src/GcCrashDialog.h @@ -22,6 +22,7 @@ #include #include #include +#include class GcCrashDialog : public QDialog { diff --git a/src/GcPane.h b/src/GcPane.h index a9fa32a6b..4e55ed9bc 100644 --- a/src/GcPane.h +++ b/src/GcPane.h @@ -21,6 +21,11 @@ #include "GoldenCheetah.h" #include +#include +#include +#include +#include + #include "Colors.h" class GcPane : public QWidget diff --git a/src/GcScopeBar.h b/src/GcScopeBar.h index c68ce4ed1..965124684 100644 --- a/src/GcScopeBar.h +++ b/src/GcScopeBar.h @@ -22,6 +22,7 @@ #include #include #include +#include class Context; #ifdef Q_OS_MAC diff --git a/src/GcSideBarItem.h b/src/GcSideBarItem.h index 1e19bda8d..b384bdd3e 100644 --- a/src/GcSideBarItem.h +++ b/src/GcSideBarItem.h @@ -21,7 +21,11 @@ #include #include +#include +#include #include +#include +#include class GcSubSplitter; class GcSplitterControl; diff --git a/src/GcToolBar.h b/src/GcToolBar.h index eda31c245..fe7972db8 100644 --- a/src/GcToolBar.h +++ b/src/GcToolBar.h @@ -22,6 +22,8 @@ #include #include #include +#include +#include class GcToolBar : public QWidget { diff --git a/src/GcWindowLayout.h b/src/GcWindowLayout.h index 17e243f95..f1622b3fc 100644 --- a/src/GcWindowLayout.h +++ b/src/GcWindowLayout.h @@ -19,6 +19,7 @@ #ifndef _GC_GcWindowLayout_h #define _GC_GcWindowLayout_h +#include #include #include #include diff --git a/src/GcWindowRegistry.h b/src/GcWindowRegistry.h index 24ecf2f6f..61e1a4ad0 100644 --- a/src/GcWindowRegistry.h +++ b/src/GcWindowRegistry.h @@ -64,6 +64,7 @@ enum gcwinid { }; }; typedef enum GcWindowTypes::gcwinid GcWinID; +Q_DECLARE_METATYPE(GcWinID) // when declaring a window, what view is it relevant for? #define VIEW_TRAIN 0x01 diff --git a/src/GoldenCheetah.cpp b/src/GoldenCheetah.cpp index e0f5fa027..16ae8095a 100644 --- a/src/GoldenCheetah.cpp +++ b/src/GoldenCheetah.cpp @@ -21,13 +21,17 @@ #include "Context.h" #include "Colors.h" #include "Settings.h" + #include +#include #include #include #include #include #include +Q_DECLARE_METATYPE(QWidget*) + QWidget *GcWindow::controls() const { return _controls; @@ -45,6 +49,7 @@ void GcWindow::setControls(QWidget *x) } } +#if 0 QString GcWindow::instanceName() const { return _instanceName; @@ -54,6 +59,7 @@ void GcWindow::_setInstanceName(QString x) { _instanceName = x; } +#endif QString GcWindow::subtitle() const { @@ -166,7 +172,7 @@ GcWindow::GcWindow() setContentsMargins(0,0,0,0); setResizable(false); setMouseTracking(true); - setProperty("color", Qt::white); + setProperty("color", QColor(Qt::white)); setProperty("nomenu", false); // make sure its underneath the toggle button @@ -203,7 +209,7 @@ GcWindow::GcWindow(Context *context) : QFrame(context->mainWindow), dragState(No setContentsMargins(0,0,0,0); setResizable(false); setMouseTracking(true); - setProperty("color", Qt::white); + setProperty("color", QColor(Qt::white)); setProperty("nomenu", false); // make sure its underneath the toggle button diff --git a/src/GoldenCheetah.h b/src/GoldenCheetah.h index caa0aae4a..6aba97d98 100644 --- a/src/GoldenCheetah.h +++ b/src/GoldenCheetah.h @@ -18,13 +18,12 @@ #ifndef _GC_GoldenCheetah_h #define _GC_GoldenCheetah_h -#include "TimeUtils.h" -class RideItem; class GcWindow; class Context; -#define G_OBJECT Q_PROPERTY(QString instanceName READ instanceName WRITE setInstanceName) -#define setInstanceName(x) setProperty("instanceName", x) +#define G_OBJECT +//#define G_OBJECT Q_PROPERTY(QString instanceName READ instanceName WRITE setInstanceName) +//#define setInstanceName(x) setProperty("instanceName", x) #define myRideItem property("ride").value() #define myDateRange property("dateRange").value() @@ -33,6 +32,7 @@ class Context; #include #include #include +#include #include #include #include @@ -41,11 +41,9 @@ class Context; #include #include "GcWindowRegistry.h" +#include "TimeUtils.h" -Q_DECLARE_METATYPE(QWidget*) -Q_DECLARE_METATYPE(RideItem*) -Q_DECLARE_METATYPE(GcWinID) -Q_DECLARE_METATYPE(DateRange) +class RideItem; class GcWindow : public QFrame @@ -58,7 +56,7 @@ private: // each window has an instance name - default set // by the widget constructor but overide from layou manager - Q_PROPERTY(QString instanceName READ instanceName WRITE _setInstanceName USER true) + //Q_PROPERTY(QString instanceName READ instanceName WRITE _setInstanceName USER true) // controls are updated by widget when it is constructed Q_PROPERTY(QWidget* controls READ controls WRITE setControls NOTIFY controlsChanged) @@ -87,7 +85,7 @@ private: QString _title; QString _subtitle; - QString _instanceName; + //QString _instanceName; RideItem *_rideItem; GcWinID _type; DateRange _dr; @@ -128,8 +126,8 @@ public: ~GcWindow(); GcWindow(Context *context); - void _setInstanceName(QString x); // GOBJECTS can set their instance name, but not be GcWindows - QString instanceName() const; + //void _setInstanceName(QString x); // GOBJECTS can set their instance name, but not be GcWindows + //QString instanceName() const; void setControls(QWidget *x); QWidget *controls() const; diff --git a/src/GoogleMapControl.cpp b/src/GoogleMapControl.cpp index 9c74c76c0..478f60f04 100644 --- a/src/GoogleMapControl.cpp +++ b/src/GoogleMapControl.cpp @@ -35,7 +35,6 @@ GoogleMapControl::GoogleMapControl(Context *context) : GcChartWindow(context), context(context), range(-1), current(NULL) { - setInstanceName("Google Map"); setControls(NULL); setContentsMargins(0,0,0,0); layout = new QVBoxLayout(); diff --git a/src/GoogleMapControl.h b/src/GoogleMapControl.h index 6490c0fa8..5626cc293 100644 --- a/src/GoogleMapControl.h +++ b/src/GoogleMapControl.h @@ -22,6 +22,11 @@ #include #include +#include +#include +#include +#include + #include #include #include diff --git a/src/GpxParser.cpp b/src/GpxParser.cpp index b7ae6924c..7b88ccdff 100644 --- a/src/GpxParser.cpp +++ b/src/GpxParser.cpp @@ -87,7 +87,7 @@ bool GpxParser::startElement( const QString&, const QString&, lon = lastLon; } } - return TRUE; + return true; } #define PI 3.14159265 @@ -153,7 +153,7 @@ bool last_time = time; lastLon = lon; lastLat = lat; - return TRUE; + return true; } // we need to figure out the distance by using the lon,lat // using teh haversine formula @@ -254,11 +254,11 @@ bool lastLat = lat; } - return TRUE; + return true; } bool GpxParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } diff --git a/src/HelpWindow.cpp b/src/HelpWindow.cpp index 629c52267..7d7e2cb04 100644 --- a/src/HelpWindow.cpp +++ b/src/HelpWindow.cpp @@ -24,7 +24,6 @@ HelpWindow::HelpWindow(Context *context) : QDialog(context->mainWindow) setWindowTitle("Help"); setAttribute(Qt::WA_DeleteOnClose); setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint | Qt::Tool); - setInstanceName("Help Window"); view = new QWebView(); layout = new QVBoxLayout(); diff --git a/src/HelpWindow.h b/src/HelpWindow.h index a0c7b4492..59681eda2 100644 --- a/src/HelpWindow.h +++ b/src/HelpWindow.h @@ -21,7 +21,10 @@ #include "GoldenCheetah.h" #include +#include #include +#include + #include "Context.h" class HelpWindow : public QDialog diff --git a/src/HistogramWindow.cpp b/src/HistogramWindow.cpp index c3c98b7c1..5782c041e 100644 --- a/src/HistogramWindow.cpp +++ b/src/HistogramWindow.cpp @@ -41,8 +41,6 @@ static const int cadDigits = 0; // HistogramWindow::HistogramWindow(Context *context, bool rangemode) : GcChartWindow(context), context(context), stale(true), source(NULL), active(false), bactive(false), rangemode(rangemode), useCustom(false), useToToday(false), precision(99) { - setInstanceName("Histogram Window"); - QWidget *c = new QWidget; c->setContentsMargins(0,0,0,0); QFormLayout *cl = new QFormLayout(c); diff --git a/src/HistogramWindow.h b/src/HistogramWindow.h index 40ad8434e..253496576 100644 --- a/src/HistogramWindow.h +++ b/src/HistogramWindow.h @@ -32,8 +32,6 @@ #include "RideFileCache.h" #include "RideItem.h" #include "Settings.h" -#include -#include #include "Zones.h" #include "HrZones.h" @@ -47,6 +45,11 @@ #endif #include +#include +#include +#include + +#include class Context; class PowerHist; diff --git a/src/HomeWindow.cpp b/src/HomeWindow.cpp index c20d7bd18..6d20aed49 100644 --- a/src/HomeWindow.cpp +++ b/src/HomeWindow.cpp @@ -33,8 +33,6 @@ HomeWindow::HomeWindow(Context *context, QString name, QString /* windowtitle */ GcWindow(context), context(context), name(name), active(false), clicked(NULL), dropPending(false), chartCursor(-2), loaded(false) { - setInstanceName("Home Window"); - // setup control area QWidget *cw = new QWidget(this); cw->setContentsMargins(0,0,0,0); @@ -428,9 +426,11 @@ HomeWindow::dragEnterEvent(QDragEnterEvent *event) void HomeWindow::appendChart(GcWinID id) { + GcWindow *newone = NULL; + // GcWindowDialog is delete on close, so no need to delete - GcWindowDialog *f = new GcWindowDialog(id, context); - GcWindow *newone = f->exec(); + GcWindowDialog *f = new GcWindowDialog(id, context, &newone); + f->exec(); // returns null if cancelled or closed if (newone) { @@ -1014,7 +1014,7 @@ HomeWindow::drawCursor() } } -GcWindowDialog::GcWindowDialog(GcWinID type, Context *context) : context(context), type(type) +GcWindowDialog::GcWindowDialog(GcWinID type, Context *context, GcWindow **here) : context(context), type(type), here(here) { //setAttribute(Qt::WA_DeleteOnClose); setWindowFlags(windowFlags()); @@ -1081,12 +1081,16 @@ void GcWindowDialog::okClicked() void GcWindowDialog::cancelClicked() { reject(); } -GcWindow * +int GcWindowDialog::exec() { if (QDialog::exec()) { - return win; - } else return NULL; + + *here = win; + } else { + *here = NULL; + } + return 0; } /*---------------------------------------------------------------------- @@ -1225,7 +1229,7 @@ HomeWindow::restoreState(bool useDefault) // bool ViewParser::startDocument() { - return TRUE; + return true; } bool ViewParser::endElement( const QString&, const QString&, const QString &qName ) @@ -1233,7 +1237,7 @@ bool ViewParser::endElement( const QString&, const QString&, const QString &qNam if (qName == "chart") { // add to the list charts.append(chart); } - return TRUE; + return true; } bool ViewParser::startElement( const QString&, const QString&, const QString &name, const QXmlAttributes &attrs ) @@ -1262,7 +1266,6 @@ bool ViewParser::startElement( const QString&, const QString&, const QString &na chart = GcWindowRegistry::newGcWindow(type, context); chart->hide(); chart->setProperty("title", QVariant(title)); - chart->setProperty("instanceName", QVariant(name)); } else if (name == "property") { @@ -1294,18 +1297,18 @@ bool ViewParser::startElement( const QString&, const QString&, const QString &na } } - return TRUE; + return true; } bool ViewParser::characters( const QString&) { - return TRUE; + return true; } bool ViewParser::endDocument() { - return TRUE; + return true; } void HomeWindow::closeWindow(GcWindow*thisone) diff --git a/src/HomeWindow.h b/src/HomeWindow.h index 621b271cc..9f1d61019 100644 --- a/src/HomeWindow.h +++ b/src/HomeWindow.h @@ -24,8 +24,17 @@ #include "GcWindowLayout.h" #include +#include +#include #include +#include +#include +#include +#include +#include + #include "Context.h" +#include "RideItem.h" #ifdef Q_OS_MAC #include "QtMacSegmentedButton.h" @@ -136,8 +145,8 @@ class GcWindowDialog : public QDialog Q_OBJECT public: - GcWindowDialog(GcWinID, Context *); - GcWindow *exec(); // return pointer to window, or NULL if cancelled + GcWindowDialog(GcWinID, Context *, GcWindow **); + int exec(); // return pointer to window, or NULL if cancelled public slots: void okClicked(); @@ -146,6 +155,7 @@ class GcWindowDialog : public QDialog protected: Context *context; GcWinID type; + GcWindow **here; // we remove from the layout at the end QHBoxLayout *layout; diff --git a/src/HrPwWindow.cpp b/src/HrPwWindow.cpp index 375854705..e79d1c04f 100644 --- a/src/HrPwWindow.cpp +++ b/src/HrPwWindow.cpp @@ -34,7 +34,6 @@ HrPwWindow::HrPwWindow(Context *context) : GcChartWindow(context), context(context), current(NULL) { setControls(NULL); - setInstanceName("HrPw"); // // reveal controls widget diff --git a/src/HrPwWindow.h b/src/HrPwWindow.h index 048bec19d..306cd3305 100644 --- a/src/HrPwWindow.h +++ b/src/HrPwWindow.h @@ -20,8 +20,10 @@ #define _GC_HrPwWindow_h 1 #include -#include "GoldenCheetah.h" +#include +#include "GoldenCheetah.h" +#include "LTMWindow.h" // for tooltip/canvaspicker class QCheckBox; class QLineEdit; @@ -31,7 +33,6 @@ class Context; class SmallPlot; class QSlider; -#include "LTMWindow.h" // for tooltip/canvaspicker class HrPwWindow : public GcChartWindow diff --git a/src/HrZones.cpp b/src/HrZones.cpp index 1d569f3e4..31a8eb81b 100644 --- a/src/HrZones.cpp +++ b/src/HrZones.cpp @@ -224,15 +224,15 @@ bool HrZones::read(QFile &file) // set up the range, capturing LT if it's specified // range = new ZoneRange(begin, end); int nLT = (r ? 11 : 7); - if (rangerx[r].numCaptures() >= (nLT)) lt = rangerx[r].cap(nLT).toInt(); + if (rangerx[r].captureCount() >= (nLT)) lt = rangerx[r].cap(nLT).toInt(); else lt = 0; int nRestHr = (r ? 14 : 10); - if (rangerx[r].numCaptures() >= (nRestHr)) restHr = rangerx[r].cap(nRestHr).toInt(); + if (rangerx[r].captureCount() >= (nRestHr)) restHr = rangerx[r].cap(nRestHr).toInt(); else restHr = 0; int nMaxHr = (r ? 17 : 13); - if (rangerx[r].numCaptures() >= (nRestHr)) maxHr = rangerx[r].cap(nMaxHr).toInt(); + if (rangerx[r].captureCount() >= (nRestHr)) maxHr = rangerx[r].cap(nMaxHr).toInt(); else maxHr = 0; // bleck diff --git a/src/IntervalItem.h b/src/IntervalItem.h index 6d42fa2b2..0a9681bec 100644 --- a/src/IntervalItem.h +++ b/src/IntervalItem.h @@ -21,6 +21,10 @@ #include "GoldenCheetah.h" #include +#include +#include +#include +#include class RideFile; diff --git a/src/IntervalSummaryWindow.h b/src/IntervalSummaryWindow.h index e21176a47..668f2660a 100644 --- a/src/IntervalSummaryWindow.h +++ b/src/IntervalSummaryWindow.h @@ -20,6 +20,7 @@ #define INTERVALSUMMARYWINDOW_H_ #include +#include class Context; class IntervalItem; diff --git a/src/IntervalTreeView.h b/src/IntervalTreeView.h index db511c2ed..7f2c51af6 100644 --- a/src/IntervalTreeView.h +++ b/src/IntervalTreeView.h @@ -21,6 +21,7 @@ #include "GoldenCheetah.h" #include +#include class Context; diff --git a/src/JouleDevice.cpp b/src/JouleDevice.cpp index 1a5c8bd77..ea6ef8536 100644 --- a/src/JouleDevice.cpp +++ b/src/JouleDevice.cpp @@ -542,14 +542,14 @@ bool JoulePacket::write(CommPortPtr dev, QString &err) { QByteArray bytes = dataArrayForUnit(); - const char *msg = cEscape(bytes.data(), bytes.count()).toAscii().constData(); + const char *msg = cEscape(bytes.data(), bytes.count()).toLatin1().constData(); if (JOULE_DEBUG) printf("writing '%s' to device\n", msg); int n = dev->write(bytes.data(), bytes.count() , err); // if (n != bytes.count()) { if (n < 0) { - if (JOULE_DEBUG) printf("failed to write %s to device: %s\n", msg, err.toAscii().constData()); + if (JOULE_DEBUG) printf("failed to write %s to device: %s\n", msg, err.toLatin1().constData()); err = QString(tr("failed to write to device: %1")).arg(err); } else { diff --git a/src/JsonRideFile.y b/src/JsonRideFile.y index 6fbf2718d..5041fb94e 100644 --- a/src/JsonRideFile.y +++ b/src/JsonRideFile.y @@ -84,7 +84,7 @@ static QString protect(const QString string) // Un-Escape special characters (JSON compliance) static QString unprotect(const QString string) { - QString string2 = QString::fromLocal8Bit(string.toAscii().data()); + QString string2 = QString::fromLocal8Bit(string.toLatin1().data()); // this is a lexer string so it will be enclosed // in quotes. Lets strip those first diff --git a/src/LTMChartParser.cpp b/src/LTMChartParser.cpp index eff58ba24..fbebc1bf5 100644 --- a/src/LTMChartParser.cpp +++ b/src/LTMChartParser.cpp @@ -98,7 +98,7 @@ static QwtSymbol::Style intToSymbol(int x) bool LTMChartParser::startDocument() { buffer.clear(); - return TRUE; + return true; } static QString unprotect(QString buffer) @@ -167,7 +167,7 @@ bool LTMChartParser::endElement( const QString&, const QString&, const QString & settings.append(setting); else if (qName == "charts") { // block top-level } // do nothing for now - return TRUE; + return true; } bool LTMChartParser::startElement( const QString&, const QString&, const QString &name, const QXmlAttributes &attrs ) @@ -189,13 +189,13 @@ bool LTMChartParser::startElement( const QString&, const QString&, const QString } } - return TRUE; + return true; } bool LTMChartParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } QList @@ -206,7 +206,7 @@ LTMChartParser::getSettings() bool LTMChartParser::endDocument() { - return TRUE; + return true; } // static helper to protect special xml characters diff --git a/src/LTMChartParser.h b/src/LTMChartParser.h index 5ec32f688..0b349708d 100644 --- a/src/LTMChartParser.h +++ b/src/LTMChartParser.h @@ -21,6 +21,8 @@ #include "GoldenCheetah.h" #include +#include + #include "LTMSettings.h" #include "LTMTool.h" diff --git a/src/LTMPlot.cpp b/src/LTMPlot.cpp index bdb51b521..f467a2ff1 100644 --- a/src/LTMPlot.cpp +++ b/src/LTMPlot.cpp @@ -47,8 +47,6 @@ static int supported_axes[] = { QwtPlot::yLeft, QwtPlot::yRight, QwtPlot::yLeft1 LTMPlot::LTMPlot(LTMWindow *parent, Context *context) : bg(NULL), parent(parent), context(context), highlighter(NULL) { - setInstanceName("Metric Plot"); - // get application settings insertLegend(new QwtLegend(), QwtPlot::BottomLegend); setAxisTitle(yLeft, tr("")); diff --git a/src/LTMPopup.cpp b/src/LTMPopup.cpp index 13e923f96..0d93e8b6a 100644 --- a/src/LTMPopup.cpp +++ b/src/LTMPopup.cpp @@ -50,7 +50,7 @@ LTMPopup::LTMPopup(Context *context) : QWidget(context->mainWindow), context(con // ride list... rides = new QTableWidget(this); #ifdef Q_OS_LINUX // QT 4.7 bug on Linux, selection-background-color is ignored (no transparency) - QWindowsStyle *style = new QWindowsStyle(); + QStyle *style = QStyleFactory::create("fusion"); rides->setStyle(style); #endif rides->setFrameStyle(QFrame::NoFrame); diff --git a/src/LTMPopup.h b/src/LTMPopup.h index 39d1d299e..750e4c553 100644 --- a/src/LTMPopup.h +++ b/src/LTMPopup.h @@ -26,8 +26,16 @@ #include "MetricAggregator.h" #include "RideMetric.h" -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include class LTMPopup : public QWidget { diff --git a/src/LTMSettings.h b/src/LTMSettings.h index 49fd343f2..a5f73c759 100644 --- a/src/LTMSettings.h +++ b/src/LTMSettings.h @@ -22,7 +22,9 @@ #include #include +#include #include +#include #include #include diff --git a/src/LTMSidebar.cpp b/src/LTMSidebar.cpp index 75e33b4ec..f9cd3c0dd 100644 --- a/src/LTMSidebar.cpp +++ b/src/LTMSidebar.cpp @@ -22,9 +22,11 @@ #include "Athlete.h" #include "Settings.h" #include "Units.h" + #include #include #include +#include #include // seasons support diff --git a/src/LTMTool.h b/src/LTMTool.h index c6f031174..6204f9ee7 100644 --- a/src/LTMTool.h +++ b/src/LTMTool.h @@ -30,7 +30,15 @@ #endif #include +#include #include +#include +#include +#include +#include +#include +#include +#include // tree widget types #define ROOT_TYPE 1 diff --git a/src/LTMWindow.cpp b/src/LTMWindow.cpp index 6c1f92282..68b9994a5 100644 --- a/src/LTMWindow.cpp +++ b/src/LTMWindow.cpp @@ -41,7 +41,6 @@ LTMWindow::LTMWindow(Context *context) : GcChartWindow(context), context(context), dirty(true) { - setInstanceName("Metric Window"); useToToday = useCustom = false; plotted = DateRange(QDate(01,01,01), QDate(01,01,01)); diff --git a/src/Library.h b/src/Library.h index 317eab24b..2ea1d92cd 100644 --- a/src/Library.h +++ b/src/Library.h @@ -19,9 +19,11 @@ #ifndef _Library_h #define _Library_h #include "GoldenCheetah.h" + #include #include #include +#include #include #include #include diff --git a/src/LibraryParser.cpp b/src/LibraryParser.cpp index 08a53095b..7a26afb67 100644 --- a/src/LibraryParser.cpp +++ b/src/LibraryParser.cpp @@ -28,7 +28,7 @@ static inline QString unquote(QString quoted) bool LibraryParser::startDocument() { buffer.clear(); - return TRUE; + return true; } bool LibraryParser::endElement( const QString&, const QString&, const QString &qName ) @@ -45,7 +45,7 @@ bool LibraryParser::endElement( const QString&, const QString&, const QString &q if (qName == "ref") { library->refs.append(buffer.trimmed()); } - return TRUE; + return true; } bool LibraryParser::startElement( const QString&, const QString&, const QString &name, const QXmlAttributes &attrs) @@ -59,13 +59,13 @@ bool LibraryParser::startElement( const QString&, const QString&, const QString } } - return TRUE; + return true; } bool LibraryParser::characters(const QString& str) { buffer += str; - return TRUE; + return true; } bool diff --git a/src/MacroDevice.cpp b/src/MacroDevice.cpp index 8f7d7c6f5..9d0a512bd 100644 --- a/src/MacroDevice.cpp +++ b/src/MacroDevice.cpp @@ -352,14 +352,14 @@ MacroPacket::data() bool MacroPacket::write(CommPortPtr dev, QString &err) { - const char *msg = cEscape(data(), payload.count()+2).toAscii().constData(); + const char *msg = cEscape(data(), payload.count()+2).toLatin1().constData(); if (MACRO_DEBUG) printf("writing '%s' to device\n", msg); int n = dev->write(data(), payload.count()+2, err); if (n != payload.count()+2) { if (n < 0) { - if (MACRO_DEBUG) printf("failed to write %s to device: %s\n", msg, err.toAscii().constData()); + if (MACRO_DEBUG) printf("failed to write %s to device: %s\n", msg, err.toLatin1().constData()); err = QString(tr("failed to write to device: %1")).arg(err); } else { @@ -385,7 +385,7 @@ MacroPacket::read(CommPortPtr dev, int len, QString &err) } checksum += command; len--; - if (MACRO_DEBUG) printf("command %s\n" ,cEscape(&command,n).toAscii().constData()); + if (MACRO_DEBUG) printf("command %s\n" ,cEscape(&command,n).toLatin1().constData()); } if (MACRO_DEBUG) printf("reading %d from device\n", len); @@ -401,7 +401,7 @@ MacroPacket::read(CommPortPtr dev, int len, QString &err) return false; } - if (MACRO_DEBUG) printf("payload %s\n" ,cEscape(buf,n).toAscii().constData()); + if (MACRO_DEBUG) printf("payload %s\n" ,cEscape(buf,n).toLatin1().constData()); addToPayload(buf,n); return true; diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 54815630b..92455ed80 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -21,7 +21,11 @@ #include #include #include +#include #include +#include +#include +#include // DATA STRUCTURES #include "MainWindow.h" @@ -75,11 +79,7 @@ #include "HomeWindow.h" #include "GcScopeBar.h" #ifdef Q_OS_MAC -#ifdef GC_HAVE_LION -#include "LionFullScreen.h" // mac and lion or later -#endif #include "QtMacButton.h" // mac -#include "QtMacPopUpButton.h" // mac #include "QtMacSegmentedButton.h" // mac #else #include "QTFullScreen.h" // not mac! @@ -111,7 +111,6 @@ MainWindow::MainWindow(const QDir &home) context = new Context(this); context->athlete = new Athlete(context, home); - setInstanceName(context->athlete->cyclist); setWindowIcon(QIcon(":images/gc.png")); setWindowTitle(context->athlete->home.dirName()); setContentsMargins(0,0,0,0); @@ -143,9 +142,6 @@ MainWindow::MainWindow(const QDir &home) static const QIcon tileIcon(":images/toolbar/main/tile.png"); static const QIcon fullIcon(":images/toolbar/main/togglefull.png"); -#if (defined Q_OS_MAC) && (defined GC_HAVE_LION) - fullScreen = new LionFullScreen(context); -#endif #ifndef Q_OS_MAC fullScreen = new QTFullScreen(context); #endif @@ -302,7 +298,7 @@ MainWindow::MainWindow(const QDir &home) #ifdef GC_HAVE_LUCENE SearchFilterBox *searchBox = new SearchFilterBox(this,context,false); - QCleanlooksStyle *toolStyle = new QCleanlooksStyle(); + QStyle *toolStyle = QStyleFactory::create("fusion"); searchBox->setStyle(toolStyle); searchBox->setFixedWidth(200); head->addWidget(searchBox); @@ -319,7 +315,7 @@ MainWindow::MainWindow(const QDir &home) head = new GcToolBar(this); - QCleanlooksStyle *toolStyle = new QCleanlooksStyle(); + QStyle *toolStyle = QStyleFactory::create("fusion"); QPalette metal; metal.setColor(QPalette::Button, QColor(215,215,215)); @@ -437,7 +433,7 @@ MainWindow::MainWindow(const QDir &home) // Add chart is on the scope bar chartMenu = new QMenu(this); - QCleanlooksStyle *styler = new QCleanlooksStyle(); + QStyle *styler = QStyleFactory::create("fusion"); QPushButton *newchart = new QPushButton("+", this); scopebar->addWidget(newchart); newchart->setStyle(styler); diff --git a/src/MainWindow.h b/src/MainWindow.h index 7b04110a8..6ca09dcc5 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -23,6 +23,7 @@ #include #include #include +#include #include "RideItem.h" #include "TimeUtils.h" @@ -31,7 +32,6 @@ #include #endif -class LionFullScreen; class QTFullScreen; class QtMacSegmentedButton; class QtMacButton; @@ -44,6 +44,7 @@ class SaveSingleDialogWidget; class MainWindow; class Athlete; class Context; +class Tab; extern QList mainwindows; // keep track of all the MainWindows we have open extern QDesktopWidget *desktop; // how many screens / res etc @@ -170,9 +171,6 @@ class MainWindow : public QMainWindow GcScopeBar *scopebar; Tab *tab; -#if (defined Q_OS_MAC) && (defined GC_HAVE_LION) - LionFullScreen *fullScreen; -#endif #ifndef Q_OS_MAC QTFullScreen *fullScreen; #endif diff --git a/src/ManualRideDialog.h b/src/ManualRideDialog.h index 87bf7fa13..e9c8be4b2 100644 --- a/src/ManualRideDialog.h +++ b/src/ManualRideDialog.h @@ -22,6 +22,10 @@ #include "GoldenCheetah.h" #include +#include +#include +#include +#include #include class Context; diff --git a/src/MergeActivityWizard.cpp b/src/MergeActivityWizard.cpp index 2f26ed387..d0b9619e6 100644 --- a/src/MergeActivityWizard.cpp +++ b/src/MergeActivityWizard.cpp @@ -400,7 +400,7 @@ MergeSync::printDelays() seriesName = "alt"; else if (series==4) seriesName = "hr"; - fprintf(stderr, " series %d %s\n", series, seriesName.toAscii().constData()); + fprintf(stderr, " series %d %s\n", series, seriesName.toLatin1().constData()); for (int i=0;i + #include - - - - +#include +#include +#include +#include +#include +#include +#include class MainWindow; class SmallPlot; diff --git a/src/MetadataWindow.cpp b/src/MetadataWindow.cpp index 415ebd64a..d24304a23 100644 --- a/src/MetadataWindow.cpp +++ b/src/MetadataWindow.cpp @@ -21,7 +21,6 @@ MetadataWindow::MetadataWindow(Context *context) : GcChartWindow(context), context(context) { - setInstanceName("Metadata Window"); setControls(NULL); setRideItem(NULL); setContentsMargins(0,0,0,0); diff --git a/src/MetadataWindow.h b/src/MetadataWindow.h index e47a74990..1ea669995 100644 --- a/src/MetadataWindow.h +++ b/src/MetadataWindow.h @@ -19,6 +19,7 @@ #ifndef _GC_MetadataWindow_h #define _GC_MetadataWindow_h 1 #include "GoldenCheetah.h" +#include "RideItem.h" #include "RideMetadata.h" class Context; diff --git a/src/ModelPlot.cpp b/src/ModelPlot.cpp index 954def1f4..2085fb98e 100644 --- a/src/ModelPlot.cpp +++ b/src/ModelPlot.cpp @@ -999,8 +999,6 @@ ModelPlot::ModelPlot(Context *context, ModelSettings *settings) : QFrame(context // the distinction between a model plot and a basic model plot // is only to provide a frame for the qwt3d plot (it looks odd // when compared to the other plots without one) - setInstanceName("3D Plot"); - layout = new QVBoxLayout; setLineWidth(1); setFrameStyle(QFrame::NoFrame); diff --git a/src/ModelPlot.h b/src/ModelPlot.h index 44f08ddbb..695427c0a 100644 --- a/src/ModelPlot.h +++ b/src/ModelPlot.h @@ -22,6 +22,10 @@ #include #include +#include +#include +#include +#include #include "Context.h" #include diff --git a/src/ModelWindow.cpp b/src/ModelWindow.cpp index 6eb769a74..369570192 100644 --- a/src/ModelWindow.cpp +++ b/src/ModelWindow.cpp @@ -48,8 +48,6 @@ ModelWindow::addStandardChannels(QComboBox *box) ModelWindow::ModelWindow(Context *context, const QDir &home) : GcChartWindow(context), home(home), context(context), ride(NULL), current(NULL) { - setInstanceName("3D Window"); - QWidget *c = new QWidget; QFormLayout *cl = new QFormLayout(c); setControls(c); diff --git a/src/ModelWindow.h b/src/ModelWindow.h index 25af2a69f..cf878283a 100644 --- a/src/ModelWindow.h +++ b/src/ModelWindow.h @@ -22,6 +22,11 @@ #include #include +#include +#include +#include +#include +#include #include "Context.h" class ModelPlot; // we don't include the header because it uses namespaces diff --git a/src/NamedSearch.cpp b/src/NamedSearch.cpp index 122dd5514..0ffda7c8f 100644 --- a/src/NamedSearch.cpp +++ b/src/NamedSearch.cpp @@ -42,7 +42,7 @@ static QString protect(const QString string) // Un-Escape special characters (JSON compliance) static QString unprotect(const QString string) { - QString string2 = QString::fromLocal8Bit(string.toAscii().data()); + QString string2 = QString::fromLocal8Bit(string.toLatin1().data()); // this is a quoted string QString s = string2.mid(1,string2.length()-2); @@ -116,7 +116,7 @@ NamedSearches::deleteNamedSearch(int index) bool NamedSearchParser::startDocument() { buffer.clear(); - return TRUE; + return true; } bool NamedSearchParser::endElement( const QString&, const QString&, const QString &qName ) @@ -133,7 +133,7 @@ bool NamedSearchParser::endElement( const QString&, const QString&, const QStrin result.append(namedSearch); } - return TRUE; + return true; } bool NamedSearchParser::startElement( const QString&, const QString&, const QString &name, const QXmlAttributes & ) @@ -143,18 +143,18 @@ bool NamedSearchParser::startElement( const QString&, const QString&, const QStr namedSearch = NamedSearch(); } - return TRUE; + return true; } bool NamedSearchParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } bool NamedSearchParser::endDocument() { - return TRUE; + return true; } bool diff --git a/src/NamedSearch.h b/src/NamedSearch.h index aef74bffd..65d295d46 100644 --- a/src/NamedSearch.h +++ b/src/NamedSearch.h @@ -19,14 +19,17 @@ #ifndef Gc_NamedSearch_h #define Gc_NamedSearch_h #include "GoldenCheetah.h" +#include "Athlete.h" #include #include +#include #include +#include +#include + + class SearchBox; - -#include "Athlete.h" - class NamedSearch { public: diff --git a/src/NewCyclistDialog.h b/src/NewCyclistDialog.h index 2a16c4363..640efce3c 100644 --- a/src/NewCyclistDialog.h +++ b/src/NewCyclistDialog.h @@ -24,6 +24,14 @@ #include "Units.h" #include "Settings.h" +#include +#include +#include +#include +#include +#include +#include + class NewCyclistDialog : public QDialog { Q_OBJECT diff --git a/src/OAuthDialog.cpp b/src/OAuthDialog.cpp index c4ad8e03d..4b831624b 100644 --- a/src/OAuthDialog.cpp +++ b/src/OAuthDialog.cpp @@ -20,8 +20,6 @@ #include "Athlete.h" #include "Context.h" #include "Settings.h" -#include -#include #include "TimeUtils.h" OAuthDialog::OAuthDialog(Context *context, OAuthSite site) : @@ -81,7 +79,7 @@ OAuthDialog::urlChanged(const QUrl &url) QString code = url.toString().right(url.toString().length()-url.toString().indexOf("code=")-5); QByteArray data; - QUrl params; + QUrlQuery params; QString urlstr = ""; if (site == STRAVA) { @@ -106,9 +104,9 @@ OAuthDialog::urlChanged(const QUrl &url) } params.addQueryItem("code", code); - data = params.encodedQuery(); + data.append(params.query(QUrl::FullyEncoded)); - QUrl url = QUrl( urlstr); + QUrl url = QUrl(urlstr); QNetworkRequest request = QNetworkRequest(url); request.setHeader(QNetworkRequest::ContentTypeHeader,"application/x-www-form-urlencoded"); diff --git a/src/OAuthDialog.h b/src/OAuthDialog.h index 9af4df55b..a4153ba1c 100644 --- a/src/OAuthDialog.h +++ b/src/OAuthDialog.h @@ -23,7 +23,12 @@ #include #include #include +#include #include +#include +#include +#include +#include class OAuthDialog : public QDialog { diff --git a/src/Pages.cpp b/src/Pages.cpp index 977367e36..f3f20ace9 100644 --- a/src/Pages.cpp +++ b/src/Pages.cpp @@ -19,8 +19,9 @@ #include "Athlete.h" #include #include -#include + #include + #include "Pages.h" #include "Units.h" #include "Settings.h" diff --git a/src/Pages.h b/src/Pages.h index dcf0a7b29..4c798d393 100644 --- a/src/Pages.h +++ b/src/Pages.h @@ -5,12 +5,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include "Zones.h" #include "HrZones.h" @@ -20,6 +22,7 @@ #include #include #include +#include #include "DeviceTypes.h" #include "DeviceConfiguration.h" #include "RideMetadata.h" diff --git a/src/PerfPlot.cpp b/src/PerfPlot.cpp index 2597a818c..8d8b507b7 100644 --- a/src/PerfPlot.cpp +++ b/src/PerfPlot.cpp @@ -16,19 +16,7 @@ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - -#include -#include -#include -#include -#include -#include -#include -#include "RideItem.h" -#include "RideFile.h" #include "PerfPlot.h" -#include "StressCalculator.h" -#include "Colors.h" // handle x-axis names class PPTimeScaleDraw: public QwtScaleDraw @@ -58,8 +46,6 @@ class PPTimeScaleDraw: public QwtScaleDraw PerfPlot::PerfPlot() : STScurve(NULL), LTScurve(NULL), SBcurve(NULL), DAYcurve(NULL) { - setInstanceName("PM Plot"); - xsd = new PPTimeScaleDraw(QDateTime()); xsd->setTickLength(QwtScaleDiv::MajorTick, 3); setAxisScaleDraw(QwtPlot::xBottom, xsd); diff --git a/src/PerfPlot.h b/src/PerfPlot.h index 6185ccaa5..7f9d5ffc7 100644 --- a/src/PerfPlot.h +++ b/src/PerfPlot.h @@ -19,15 +19,26 @@ #ifndef _GC_PerfPlot_h #define _GC_PerfPlot_h 1 #include "GoldenCheetah.h" - +#include "Settings.h" #include "StressCalculator.h" +#include "RideItem.h" +#include "RideFile.h" +#include "PerfPlot.h" +#include "StressCalculator.h" +#include "Colors.h" + #include + #include #include #include #include #include -#include "Settings.h" +#include +#include +#include +#include + class PPTimeScaleDraw; diff --git a/src/PerformanceManagerWindow.cpp b/src/PerformanceManagerWindow.cpp index 5a3e60c62..b9d651d47 100644 --- a/src/PerformanceManagerWindow.cpp +++ b/src/PerformanceManagerWindow.cpp @@ -13,7 +13,6 @@ PerformanceManagerWindow::PerformanceManagerWindow(Context *context) : GcWindow(context), context(context), active(false), isfiltered(false) { - setInstanceName("PM Window"); setControls(NULL); days = count = 0; diff --git a/src/PerformanceManagerWindow.h b/src/PerformanceManagerWindow.h index 7fee4e10b..44122dbfc 100644 --- a/src/PerformanceManagerWindow.h +++ b/src/PerformanceManagerWindow.h @@ -24,6 +24,7 @@ #include #include +#include #include #include "Settings.h" diff --git a/src/PfPvPlot.cpp b/src/PfPvPlot.cpp index ad12eac64..0b2434f91 100644 --- a/src/PfPvPlot.cpp +++ b/src/PfPvPlot.cpp @@ -120,8 +120,6 @@ public: PfPvPlot::PfPvPlot(Context *context) : rideItem (NULL), context(context), cp_ (0), cad_ (85), cl_ (0.175), shade_zones(true) { - setInstanceName("PfPv Plot"); - setCanvasBackground(Qt::white); canvas()->setFrameStyle(QFrame::NoFrame); diff --git a/src/PfPvWindow.cpp b/src/PfPvWindow.cpp index 0f183ef55..0920ae025 100644 --- a/src/PfPvWindow.cpp +++ b/src/PfPvWindow.cpp @@ -67,8 +67,6 @@ PfPvDoubleClickPicker::trackerTextF( const QPointF &pos ) const PfPvWindow::PfPvWindow(Context *context) : GcChartWindow(context), context(context), current(NULL) { - setInstanceName("Pf/Pv Window"); - QWidget *c = new QWidget; QVBoxLayout *cl = new QVBoxLayout(c); setControls(c); diff --git a/src/PfPvWindow.h b/src/PfPvWindow.h index eec7fede5..79583a529 100644 --- a/src/PfPvWindow.h +++ b/src/PfPvWindow.h @@ -21,6 +21,11 @@ #include "GoldenCheetah.h" #include +#include +#include +#include +#include + #include class Context; diff --git a/src/PowerTapDevice.cpp b/src/PowerTapDevice.cpp index eaba8b4b2..5f5caa73d 100644 --- a/src/PowerTapDevice.cpp +++ b/src/PowerTapDevice.cpp @@ -153,7 +153,7 @@ PowerTapDevice::download( const QDir &tmpdir, } if (PT_DEBUG) { printf("read version \"%s\"\n", - cEscape(vbuf, version_len).toAscii().constData()); + cEscape(vbuf, version_len).toLatin1().constData()); } version = QByteArray(vbuf, version_len); @@ -192,7 +192,7 @@ PowerTapDevice::download( const QDir &tmpdir, if (PT_DEBUG) { printf("read header \"%s\"\n", cEscape((char*) header, - sizeof(header)).toAscii().constData()); + sizeof(header)).toLatin1().constData()); } QVector records; for (size_t i = 0; i < sizeof(header); ++i) @@ -219,7 +219,7 @@ PowerTapDevice::download( const QDir &tmpdir, } if (PT_DEBUG) { printf("read 2 bytes: \"%s\"\n", - cEscape((char*) buf, 2).toAscii().constData()); + cEscape((char*) buf, 2).toLatin1().constData()); } if (hasNewline((char*) buf, 2)) break; @@ -236,7 +236,7 @@ PowerTapDevice::download( const QDir &tmpdir, } if (PT_DEBUG) { printf("read %d bytes: \"%s\"\n", n, - cEscape((char*) buf + count, n).toAscii().constData()); + cEscape((char*) buf + count, n).toLatin1().constData()); } count += n; } diff --git a/src/QtMacButton.mm b/src/QtMacButton.mm index e30a51aed..7431814bb 100644 --- a/src/QtMacButton.mm +++ b/src/QtMacButton.mm @@ -18,12 +18,19 @@ #include "QtMacButton.h" +// mac specials +#include +#include +#include +#include + #import "AppKit/NSButton.h" #import "AppKit/NSFont.h" static NSImage *fromQPixmap(const QPixmap *pixmap) { - NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:pixmap->toMacCGImageRef()]; + CGImageRef cgImage = QtMac::toCGImageRef(*pixmap); + NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; NSImage *image = [[[NSImage alloc] init] autorelease]; [image addRepresentation:bitmapRep]; [bitmapRep release]; @@ -39,13 +46,15 @@ static inline NSString* fromQString(const QString &string) } // nice little trick from qocoa -static inline void setupLayout(void *cocoaView, QWidget *parent) +static inline void setupLayout(NSView *cocoaView, QWidget *parent) { parent->setAttribute(Qt::WA_NativeWindow); QVBoxLayout *layout = new QVBoxLayout(parent); layout->setContentsMargins(0,0,0,0); layout->setSpacing(0); - layout->addWidget(new QMacCocoaViewContainer(cocoaView, parent)); + QMacCocoaViewContainer *cont = new QMacCocoaViewContainer(0, parent); + cont->setCocoaView(cocoaView); + layout->addWidget(cont); } // Lets wrap up all the NSButton complexity in this private diff --git a/src/QtMacSegmentedButton.mm b/src/QtMacSegmentedButton.mm index b18d75c9e..5b2ab75e0 100644 --- a/src/QtMacSegmentedButton.mm +++ b/src/QtMacSegmentedButton.mm @@ -18,11 +18,15 @@ #include "QtMacSegmentedButton.h" +// mac specials +#include + #import #import #import #import #import +#import #import CocoaInitializer::CocoaInitializer() @@ -44,7 +48,8 @@ static inline NSString *darwinQStringToNSString (const QString &aString) static NSImage *fromQPixmap(const QPixmap *pixmap) { - NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:pixmap->toMacCGImageRef()]; + CGImageRef cgImage = QtMac::toCGImageRef(*pixmap); + NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; NSImage *image = [[[NSImage alloc] init] autorelease]; [image addRepresentation:bitmapRep]; [bitmapRep release]; diff --git a/src/QtMacVideoWindow.mm b/src/QtMacVideoWindow.mm index dc6fe124e..bf73e0e02 100644 --- a/src/QtMacVideoWindow.mm +++ b/src/QtMacVideoWindow.mm @@ -39,8 +39,7 @@ GcWindow(context), home(home), context(context), hasMovie(false) { setControls(NULL); - setInstanceName("Video Window"); - setProperty("color", Qt::black); + setProperty("color", QColor(Qt::black)); QHBoxLayout *layout = new QHBoxLayout(); setLayout(layout); diff --git a/src/QuarqParser.cpp b/src/QuarqParser.cpp index bbec078d1..0aca47ab5 100644 --- a/src/QuarqParser.cpp +++ b/src/QuarqParser.cpp @@ -72,7 +72,7 @@ QuarqParser::startElement( const QString&, const QString&, seconds_from_start = 0.0; initial_seconds = -1; - return TRUE; + return true; } #define CheckQuarqXml(name,unit,dest) do { \ @@ -85,7 +85,7 @@ QuarqParser::startElement( const QString&, const QString&, dest = name.toDouble(); \ incrementTime(timestamp.toDouble()); \ } \ - return TRUE; \ + return true; \ } \ } while (0); @@ -103,7 +103,7 @@ QuarqParser::startElement( const QString&, const QString&, // only print the first time and unknown happens if (!unknown_keys[qName]++) std::cerr << "Unknown Element " << qPrintable(qName) << std::endl; - return TRUE; + return true; } bool @@ -116,12 +116,12 @@ QuarqParser::endElement( const QString&, const QString&, const QString& qName) kph, nm, watts, 0, 0.0, 0.0, 0.0, 0.0, RideFile::noTemp, 0.0, 0); } - return TRUE; + return true; } bool QuarqParser::characters( const QString& str ) { buf += str; - return TRUE; + return true; } diff --git a/src/RealtimePlot.cpp b/src/RealtimePlot.cpp index ea6d14120..fd07ea844 100644 --- a/src/RealtimePlot.cpp +++ b/src/RealtimePlot.cpp @@ -145,8 +145,6 @@ RealtimePlot::RealtimePlot() : showAltState(Qt::Checked), smooth(0) { - setInstanceName("Realtime Plot"); - //insertLegend(new QwtLegend(), QwtPlot::BottomLegend); pwr30Data = new Realtime30PwrData; pwrData = new RealtimePwrData; diff --git a/src/RealtimePlotWindow.cpp b/src/RealtimePlotWindow.cpp index 04cf7dfe6..799870b8c 100644 --- a/src/RealtimePlotWindow.cpp +++ b/src/RealtimePlotWindow.cpp @@ -24,7 +24,6 @@ RealtimePlotWindow::RealtimePlotWindow(Context *context) : GcWindow(context), context(context), active(false) { setContentsMargins(0,0,0,0); - setInstanceName("RT Plot"); setProperty("color", GColor(CRIDEPLOTBACKGROUND)); QWidget *c = new QWidget; diff --git a/src/RealtimePlotWindow.h b/src/RealtimePlotWindow.h index ceb05c9ab..a8a03ccd1 100644 --- a/src/RealtimePlotWindow.h +++ b/src/RealtimePlotWindow.h @@ -22,6 +22,9 @@ #include #include // for Q_PROPERTY +#include +#include +#include #include "Context.h" diff --git a/src/ReferenceLineDialog.h b/src/ReferenceLineDialog.h index 6ee3978c6..a7c426f43 100644 --- a/src/ReferenceLineDialog.h +++ b/src/ReferenceLineDialog.h @@ -22,6 +22,11 @@ #include "AllPlot.h" #include +#include +#include +#include +#include +#include class Context; class RideFile; diff --git a/src/RideEditor.cpp b/src/RideEditor.cpp index 092a90db5..727176653 100644 --- a/src/RideEditor.cpp +++ b/src/RideEditor.cpp @@ -58,7 +58,6 @@ static void secsMsecs(double value, int &secs, int &msecs) RideEditor::RideEditor(Context *context) : GcChartWindow(context), data(NULL), ride(NULL), context(context), inLUW(false), colMapper(NULL) { - setInstanceName("Ride Editor"); setControls(NULL); QVBoxLayout *mainLayout = new QVBoxLayout; diff --git a/src/RideEditor.h b/src/RideEditor.h index 404623145..8c5223076 100644 --- a/src/RideEditor.h +++ b/src/RideEditor.h @@ -25,7 +25,17 @@ #include "RideFile.h" #include "RideFileCommand.h" #include "RideFileTableModel.h" + #include +#include +#include +#include +#include +#include +#include +#include +#include +#include class EditorData; class CellDelegate; diff --git a/src/RideFile.cpp b/src/RideFile.cpp index 88ebffdcc..4b322aa1f 100644 --- a/src/RideFile.cpp +++ b/src/RideFile.cpp @@ -882,7 +882,7 @@ RideFile::parseRideFileName(const QString &name, QDateTime *dt) QRegExp rx(rideFileRegExp); if (!rx.exactMatch(name)) return false; - assert(rx.numCaptures() == 8); + assert(rx.captureCount() == 8); QDate date(rx.cap(2).toInt(), rx.cap(3).toInt(),rx.cap(4).toInt()); QTime time(rx.cap(5).toInt(), rx.cap(6).toInt(),rx.cap(7).toInt()); if ((! date.isValid()) || (! time.isValid())) { diff --git a/src/RideImportWizard.h b/src/RideImportWizard.h index 47db8cc59..3e5c67631 100644 --- a/src/RideImportWizard.h +++ b/src/RideImportWizard.h @@ -21,10 +21,15 @@ #include "GoldenCheetah.h" #include +#include +#include +#include #include +#include #include #include #include +#include #include "Context.h" // Dialog class to show filenames, import progress and to capture user input diff --git a/src/RideItem.h b/src/RideItem.h index 6edb4850d..8f39c652e 100644 --- a/src/RideItem.h +++ b/src/RideItem.h @@ -95,4 +95,5 @@ class RideItem : public QObject, public QTreeWidgetItem //<< for signals/slots double timeInHrZone(int zone); #endif }; +Q_DECLARE_METATYPE(RideItem*) #endif // _GC_RideItem_h diff --git a/src/RideMetadata.cpp b/src/RideMetadata.cpp index 6905f08c8..5808ae7ee 100644 --- a/src/RideMetadata.cpp +++ b/src/RideMetadata.cpp @@ -1011,7 +1011,7 @@ bool MetadataXMLParser::endElement( const QString&, const QString&, const QStrin else if (qName == "colorfield") colorfield = unprotect(buffer); - return TRUE; + return true; } bool MetadataXMLParser::startElement( const QString&, const QString&, const QString &name, const QXmlAttributes &attrs ) @@ -1035,16 +1035,16 @@ bool MetadataXMLParser::startElement( const QString&, const QString&, const QStr } } - return TRUE; + return true; } bool MetadataXMLParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } bool MetadataXMLParser::endDocument() { - return TRUE; + return true; } diff --git a/src/RideMetadata.h b/src/RideMetadata.h index bab39a705..bbf842a3a 100644 --- a/src/RideMetadata.h +++ b/src/RideMetadata.h @@ -23,7 +23,13 @@ #include "Context.h" #include "SpecialFields.h" #include +#include +#include +#include #include +#include +#include +#include // field types #define FIELD_TEXT 0 @@ -163,7 +169,7 @@ class MetadataXMLParser : public QXmlDefaultHandler { public: - bool startDocument() { return TRUE; } + bool startDocument() { return true; } bool endDocument(); bool endElement( const QString&, const QString&, const QString &qName ); bool startElement( const QString&, const QString&, const QString &name, const QXmlAttributes &attrs ); diff --git a/src/RideMetric.h b/src/RideMetric.h index d616a6f84..244c3b173 100644 --- a/src/RideMetric.h +++ b/src/RideMetric.h @@ -29,13 +29,13 @@ #include #include "RideFile.h" -#include "Context.h" class Zones; class HrZones; class Context; - class RideMetric; +class RideFile; + typedef QSharedPointer RideMetricPtr; class RideMetric { diff --git a/src/RideNavigator.h b/src/RideNavigator.h index edf5c1f87..5c7dc0f58 100644 --- a/src/RideNavigator.h +++ b/src/RideNavigator.h @@ -30,6 +30,8 @@ #include #include +#include +#include class NavigatorCellDelegate; class GroupByModel; diff --git a/src/RideNavigatorProxy.h b/src/RideNavigatorProxy.h index 4b64a60be..9a1d5d745 100644 --- a/src/RideNavigatorProxy.h +++ b/src/RideNavigatorProxy.h @@ -490,7 +490,7 @@ public slots: void sourceModelChanged() { clearGroups(); setGroupBy(groupBy+2); // accomodate virtual columns - reset(); + resetInternalData(); // lets expand column 0 for the groupBy heading for (int i=0; i < groupCount(); i++) diff --git a/src/RideSummaryWindow.cpp b/src/RideSummaryWindow.cpp index 0a6afeaec..97b98ac09 100644 --- a/src/RideSummaryWindow.cpp +++ b/src/RideSummaryWindow.cpp @@ -35,7 +35,6 @@ RideSummaryWindow::RideSummaryWindow(Context *context, bool ridesummary) : GcChartWindow(context), context(context), ridesummary(ridesummary), useCustom(false), useToToday(false), filtered(false) { - setInstanceName("Ride Summary Window"); setRideItem(NULL); // allow user to select date range if in summary mode diff --git a/src/RideSummaryWindow.h b/src/RideSummaryWindow.h index 13e78e80f..006bc69b4 100644 --- a/src/RideSummaryWindow.h +++ b/src/RideSummaryWindow.h @@ -25,6 +25,7 @@ #include #include #include +#include #include "SummaryMetrics.h" diff --git a/src/RideWindow.cpp b/src/RideWindow.cpp index e026187a9..1be12f4b4 100644 --- a/src/RideWindow.cpp +++ b/src/RideWindow.cpp @@ -64,7 +64,6 @@ RideWindow::RideWindow(Context *context) : rideLoaded(false), context(context) { - setInstanceName("Ride Window"); view = new QWebView(); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(view); diff --git a/src/SaveDialogs.h b/src/SaveDialogs.h index 7c96927c2..a4a250f53 100644 --- a/src/SaveDialogs.h +++ b/src/SaveDialogs.h @@ -22,7 +22,13 @@ #include #include +#include +#include +#include +#include + #include "RideItem.h" +#include "Context.h" class MainWindow; diff --git a/src/ScatterPlot.cpp b/src/ScatterPlot.cpp index c73953386..e68ca2905 100644 --- a/src/ScatterPlot.cpp +++ b/src/ScatterPlot.cpp @@ -151,7 +151,6 @@ QString ScatterPlot::describeType(int type, bool longer, bool useMetricUnits) ScatterPlot::ScatterPlot(Context *context) : context(context) { - setInstanceName("2D Plot"); all = NULL; grid = NULL; canvas()->setFrameStyle(QFrame::NoFrame); diff --git a/src/ScatterPlot.h b/src/ScatterPlot.h index e5ef29690..01274d9fb 100644 --- a/src/ScatterPlot.h +++ b/src/ScatterPlot.h @@ -22,11 +22,14 @@ #include #include +#include + #include "Context.h" #include "IntervalItem.h" #include "RideItem.h" #include "Units.h" #include "math.h" + #include #include #include diff --git a/src/ScatterWindow.cpp b/src/ScatterWindow.cpp index 2637c55c8..2a44c59ec 100644 --- a/src/ScatterWindow.cpp +++ b/src/ScatterWindow.cpp @@ -62,8 +62,6 @@ ScatterWindow::addrStandardChannels(QxtStringSpinBox *box) ScatterWindow::ScatterWindow(Context *context, const QDir &home) : GcChartWindow(context), home(home), context(context), ride(NULL), current(NULL) { - setInstanceName("2D Window"); - // // reveal controls widget // diff --git a/src/ScatterWindow.h b/src/ScatterWindow.h index 3b80072b4..3862bf01c 100644 --- a/src/ScatterWindow.h +++ b/src/ScatterWindow.h @@ -22,6 +22,9 @@ #include #include +#include +#include + #include "qxtstringspinbox.h" #include "Context.h" #include "RideItem.h" diff --git a/src/Season.h b/src/Season.h index 6ccaf6c6e..51d1d5747 100644 --- a/src/Season.h +++ b/src/Season.h @@ -22,8 +22,12 @@ #include #include +#include #include #include +#include +#include +#include #include "Context.h" diff --git a/src/SeasonParser.cpp b/src/SeasonParser.cpp index 82c194624..307dc0343 100644 --- a/src/SeasonParser.cpp +++ b/src/SeasonParser.cpp @@ -28,7 +28,7 @@ static inline QString unquote(QString quoted) bool SeasonParser::startDocument() { buffer.clear(); - return TRUE; + return true; } bool SeasonParser::endElement( const QString&, const QString&, const QString &qName ) @@ -65,7 +65,7 @@ bool SeasonParser::endElement( const QString&, const QString&, const QString &qN } seasons.append(season); } - return TRUE; + return true; } bool SeasonParser::startElement( const QString&, const QString&, const QString &name, const QXmlAttributes &attrs ) @@ -83,13 +83,13 @@ bool SeasonParser::startElement( const QString&, const QString&, const QString & } } - return TRUE; + return true; } bool SeasonParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } QList SeasonParser::getSeasons() @@ -123,7 +123,7 @@ bool SeasonParser::endDocument() if (seasons[seasons.size()-1].getEnd() == QDate()) seasons[seasons.size()-1].setEnd(QDate::currentDate().addYears(10)); } - return TRUE; + return true; } bool diff --git a/src/Serial.cpp b/src/Serial.cpp index 1debae151..d31edd15a 100644 --- a/src/Serial.cpp +++ b/src/Serial.cpp @@ -79,7 +79,7 @@ Serial::open(QString &err) // Linux and Mac OSX use stdio / termio / tcsetattr // assert(fd < 0); - fd = ::open(path.toAscii().constData(), O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = ::open(path.toLatin1().constData(), O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) { err = QString("open: ") + strerror(errno); return false; diff --git a/src/ShareDialog.cpp b/src/ShareDialog.cpp index 5a1331d1f..79eff6c4b 100644 --- a/src/ShareDialog.cpp +++ b/src/ShareDialog.cpp @@ -19,7 +19,6 @@ #include "ShareDialog.h" #include "Athlete.h" #include "Settings.h" -#include #include #include #include @@ -321,11 +320,11 @@ StravaUploader::requestUploadStrava() // MULTIPART ***************** QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType); - multiPart->setBoundary(boundary.toAscii()); + multiPart->setBoundary(boundary.toLatin1()); QHttpPart accessTokenPart; accessTokenPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"access_token\"")); - accessTokenPart.setBody(token.toAscii()); + accessTokenPart.setBody(token.toLatin1()); QHttpPart activityTypePart; activityTypePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"activity_type\"")); @@ -333,7 +332,7 @@ StravaUploader::requestUploadStrava() QHttpPart activityNamePart; activityNamePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"activity_name\"")); - activityNamePart.setBody(QString(parent->titleEdit->text()).toAscii()); + activityNamePart.setBody(QString(parent->titleEdit->text()).toLatin1()); QHttpPart dataTypePart; dataTypePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"data_type\"")); @@ -632,7 +631,7 @@ RideWithGpsUploader::requestUploadRideWithGPS() parent->progressBar->setValue(parent->progressBar->value()+30/parent->shareSiteCount); parent->progressLabel->setText(tr("Upload ride... Sending to RideWithGPS")); - networkMgr.post( request, out.toAscii()); + networkMgr.post( request, out.toLatin1()); eventLoop.exec(); } @@ -773,13 +772,13 @@ CyclingAnalyticsUploader::requestUploadCyclingAnalytics() // MULTIPART ***************** QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType); - multiPart->setBoundary(boundary.toAscii()); + multiPart->setBoundary(boundary.toLatin1()); - request.setRawHeader("Authorization", (QString("Bearer %1").arg(token)).toAscii()); + request.setRawHeader("Authorization", (QString("Bearer %1").arg(token)).toLatin1()); QHttpPart activityNamePart; activityNamePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"title\"")); - activityNamePart.setBody(QString(parent->titleEdit->text()).toAscii()); + activityNamePart.setBody(QString(parent->titleEdit->text()).toLatin1()); QHttpPart dataTypePart; dataTypePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"format\"")); @@ -953,15 +952,15 @@ SelfLoopsUploader::requestUploadSelfLoops() // MULTIPART ***************** QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::MixedType); - multiPart->setBoundary(boundary.toAscii()); + multiPart->setBoundary(boundary.toLatin1()); QHttpPart emailPart; emailPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"email\"")); - emailPart.setBody(username.toAscii()); + emailPart.setBody(username.toLatin1()); QHttpPart passwordPart; passwordPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"pw\"")); - passwordPart.setBody(password.toAscii()); + passwordPart.setBody(password.toLatin1()); QHttpPart filePart; filePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"tcxfile\"; filename=\"myfile.tcx.gz\"; type=\"application/x-gzip\"")); diff --git a/src/ShareDialog.h b/src/ShareDialog.h index eb1a8603b..293d3d997 100644 --- a/src/ShareDialog.h +++ b/src/ShareDialog.h @@ -26,6 +26,13 @@ #include #include "MainWindow.h" #include "RideItem.h" +#include +#include +#include +#include +#include +#include +#include #ifdef GC_HAVE_LIBOAUTH extern "C" { diff --git a/src/SlfParser.cpp b/src/SlfParser.cpp index e21e7697b..a819e4a5d 100644 --- a/src/SlfParser.cpp +++ b/src/SlfParser.cpp @@ -62,7 +62,7 @@ SlfParser::startElement( const QString&, const QString&, restSec = qAttributes.value("zeit").toDouble(); } - return TRUE; + return true; } bool @@ -153,11 +153,11 @@ SlfParser::endElement( const QString&, const QString&, const QString& qName) secs += samplingRate; } } - return TRUE; + return true; } bool SlfParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } diff --git a/src/SmfParser.cpp b/src/SmfParser.cpp index b473f4383..cdc5efb8a 100644 --- a/src/SmfParser.cpp +++ b/src/SmfParser.cpp @@ -36,7 +36,7 @@ SmfParser::startElement( const QString&, const QString&, (void)qName; (void)qAttributes; - return TRUE; + return true; } bool @@ -144,11 +144,11 @@ SmfParser::endElement( const QString&, const QString&, const QString& qName) gain.insert("value", QString("%1").arg(g)); rideFile->metricOverrides.insert("elevation_gain", gain); } - return TRUE; + return true; } bool SmfParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } diff --git a/src/SpinScanPlot.cpp b/src/SpinScanPlot.cpp index 645368eee..e4405c7b0 100644 --- a/src/SpinScanPlot.cpp +++ b/src/SpinScanPlot.cpp @@ -56,8 +56,6 @@ void SpinScanData::init() { } SpinScanPlot::SpinScanPlot(QWidget *parent, uint8_t *spinData) : QwtPlot(parent), leftCurve(NULL), rightCurve(NULL), spinData(spinData) { - setInstanceName("SpinScan Plot"); - // Setup the axis setAxisTitle(yLeft, "SpinScan"); setAxisMaxMinor(xBottom, 0); diff --git a/src/SpinScanPlotWindow.cpp b/src/SpinScanPlotWindow.cpp index d8301f43b..12620437b 100644 --- a/src/SpinScanPlotWindow.cpp +++ b/src/SpinScanPlotWindow.cpp @@ -24,7 +24,6 @@ SpinScanPlotWindow::SpinScanPlotWindow(Context *context) : GcWindow(context), context(context), active(false) { setContentsMargins(0,0,0,0); - setInstanceName("SpinScan Plot"); setProperty("color", GColor(CRIDEPLOTBACKGROUND)); // setup controls diff --git a/src/SpinScanPlotWindow.h b/src/SpinScanPlotWindow.h index 628e801a8..511d749fe 100644 --- a/src/SpinScanPlotWindow.h +++ b/src/SpinScanPlotWindow.h @@ -22,6 +22,8 @@ #include #include // for Q_PROPERTY +#include +#include #include "Context.h" diff --git a/src/SpinScanPolarPlot.cpp b/src/SpinScanPolarPlot.cpp index 69e8982e6..1d2793064 100644 --- a/src/SpinScanPolarPlot.cpp +++ b/src/SpinScanPolarPlot.cpp @@ -68,8 +68,6 @@ QRectF SpinScanPolarData::boundingRect() const SpinScanPolarPlot::SpinScanPolarPlot(QWidget *parent, uint8_t *spinData) : QwtPlot(parent), leftCurve(NULL), rightCurve(NULL), spinData(spinData) { - setInstanceName("SpinScan Plot"); - // Setup the axis setAxisTitle(yLeft, "SpinScan"); setAxisMaxMinor(xBottom, 0); diff --git a/src/SplitActivityWizard.h b/src/SplitActivityWizard.h index da4550919..0ae191b7e 100644 --- a/src/SplitActivityWizard.h +++ b/src/SplitActivityWizard.h @@ -27,8 +27,12 @@ #include "JsonRideFile.h" #include "Units.h" #include "Colors.h" + #include #include +#include +#include +#include #include diff --git a/src/SrmDevice.cpp b/src/SrmDevice.cpp index 4c13a8a3d..232616845 100644 --- a/src/SrmDevice.cpp +++ b/src/SrmDevice.cpp @@ -124,14 +124,14 @@ SrmDevice::open( QString &err ) // serial port device anyway. #ifdef SRMIO_HAVE_WINCOM - io = srmio_iow32_new( dev->name().toAscii().constData(), &serr ); + io = srmio_iow32_new( dev->name().toLatin1().constData(), &serr ); if( ! io ){ err = tr("failed to allocate device handle: %1") .arg(serr.message); return false; } #elif defined(SRMIO_HAVE_TERMIOS) - io = srmio_ios_new( dev->name().toAscii().constData(), &serr ); + io = srmio_ios_new( dev->name().toLatin1().constData(), &serr ); if( ! io ){ err = tr("failed to allocate device handle: %1") .arg(serr.message); @@ -146,7 +146,7 @@ SrmDevice::open( QString &err ) } else if( dev->type() == "D2XX" ){ #ifdef SRMIO_HAVE_D2XX io = srmio_d2xx_description_new( - dev->name().toAscii().constData(), &serr ); + dev->name().toLatin1().constData(), &serr ); if( ! io ){ err = tr("failed to allocate device handle: %1") .arg(serr.message); @@ -560,7 +560,7 @@ SrmDevice::download( const QDir &tmpdir, } file.startTime.setTime_t( 0.1 * stime ); - fh = fopen( file.name.toAscii().constData(), "wb" ); + fh = fopen( file.name.toLatin1().constData(), "wb" ); if( ! fh ){ srmio_data_free(fixed); err = tr( "failed to open file %1: %2") diff --git a/src/SummaryWindow.cpp b/src/SummaryWindow.cpp index 018fb796e..6cd95c068 100644 --- a/src/SummaryWindow.cpp +++ b/src/SummaryWindow.cpp @@ -21,7 +21,6 @@ SummaryWindow::SummaryWindow(Context *context) : GcWindow(context), context(context) { - setInstanceName("Summary Window"); setControls(NULL); setRideItem(NULL); diff --git a/src/SummaryWindow.h b/src/SummaryWindow.h index d05f9ccfe..36dc4c951 100644 --- a/src/SummaryWindow.h +++ b/src/SummaryWindow.h @@ -23,6 +23,8 @@ #include "RideSummaryWindow.h" #include "RideMetadata.h" +#include + class Context; class SummaryWindow : public GcWindow diff --git a/src/TPDownloadDialog.h b/src/TPDownloadDialog.h index bc210694d..3b784721a 100644 --- a/src/TPDownloadDialog.h +++ b/src/TPDownloadDialog.h @@ -22,6 +22,10 @@ #include #include +#include +#include +#include + #include "RideFile.h" #include "TPDownload.h" #include "TPUpload.h" diff --git a/src/TPUploadDialog.h b/src/TPUploadDialog.h index a9b09da17..f0121e110 100644 --- a/src/TPUploadDialog.h +++ b/src/TPUploadDialog.h @@ -22,6 +22,8 @@ #include #include +#include +#include #include "RideFile.h" #include "TPUpload.h" diff --git a/src/TcxParser.cpp b/src/TcxParser.cpp index b70f5592a..d7eed7980 100644 --- a/src/TcxParser.cpp +++ b/src/TcxParser.cpp @@ -88,7 +88,7 @@ TcxParser::startElement( const QString&, const QString&, const QString& qName, c } - return TRUE; + return true; } bool @@ -216,11 +216,11 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName) last_distance = distance; last_time = time; } - return TRUE; + return true; } bool TcxParser::characters( const QString& str ) { buffer += str; - return TRUE; + return true; } diff --git a/src/TimeUtils.h b/src/TimeUtils.h index e21d8a939..0ca2b3491 100644 --- a/src/TimeUtils.h +++ b/src/TimeUtils.h @@ -50,6 +50,7 @@ class DateRange : QObject signals: void changed(QDate from, QDate to); }; +Q_DECLARE_METATYPE(DateRange) class DateSettingsEdit : public QWidget { diff --git a/src/ToolsDialog.h b/src/ToolsDialog.h index 960c36213..ca03060dd 100644 --- a/src/ToolsDialog.h +++ b/src/ToolsDialog.h @@ -19,6 +19,9 @@ #include #include +#include +#include +#include class ToolsDialog : public QDialog { diff --git a/src/ToolsRhoEstimator.h b/src/ToolsRhoEstimator.h index 1b78241a9..aaaa822fe 100644 --- a/src/ToolsRhoEstimator.h +++ b/src/ToolsRhoEstimator.h @@ -22,6 +22,9 @@ #include #include +#include +#include +#include class Context; diff --git a/src/TrainSidebar.cpp b/src/TrainSidebar.cpp index 19e81b2f1..50c9f0196 100644 --- a/src/TrainSidebar.cpp +++ b/src/TrainSidebar.cpp @@ -49,6 +49,8 @@ #ifdef Q_OS_MAC #include "QtMacVideoWindow.h" #include +#include +#include #endif #include // isnan and isinf @@ -57,8 +59,6 @@ TrainSidebar::TrainSidebar(Context *context) : GcWindow(context), context(context) { - setInstanceName("Train Controls"); - QWidget *c = new QWidget; //c->setContentsMargins(0,0,0,0); // bit of space is useful QVBoxLayout *cl = new QVBoxLayout(c); @@ -236,7 +236,7 @@ TrainSidebar::TrainSidebar(Context *context) : GcWindow(context), context(contex intensitySlider->hide(); //XXX!!! temporary #ifdef Q_OS_MAC - QWindowsStyle *macstyler = new QWindowsStyle(); + QStyle *macstyler = QStyleFactory::create("fusion"); play->setStyle(macstyler); stop->setStyle(macstyler); rewind->setStyle(macstyler); diff --git a/src/TrainSidebar.h b/src/TrainSidebar.h index 6b6e33de5..f1dd4c569 100644 --- a/src/TrainSidebar.h +++ b/src/TrainSidebar.h @@ -31,11 +31,18 @@ // standard stuff #include +#include #include +#include +#include +#include +#include +#include +#include +#include + #include "math.h" // for round() #include "Units.h" // for MILES_PER_KM -#include -#include // Status settings #define RT_MODE_ERGO 0x0001 // load generation modes diff --git a/src/TreeMapPlot.cpp b/src/TreeMapPlot.cpp index a9c983957..a4c4af681 100644 --- a/src/TreeMapPlot.cpp +++ b/src/TreeMapPlot.cpp @@ -40,8 +40,6 @@ bool TreeMapLessThan(const TreeMap *a, const TreeMap *b) { TreeMapPlot::TreeMapPlot(TreeMapWindow *parent, Context *context) : QWidget (parent), parent(parent), context(context) { - setInstanceName("TreeMap Plot"); - settings = NULL; root = new TreeMap; diff --git a/src/TreeMapWindow.cpp b/src/TreeMapWindow.cpp index 2e971afcb..0f2b385ff 100644 --- a/src/TreeMapWindow.cpp +++ b/src/TreeMapWindow.cpp @@ -39,8 +39,6 @@ TreeMapWindow::TreeMapWindow(Context *context) : GcWindow(context), context(context), active(false), dirty(true), useCustom(false), useToToday(false) { - setInstanceName("Treemap Window"); - // the plot mainLayout = new QVBoxLayout; ltmPlot = new TreeMapPlot(this, context); diff --git a/src/TtbDialog.cpp b/src/TtbDialog.cpp index c5e3a29b2..0df1baf44 100644 --- a/src/TtbDialog.cpp +++ b/src/TtbDialog.cpp @@ -141,10 +141,13 @@ TtbDialog::requestSettings() QString username = appsettings->cvalue(context->athlete->cyclist, GC_TTBUSER).toString(); QString password = appsettings->cvalue(context->athlete->cyclist, GC_TTBPASS).toString(); - QUrl url( TTB_URL + "/settings/list" ); - url.addQueryItem( "view", "xml" ); - url.addQueryItem( "user", username ); - url.addQueryItem( "pass", password ); + QUrlQuery urlquery( TTB_URL + "/settings/list" ); + urlquery.addQueryItem( "view", "xml" ); + urlquery.addQueryItem( "user", username ); + urlquery.addQueryItem( "pass", password ); + + QUrl url; + url.setQuery(urlquery); QNetworkRequest request = QNetworkRequest(url); request.setRawHeader( "Accept-Encoding", "identity" ); @@ -165,10 +168,13 @@ TtbDialog::requestSession() QString username = appsettings->cvalue(context->athlete->cyclist, GC_TTBUSER).toString(); QString password = appsettings->cvalue(context->athlete->cyclist, GC_TTBPASS).toString(); - QUrl url( TTB_URL + "/login/sso" ); - url.addQueryItem( "view", "xml" ); - url.addQueryItem( "user", username ); - url.addQueryItem( "pass", password ); + QUrlQuery urlquery( TTB_URL + "/login/sso" ); + urlquery.addQueryItem( "view", "xml" ); + urlquery.addQueryItem( "user", username ); + urlquery.addQueryItem( "pass", password ); + + QUrl url; + url.setQuery(urlquery); QNetworkRequest request = QNetworkRequest(url); request.setRawHeader( "Accept-Encoding", "identity" ); @@ -228,9 +234,12 @@ TtbDialog::requestUpload() currentRequest = reqUpload; - QUrl url( TTB_URL + "/file/upload" ); - url.addQueryItem( "view", "xml" ); - url.addQueryItem( "sso", sessionId ); + QUrlQuery urlquery( TTB_URL + "/file/upload" ); + urlquery.addQueryItem( "view", "xml" ); + urlquery.addQueryItem( "sso", sessionId ); + + QUrl url; + url.setQuery(urlquery); QNetworkRequest request = QNetworkRequest(url); request.setRawHeader( "Accept-Encoding", "identity" ); diff --git a/src/TtbDialog.h b/src/TtbDialog.h index de2ae27e1..a58a92229 100644 --- a/src/TtbDialog.h +++ b/src/TtbDialog.h @@ -22,13 +22,17 @@ #include #include -#include +#include +#include +#include #include +#include #include #include #include #include #include + #include "Context.h" #include "RideItem.h" diff --git a/src/TwitterDialog.cpp b/src/TwitterDialog.cpp index 8e2ba18f0..089de706a 100644 --- a/src/TwitterDialog.cpp +++ b/src/TwitterDialog.cpp @@ -20,7 +20,6 @@ #include "Athlete.h" #include "Context.h" #include "Settings.h" -#include #include #include "TimeUtils.h" diff --git a/src/TwitterDialog.h b/src/TwitterDialog.h index 845d801f8..0a31897b1 100644 --- a/src/TwitterDialog.h +++ b/src/TwitterDialog.h @@ -22,6 +22,13 @@ #include #include +#include +#include +#include +#include +#include +#include +#include #include "MainWindow.h" #include "RideItem.h" @@ -30,6 +37,8 @@ #include "MetricAggregator.h" #include "DBAccess.h" +#include "Context.h" + #ifdef GC_HAVE_LIBOAUTH extern "C" { #include diff --git a/src/VideoWindow.cpp b/src/VideoWindow.cpp index ffb321c3c..aa726bf9f 100644 --- a/src/VideoWindow.cpp +++ b/src/VideoWindow.cpp @@ -23,8 +23,7 @@ VideoWindow::VideoWindow(Context *context, const QDir &home) : GcWindow(context), home(home), context(context), m_MediaChanged(false) { setControls(NULL); - setInstanceName("Video Window"); - setProperty("color", Qt::black); + setProperty("color", QColor(Qt::black)); QHBoxLayout *layout = new QHBoxLayout(); setLayout(layout); @@ -64,7 +63,7 @@ VideoWindow::VideoWindow(Context *context, const QDir &home) : /* This is a non working code that show how to hooks into a window, * if we have a window around */ #ifdef Q_OS_LINUX - x11Container = new QX11EmbedContainer(this); + x11Container = new QWidget(this); //XXX PORT TO 5.1 BROKEN CODE XXX layout->addWidget(x11Container); libvlc_media_player_set_xwindow (mp, x11Container->winId()); #endif @@ -87,7 +86,7 @@ VideoWindow::~VideoWindow() { #ifdef Q_OS_LINUX // unembed vlc backend first - x11Container->discardClient(); + //x11Container->discardClient(); //XXX PORT TO QT 5.1 BROKEN CODE XXX #endif stopPlayback(); diff --git a/src/VideoWindow.h b/src/VideoWindow.h index de09db037..a281223e4 100644 --- a/src/VideoWindow.h +++ b/src/VideoWindow.h @@ -39,10 +39,6 @@ extern "C" { #include "RealtimeData.h" #include "TrainSidebar.h" -#ifdef Q_OS_LINUX -#include -#endif - class MediaHelper { public: @@ -96,7 +92,7 @@ class VideoWindow : public GcWindow libvlc_media_t *m; #ifdef Q_OS_LINUX - QX11EmbedContainer *x11Container; + QWidget *x11Container; #endif #ifdef WIN32 QWidget *container; diff --git a/src/WithingsParser.h b/src/WithingsParser.h index 64b7eabcb..2f159d894 100644 --- a/src/WithingsParser.h +++ b/src/WithingsParser.h @@ -18,8 +18,6 @@ #ifndef _Gc_WithingsParser_h #define _Gc_WithingsParser_h -#include "GoldenCheetah.h" - #include #include #include diff --git a/src/WorkoutPlotWindow.cpp b/src/WorkoutPlotWindow.cpp index 18410b187..261076324 100644 --- a/src/WorkoutPlotWindow.cpp +++ b/src/WorkoutPlotWindow.cpp @@ -24,7 +24,6 @@ WorkoutPlotWindow::WorkoutPlotWindow(Context *context) : GcWindow(context), context(context) { setContentsMargins(0,0,0,0); - setInstanceName("RT Plot"); setControls(NULL); setProperty("color", GColor(CRIDEPLOTBACKGROUND)); diff --git a/src/WorkoutWizard.cpp b/src/WorkoutWizard.cpp index 351506c49..487e7128b 100644 --- a/src/WorkoutWizard.cpp +++ b/src/WorkoutWizard.cpp @@ -70,7 +70,7 @@ WorkoutEditorBase::WorkoutEditorBase(QStringList &colms, QWidget *parent) :QFram table->setColumnCount(colms.count()); table->setHorizontalHeaderLabels(colms); - table->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); + table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); table->setShowGrid(true); table->setAlternatingRowColors(true); table->resizeColumnsToContents(); diff --git a/src/WorkoutWizard.h b/src/WorkoutWizard.h index f55de1607..f221350b7 100644 --- a/src/WorkoutWizard.h +++ b/src/WorkoutWizard.h @@ -18,12 +18,11 @@ #ifndef _GC_WORKOUTEDITOR_H #define _GC_WORKOUTEDITOR_H + +// qt #include - - #include #include -#include "Settings.h" #include #include #include @@ -32,23 +31,29 @@ #include #include #include +#include +#include +#include + +// gc +#include "Settings.h" #include "RideFile.h" #include "Context.h" #include "GoldenCheetah.h" #include "Settings.h" -class QwtPlotCurve; -class RideItem; - -#include -#include #include "RideItem.h" #include "Units.h" -#include #include "Zones.h" -#include "Settings.h" +// qwt +#include +#include + +class QwtPlotCurve; +class RideItem; class WorkoutPlot; + class WorkoutItem : public QTableWidgetItem { public: diff --git a/src/Zones.cpp b/src/Zones.cpp index f13700c6b..b8e20cef8 100644 --- a/src/Zones.cpp +++ b/src/Zones.cpp @@ -215,7 +215,7 @@ bool Zones::read(QFile &file) // set up the range, capturing CP if it's specified // range = new ZoneRange(begin, end); int nCP = (r ? 11 : 7); - if (rangerx[r].numCaptures() == (nCP)) cp = rangerx[r].cap(nCP).toInt(); + if (rangerx[r].captureCount() == (nCP)) cp = rangerx[r].cap(nCP).toInt(); else cp = 0; // bleck diff --git a/src/LionFullScreen.h b/src/deprecated/LionFullScreen.h similarity index 100% rename from src/LionFullScreen.h rename to src/deprecated/LionFullScreen.h diff --git a/src/LionFullScreen.mm b/src/deprecated/LionFullScreen.mm similarity index 100% rename from src/LionFullScreen.mm rename to src/deprecated/LionFullScreen.mm diff --git a/src/QtMacPopUpButton.h b/src/deprecated/QtMacPopUpButton.h similarity index 100% rename from src/QtMacPopUpButton.h rename to src/deprecated/QtMacPopUpButton.h diff --git a/src/QtMacPopUpButton.mm b/src/deprecated/QtMacPopUpButton.mm similarity index 100% rename from src/QtMacPopUpButton.mm rename to src/deprecated/QtMacPopUpButton.mm diff --git a/src/src.pro b/src/src.pro index e83bd1f5b..5d81500e2 100644 --- a/src/src.pro +++ b/src/src.pro @@ -9,7 +9,11 @@ TARGET = GoldenCheetah DEPENDPATH += . INCLUDEPATH += ../qwt/src ../qxt/src $${LIBZ_INCLUDE} -QT += xml sql network webkit script svg +QT += xml sql network webkitwidgets script svg widgets +macx { + QT += macextras +} + LIBS += ../qwt/lib/libqwt.a LIBS += -lm $${LIBZ_LIBS} @@ -139,21 +143,16 @@ CONFIG(debug, debug|release) { # Mac specific build for # Segmented mac style button # Video playback using Quicktime Framework -# Lion fullscreen playback # search box for title bar macx { LIBS += -lobjc -framework IOKit -framework AppKit -framework QTKit HEADERS += QtMacVideoWindow.h \ - LionFullScreen.h \ QtMacSegmentedButton.h \ - QtMacButton.h \ - QtMacPopUpButton.h + QtMacButton.h OBJECTIVE_SOURCES += QtMacVideoWindow.mm \ - LionFullScreen.mm \ QtMacSegmentedButton.mm \ - QtMacButton.mm \ - QtMacPopUpButton.mm + QtMacButton.mm # on a mac we need to install the Wahoo API for BTLE/Kickr support # This requires **v3.0 (beta)** of the WF API which is not yet diff --git a/src/translations/gc_cs.qm b/src/translations/gc_cs.qm index 25ebb8d2c..f6bb1fa99 100644 Binary files a/src/translations/gc_cs.qm and b/src/translations/gc_cs.qm differ diff --git a/src/translations/gc_de.qm b/src/translations/gc_de.qm index 532ae3064..3886c18aa 100644 Binary files a/src/translations/gc_de.qm and b/src/translations/gc_de.qm differ diff --git a/src/translations/gc_es.qm b/src/translations/gc_es.qm index b88ae5f1b..abb146fb5 100644 Binary files a/src/translations/gc_es.qm and b/src/translations/gc_es.qm differ diff --git a/src/translations/gc_fr.qm b/src/translations/gc_fr.qm index 43444383b..b5a757786 100644 Binary files a/src/translations/gc_fr.qm and b/src/translations/gc_fr.qm differ diff --git a/src/translations/gc_it.qm b/src/translations/gc_it.qm index 18d3cf9cf..34482cb29 100644 Binary files a/src/translations/gc_it.qm and b/src/translations/gc_it.qm differ diff --git a/src/translations/gc_ja.qm b/src/translations/gc_ja.qm index b35e167b4..734fa55f7 100644 Binary files a/src/translations/gc_ja.qm and b/src/translations/gc_ja.qm differ diff --git a/src/translations/gc_pt-br.qm b/src/translations/gc_pt-br.qm index 8d0af9967..01bf6c2a4 100644 Binary files a/src/translations/gc_pt-br.qm and b/src/translations/gc_pt-br.qm differ diff --git a/src/translations/gc_pt.qm b/src/translations/gc_pt.qm index 2134ea9e0..3ce31f09b 100644 Binary files a/src/translations/gc_pt.qm and b/src/translations/gc_pt.qm differ diff --git a/src/translations/gc_ru.qm b/src/translations/gc_ru.qm index b2cfb90d6..8cd42d4e5 100644 Binary files a/src/translations/gc_ru.qm and b/src/translations/gc_ru.qm differ