Changeset 43c29c04ba in tspsg for src/tspsolver.cpp


Ignore:
Timestamp:
Jul 4, 2010, 3:03:13 AM (14 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
7aaa0b0ec7
Parents:
d2820c3a1f
git-author:
Oleksii Serdiuk <contacts@…> (07/04/10 03:03:13)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:45:57)
Message:

+ Added support for Windows 7 Taskbar Extensions (namely, Progress Bars).

  • Cleanup is done in a separate thread now, so progress bar runs more smooth.
  • "Tabified" About dialog. Added GPL License and Credits.
  • Updated translations and tspsg.tag file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tspsolver.cpp

    rd2820c3a1f r43c29c04ba  
    4343 */
    4444CTSPSolver::CTSPSolver(QObject *parent)
    45         : QObject(parent), nCities(0), total(0), root(NULL) {}
     45        : QObject(parent), cc(true), nCities(0), total(0), root(NULL) {}
    4646
    4747/*!
     
    5151 * \note It is not required to call this function manually. This function is always called by solve() at the beginning of the solution process.
    5252 *
    53  * \sa solve()
     53 * \sa solve(), setCleanupOnCancel()
    5454 */
    5555void CTSPSolver::cleanup(bool processEvents)
    5656{
    57 #ifdef QAPPLICATION_H
    58         if (!processEvents)
    59                 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
    60 #endif
    6157        route.clear();
    6258        mayNotBeOptimal = false;
    6359        if (root != NULL)
    6460                deleteTree(root, processEvents);
    65 #ifdef QAPPLICATION_H
    66         if (!processEvents)
    67                 QApplication::restoreOverrideCursor();
    68 #endif
    6961}
    7062
     
    115107{
    116108        return !mayNotBeOptimal;
     109}
     110
     111/*!
     112 * \brief Sets whether or not to call cleanup() on solution cancel.
     113 * \param enable Set to \c true to enable clenup (default).
     114 *
     115 *  This may be useful if you want to make cleanup yourself or provide indication of clenup to user.
     116 *
     117 * \note Please, note that cleanup() is explicitly called at the start of each solution.
     118 *       Disabling cleanup and forgetting to do it manually may considerably increase the solution time for large tasks (with more than 15 cities).
     119 * \sa cleanup()
     120 */
     121void CTSPSolver::setCleanupOnCancel(bool enable)
     122{
     123        cc = enable;
    117124}
    118125
     
    174181                locker.relock();
    175182                if ((nRow == -1) || (nCol == -1) || canceled) {
    176                         cleanup();
     183                        if (canceled && cc)
     184                                cleanup();
    177185                        return NULL;
    178186                }
Note: See TracChangeset for help on using the changeset viewer.