2010-11-18 13:51:15 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
2010-12-17 17:14:20 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 17:14:20 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 17:14:20 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2011-01-11 11:22:55 +01:00
|
|
|
#include "cdboptions.h"
|
2010-11-18 13:51:15 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QSettings>
|
2010-11-18 13:51:15 +01:00
|
|
|
|
|
|
|
|
static const char settingsGroupC[] = "CDB2";
|
|
|
|
|
static const char symbolPathsKeyC[] = "SymbolPaths";
|
|
|
|
|
static const char sourcePathsKeyC[] = "SourcePaths";
|
2010-12-17 12:00:44 +01:00
|
|
|
static const char breakEventKeyC[] = "BreakEvent";
|
2011-01-19 13:01:50 +01:00
|
|
|
static const char additionalArgumentsKeyC[] = "AdditionalArguments";
|
2011-05-04 09:40:51 +02:00
|
|
|
static const char cdbConsoleKeyC[] = "CDB_Console";
|
2011-09-30 09:56:57 +02:00
|
|
|
static const char breakpointCorrectionKeyC[] = "BreakpointCorrection";
|
2010-11-18 13:51:15 +01:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
2011-01-11 11:06:15 +01:00
|
|
|
namespace Internal {
|
2010-11-18 13:51:15 +01:00
|
|
|
|
2011-09-30 09:56:57 +02:00
|
|
|
CdbOptions::CdbOptions() : cdbConsole(false), breakpointCorrection(true)
|
2010-11-18 13:51:15 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString CdbOptions::settingsGroup()
|
|
|
|
|
{
|
|
|
|
|
return QLatin1String(settingsGroupC);
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-17 10:11:57 +01:00
|
|
|
void CdbOptions::clear()
|
|
|
|
|
{
|
2010-11-18 13:51:15 +01:00
|
|
|
symbolPaths.clear();
|
|
|
|
|
sourcePaths.clear();
|
2011-05-04 09:40:51 +02:00
|
|
|
cdbConsole = false;
|
2010-11-18 13:51:15 +01:00
|
|
|
}
|
|
|
|
|
|
2010-12-17 10:11:57 +01:00
|
|
|
QStringList CdbOptions::oldEngineSymbolPaths(const QSettings *s)
|
|
|
|
|
{
|
|
|
|
|
return s->value(QLatin1String("CDB/SymbolPaths")).toStringList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CdbOptions::fromSettings(QSettings *s)
|
2010-11-18 13:51:15 +01:00
|
|
|
{
|
|
|
|
|
clear();
|
|
|
|
|
const QString keyRoot = QLatin1String(settingsGroupC) + QLatin1Char('/');
|
2011-01-19 13:01:50 +01:00
|
|
|
additionalArguments = s->value(keyRoot + QLatin1String(additionalArgumentsKeyC), QString()).toString();
|
2010-11-18 13:51:15 +01:00
|
|
|
symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList();
|
|
|
|
|
sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList();
|
2010-12-17 12:00:44 +01:00
|
|
|
breakEvents = s->value(keyRoot + QLatin1String(breakEventKeyC), QStringList()).toStringList();
|
2011-05-04 09:40:51 +02:00
|
|
|
cdbConsole = s->value(keyRoot + QLatin1String(cdbConsoleKeyC), QVariant(false)).toBool();
|
2011-09-30 09:56:57 +02:00
|
|
|
breakpointCorrection = s->value(keyRoot + QLatin1String(breakpointCorrectionKeyC), QVariant(true)).toBool();
|
2010-11-18 13:51:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CdbOptions::toSettings(QSettings *s) const
|
|
|
|
|
{
|
|
|
|
|
s->beginGroup(QLatin1String(settingsGroupC));
|
|
|
|
|
s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths);
|
|
|
|
|
s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths);
|
2010-12-17 12:00:44 +01:00
|
|
|
s->setValue(QLatin1String(breakEventKeyC), breakEvents);
|
2011-01-19 13:01:50 +01:00
|
|
|
s->setValue(QLatin1String(additionalArgumentsKeyC), additionalArguments);
|
2011-05-04 09:40:51 +02:00
|
|
|
s->setValue(QLatin1String(cdbConsoleKeyC), QVariant(cdbConsole));
|
2011-09-30 09:56:57 +02:00
|
|
|
s->setValue(QLatin1String(breakpointCorrectionKeyC), QVariant(breakpointCorrection));
|
2010-11-18 13:51:15 +01:00
|
|
|
s->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CdbOptions::equals(const CdbOptions &rhs) const
|
|
|
|
|
{
|
2011-05-04 09:40:51 +02:00
|
|
|
return cdbConsole == rhs.cdbConsole
|
2011-09-30 09:56:57 +02:00
|
|
|
&& breakpointCorrection == rhs.breakpointCorrection
|
2011-05-04 09:40:51 +02:00
|
|
|
&& additionalArguments == rhs.additionalArguments
|
2010-11-18 13:51:15 +01:00
|
|
|
&& symbolPaths == rhs.symbolPaths
|
2010-12-17 12:00:44 +01:00
|
|
|
&& sourcePaths == rhs.sourcePaths
|
|
|
|
|
&& breakEvents == rhs.breakEvents;
|
2010-11-18 13:51:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|