source: trunk/tools/assistant/compat/profile.cpp@ 552

Last change on this file since 552 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 7.1 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the Qt Assistant of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "profile.h"
43#include <QTextCodec>
44#include <QFileInfo>
45#include <QRegExp>
46#include <QDir>
47#include <QList>
48#include <QLibraryInfo>
49
50QT_BEGIN_NAMESPACE
51
52#define QT_TITLE QLatin1String("Qt Reference Documentation")
53#define DESIGNER_TITLE QLatin1String("Qt Designer Manual")
54#define ASSISTANT_TITLE QLatin1String("Qt Assistant Manual")
55#define LINGUIST_TITLE QLatin1String("Qt Linguist Manual")
56#define QMAKE_TITLE QLatin1String("qmake Manual")
57
58Profile *Profile::createDefaultProfile(const QString &docPath)
59{
60 QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath);
61 if (!docPath.isEmpty())
62 path = docPath;
63 path = QDir::cleanPath(path) + QLatin1String("/html/");
64
65 Profile *profile = new Profile;
66 profile->valid = true;
67 profile->type = DefaultProfile;
68 profile->props[QLatin1String("name")] = QLatin1String("default");
69 profile->props[QLatin1String("applicationicon")] = QLatin1String("assistant.png");
70 profile->props[QLatin1String("aboutmenutext")] = QLatin1String("About Qt");
71 profile->props[QLatin1String("abouturl")] = QLatin1String("about_qt");
72 profile->props[QLatin1String("basepath")] = path;
73 profile->props[QLatin1String("startpage")] = path + QLatin1String("index.html");
74
75 profile->addDCFTitle( path + QLatin1String("qt.dcf"), QT_TITLE );
76 profile->addDCFTitle( path + QLatin1String("designer.dcf"), DESIGNER_TITLE );
77 profile->addDCFTitle( path + QLatin1String("assistant.dcf"), ASSISTANT_TITLE );
78 profile->addDCFTitle( path + QLatin1String("linguist.dcf"), LINGUIST_TITLE );
79 profile->addDCFTitle( path + QLatin1String("qmake.dcf"), QMAKE_TITLE );
80
81 profile->addDCFIcon( QT_TITLE, QLatin1String("qt.png") );
82 profile->addDCFIcon( DESIGNER_TITLE, QLatin1String("designer.png") );
83 profile->addDCFIcon( ASSISTANT_TITLE, QLatin1String("assistant.png") );
84 profile->addDCFIcon( LINGUIST_TITLE, QLatin1String("linguist.png") );
85
86 profile->addDCFIndexPage( QT_TITLE, path + QLatin1String("index.html") );
87 profile->addDCFIndexPage( DESIGNER_TITLE, path + QLatin1String("designer-manual.html") );