diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 09:34:13 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 09:34:13 (GMT) |
commit | 67ad0519fd165acee4a4d2a94fa502e9e4847bd0 (patch) | |
tree | 1dbf50b3dff8d5ca7e9344733968c72704eb15ff /tools/macdeployqt/macchangeqt/main.cpp | |
download | Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.zip Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.gz Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.bz2 |
Long live Qt!
Diffstat (limited to 'tools/macdeployqt/macchangeqt/main.cpp')
-rw-r--r-- | tools/macdeployqt/macchangeqt/main.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/tools/macdeployqt/macchangeqt/main.cpp b/tools/macdeployqt/macchangeqt/main.cpp new file mode 100644 index 0000000..ebdfc14 --- /dev/null +++ b/tools/macdeployqt/macchangeqt/main.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "../shared/shared.h" + +int main(int argc, char **argv) +{ + // useDebugLibs should always be false because even if set all Qt + // libraries inside a binary to point to debug versions, as soon as + // one of them loads a Qt plugin, the plugin itself will load the + // release version of Qt, and as such, the app will crash. + bool useDebugLibs = false; + + int optionsSpecified = 0; + for (int i = 2; i < argc; ++i) { + QByteArray argument = QByteArray(argv[i]); + if (argument.startsWith(QByteArray("-verbose="))) { + LogDebug() << "Argument found:" << argument; + optionsSpecified++; + int index = argument.indexOf("="); + bool ok = false; + int number = argument.mid(index+1).toInt(&ok); + if (!ok) + LogError() << "Could not parse verbose level"; + else + logLevel = number; + } + } + + if (argc != (3 + optionsSpecified)) { + qDebug() << "Changeqt: changes witch Qt frameworks an application links against."; + qDebug() << "Usage: changeqt app-bundle qt-dir <-verbose=[0-3]>"; + return 0; + } + + const QString appPath = QString::fromLocal8Bit(argv[1]); + const QString qtPath = QString::fromLocal8Bit(argv[2]); + changeQtFrameworks(appPath, qtPath, useDebugLibs); +} |