Changeset 07e43cf61a in tspsg for src/globals.h


Ignore:
Timestamp:
Oct 5, 2012, 5:30:23 PM (12 years ago)
Author:
Oleksii Serdiuk
Branches:
appveyor, imgbot, master, readme
Children:
47c811cc09
Parents:
7a39458d16
git-author:
Oleksii Serdiuk <contacts@…> (10/05/12 17:30:23)
git-committer:
Oleksii Serdiuk <contacts@…> (10/05/12 21:58:30)
Message:

Improved compilation time by about 30%.

By reducing number of includes to only required minimum.

NOTE: Compilation time comparison was done by measuring compilation time
while using only one thread (i.e., "make -j1").

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/globals.h

    r7a39458d16 r07e43cf61a  
    3030
    3131// INCLUDES
    32 #include <QtCore>
     32#include <QtGlobal>
    3333#if QT_VERSION < QT_VERSION_CHECK(4,5,0)
    3434#   error You are using Qt version < 4.5 but minimum required version is 4.5.0. Compilation aborted.
     
    3939#   define QT_NO_STATUSTIP
    4040#endif
    41 #include <QtGui>
    4241#if defined(QT_NO_SVG) && !defined(NOSVG)
    4342#   define NOSVG
    4443#endif
    45 #if !defined(NOSVG)
    46 #   include <QtSvg>
    47 #endif // NOSVG
    48 #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
    49 #   include <QtConcurrent>
    50 #   include <QtPrintSupport>
    51 #endif
    5244
    53 #ifndef HANDHELD
    54 #   include "qttoolbardialog.h"
    55 #endif
    56 
    57 // Version info
    58 #include "version.h"
    59 // OS and ARCH detection
    60 #include "os.h"
    6145// TSPSG Defaults
    6246#include "defaults.h"
    63 // TSPSolver
    64 #include "tspsolver.h"
    65 #ifndef HANDHELD
    66     // Eyecandy
    67 #   include "qtwin.h"
    68 #endif // HANDHELD
    6947
    7048// DEFINES
     
    8462/*!
    8563 * \def PATH_DOCS
    86  * \brief Bath to documentation files.
     64 * \brief Path to documentation files.
    8765 */
    8866#ifndef PATH_DOCS
     
    11189#define HQ_FACTOR 2
    11290
    113 // FUNCTIONS
    114 /*!
    115  * \brief Checks whether \a x contains an integer value.
    116  * \param x A value to check.
    117  * \return \c true if \a x countains an integer, oherwise \c false.
    118  */
    119 inline bool isInteger(double x)
    120 {
    121 double i;
    122     return (modf(x, &i) == 0.0);
    123 }
    124 
    12591/*!
    12692 * \brief Checks whether the updater app is installed/available.
     
    12995 *  On other systems this function always returns \c false.
    13096 */
    131 inline bool hasUpdater()
    132 {
    133 #ifdef Q_OS_WIN32
    134     return QFile::exists("updater/Update.exe");
    135 #else // Q_OS_WIN32
    136     return false;
    137 #endif // Q_OS_WIN32
    138 }
     97bool hasUpdater();
    13998
    140 /*!
    141  * \brief Converts \a in into Base64 format with lines wrapped at 64 characters.
    142  * \param in A byte array to be converted.
    143  * \return Converted byte array.
    144  */
    145 inline QByteArray toWrappedBase64(const QByteArray &in)
    146 {
    147     QByteArray out, base64(in.toBase64());
    148     for (int i = 0; i <= base64.size() - 64; i += 64) {
    149         out.append(QByteArray::fromRawData(base64.data() + i, 64)).append('\n');
    150     }
    151     if (int rest = base64.size() % 64)
    152         out.append(QByteArray::fromRawData(base64.data() + base64.size() - rest, rest));
    153     return out;
    154 }
    155 
     99class QSettings;
     100class QObject;
    156101/*!
    157102 * \brief Creates QSettings instance with TSPSG-specific options.
     
    162107
    163108#ifndef HANDHELD
     109class QWidget;
    164110/*!
    165111 * \brief Enables or disables a mask for the \a widget.
     
    173119
    174120#ifndef DOXYGEN_EXCLUDE
    175 
    176 #ifndef QT_NO_PRINTER
    177     Q_DECLARE_METATYPE(QPrinter::PageSize)
    178     Q_DECLARE_METATYPE(QPrinter::Orientation)
    179 #endif
    180121
    181122#ifdef HANDHELD
Note: See TracChangeset for help on using the changeset viewer.