# HG changeset patch # User Santeri Piippo # Date 1394369926 -7200 # Node ID a9966d51ebf19d565860a28a31e946f000c04855 # Parent 5d37b2f2ae16fd20d6914738bb697ef3736b3593 - fixed various compilation issues diff -r 5d37b2f2ae16 -r a9966d51ebf1 src/Dialogs.h --- a/src/Dialogs.h Wed Mar 05 20:49:28 2014 +0200 +++ b/src/Dialogs.h Sun Mar 09 14:58:46 2014 +0200 @@ -55,7 +55,7 @@ private: Ui_OverlayUI* ui; - QList> m_cameraArgs; + QList> m_cameraArgs; private slots: void slot_fpath(); diff -r 5d37b2f2ae16 -r a9966d51ebf1 src/GLRenderer.cc --- a/src/GLRenderer.cc Wed Mar 05 20:49:28 2014 +0200 +++ b/src/GLRenderer.cc Sun Mar 09 14:58:46 2014 +0200 @@ -1594,7 +1594,7 @@ transform = getCircleDrawMatrix ((dist0 != 0) ? dist0 : dist1); circleOrDisc = true; } - elif (g_RingFinder (dist0, dist1)) + elif (g_RingFinder.findRings (dist0, dist1)) { // The ring finder found a solution, use that. Add the component rings to the file. for (const RingFinder::Component& cmp : g_RingFinder.bestSolution()->getComponents()) diff -r 5d37b2f2ae16 -r a9966d51ebf1 src/MainWindow.cc --- a/src/MainWindow.cc Wed Mar 05 20:49:28 2014 +0200 +++ b/src/MainWindow.cc Sun Mar 09 14:58:46 2014 +0200 @@ -64,8 +64,8 @@ // ============================================================================= // - -MainWindow::MainWindow (QWidget* parent, Qt::WindowFlags flags) +MainWindow::MainWindow (QWidget* parent, Qt::WindowFlags flags) : + QMainWindow (parent, flags) { g_win = this; ui = new Ui_LDForgeUI; @@ -811,25 +811,30 @@ } // ============================================================================= -bool confirm (QString msg) +// +bool confirm (const QString& message) { return confirm (MainWindow::tr ("Confirm"), message); } -bool confirm (QString title, QString msg) +// ============================================================================= +// +bool confirm (const QString& title, const QString& message) { - return QMessageBox::question (g_win, title, messag, + return QMessageBox::question (g_win, title, message, (QMessageBox::Yes | QMessageBox::No), QMessageBox::No) == QMessageBox::Yes; } // ============================================================================= -void critical (QString msg) +// +void critical (const QString& message) { QMessageBox::critical (g_win, MainWindow::tr ("Error"), message, (QMessageBox::Close), QMessageBox::Close); } // ============================================================================= +// QIcon makeColorIcon (LDColor* colinfo, const int size) { // Create an image object and link a painter to it. @@ -856,6 +861,7 @@ } // ============================================================================= +// void makeColorComboBox (QComboBox* box) { std::map counts; @@ -888,6 +894,8 @@ } } +// ============================================================================= +// void MainWindow::updateDocumentList() { m_updatingTabs = true; @@ -910,6 +918,8 @@ m_updatingTabs = false; } +// ============================================================================= +// void MainWindow::updateDocumentListItem (LDDocument* doc) { bool oldUpdatingTabs = m_updatingTabs; @@ -936,8 +946,10 @@ } // ============================================================================= +// // A file is selected from the list of files on the left of the screen. Find out // which file was picked and change to it. +// void MainWindow::changeCurrentFile() { if (m_updatingTabs) @@ -964,6 +976,8 @@ LDDocument::setCurrent (f); } +// ============================================================================= +// void MainWindow::refreshObjectList() { #if 0 @@ -978,6 +992,8 @@ buildObjList(); } +// ============================================================================= +// void MainWindow::updateActions() { History* his = getCurrentDocument()->history(); @@ -989,6 +1005,8 @@ ui->actionDrawAngles->setChecked (gl_drawangles); } +// ============================================================================= +// QImage imageFromScreencap (uchar* data, int w, int h) { // GL and Qt formats have R and B swapped. Also, GL flips Y - correct it as well. @@ -1001,11 +1019,15 @@ m_color (color), m_toolButton (toolButton) {} +// ============================================================================= +// LDQuickColor LDQuickColor::getSeparator() { return LDQuickColor (null, null); } +// ============================================================================= +// bool LDQuickColor::isSeparator() const { return color() == null; diff -r 5d37b2f2ae16 -r a9966d51ebf1 src/MainWindow.h --- a/src/MainWindow.h Wed Mar 05 20:49:28 2014 +0200 +++ b/src/MainWindow.h Sun Mar 09 14:58:46 2014 +0200 @@ -191,6 +191,8 @@ //! Gets the shortcut configuration for the given \c action KeySequenceConfig* shortcutForAction (QAction* action); + void endAction(); + public slots: void changeCurrentFile(); void slot_action(); @@ -303,8 +305,6 @@ QTabBar* m_tabs; bool m_updatingTabs; - void endAction(); - private slots: void slot_selectionChanged(); void slot_recentFile(); @@ -325,15 +325,15 @@ //! Asks the user a yes/no question with the given \c message and the given //! window \c title. //! \returns true if the user answered yes, false if no. -bool confirm (QString title, QString message); // Generic confirm prompt +bool confirm (const QString& title, const QString& message); // Generic confirm prompt //! An overload of \c confirm(), this asks the user a yes/no question with the //! given \c message. //! \returns true if the user answered yes, false if no. -bool confirm (QString message); +bool confirm (const QString& message); //! Displays an error prompt with the given \c message -void critical (QString message); +void critical (const QString& message); //! Makes an icon of \c size x \c size pixels to represent \c colinfo QIcon makeColorIcon (LDColor* colinfo, const int size); @@ -351,9 +351,9 @@ //! \returns by the user. //! template -T radioSwitch (const T& defval, QList> haystack) +T radioSwitch (const T& defval, QList> haystack) { - for (pair i : haystack) + for (Pair i : haystack) if (i.first->isChecked()) return i.second; @@ -365,9 +365,9 @@ //! found radio button whose respsective value matches \c expr have the given value. //! template -void radioDefault (const T& expr, QList> haystack) +void radioDefault (const T& expr, QList> haystack) { - for (pair i : haystack) + for (Pair i : haystack) { if (i.second == expr) { diff -r 5d37b2f2ae16 -r a9966d51ebf1 src/Types.cc --- a/src/Types.cc Wed Mar 05 20:49:28 2014 +0200 +++ b/src/Types.cc Sun Mar 09 14:58:46 2014 +0200 @@ -189,7 +189,7 @@ // ============================================================================= // -Matrix::Matrix (QList vals) +Matrix::Matrix (const std::initializer_list< double >& vals) { assert (vals.size() == 9); memcpy (&m_vals[0], & (*vals.begin()), sizeof m_vals); diff -r 5d37b2f2ae16 -r a9966d51ebf1 src/Types.h --- a/src/Types.h Wed Mar 05 20:49:28 2014 +0200 +++ b/src/Types.h Sun Mar 09 14:58:46 2014 +0200 @@ -62,7 +62,7 @@ //! Constructs a matrix with the given values. //! \note \c vals is expected to have exactly 9 elements. - Matrix (const QList& vals); + Matrix (const std::initializer_list& vals); //! Constructs a matrix all 9 elements initialized to the same value. //! \param fillval the value to initialize the matrix coordinates as @@ -150,7 +150,8 @@ { public: //! Constructs a zero vertex - Vertex() : m_coords({0, 0, 0}) {} + Vertex() : + m_coords{0, 0, 0} {} //! Constructs a vertex with the given \c x, \c y and \c z. Vertex (double x, double y, double z);