forked from qt-creator/qt-creator
Merge branch '1.2' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -427,7 +427,7 @@
|
||||
\contentspage {Address Book Tutorial}{Contents}
|
||||
\nextpage {examples/addressbook-sdk/part4}{Chapter 4}
|
||||
\example examples/addressbook-sdk/part3
|
||||
\title Address Book 3 - Navigating between Entries}
|
||||
\title Address Book 3 - Navigating between Entries
|
||||
|
||||
The address book application is now half complete. We need to add some
|
||||
functions to navigate between contacts. But first, we have to decide what
|
||||
@@ -549,7 +549,7 @@
|
||||
\contentspage {Address Book Tutorial}{Contents}
|
||||
\nextpage {examples/addressbook-sdk/part5}{Chapter 5}
|
||||
\example examples/addressbook-sdk/part4
|
||||
\title Address Book 4 - Editing and Removing Addresses}
|
||||
\title Address Book 4 - Editing and Removing Addresses
|
||||
|
||||
In this chapter, we look at ways to modify the contents of contacts stored
|
||||
in the address book application.
|
||||
@@ -710,7 +710,7 @@
|
||||
\contentspage {Address Book Tutorial}{Contents}
|
||||
\nextpage {examples/addressbook-sdk/part6}{Chapter 6}
|
||||
\example examples/addressbook-sdk/part5
|
||||
\title Address Book 5 - Adding a Find Function}
|
||||
\title Address Book 5 - Adding a Find Function
|
||||
|
||||
In this chapter, we look at ways to locate contacts and addresses in the
|
||||
address book application.
|
||||
@@ -751,7 +751,7 @@
|
||||
\contentspage {Address Book Tutorial}{Contents}
|
||||
\nextpage {examples/addressbook-sdk/part7}{Chapter 7}
|
||||
\example examples/addressbook-sdk/part6
|
||||
\title Address Book 6 - Loading and Saving}
|
||||
\title Address Book 6 - Loading and Saving
|
||||
|
||||
*/
|
||||
|
||||
@@ -760,6 +760,6 @@
|
||||
\previouspage Address Book 6 - Loading and Saving
|
||||
\contentspage {Address Book Tutorial}{Contents}
|
||||
\example examples/addressbook-sdk/part7
|
||||
\title Address Book 7 - Additional Features}
|
||||
\title Address Book 7 - Additional Features
|
||||
|
||||
*/
|
||||
|
||||
22
doc/examples/addressbook-sdk/part5/finddialog.cpp
Normal file
22
doc/examples/addressbook-sdk/part5/finddialog.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "finddialog.h"
|
||||
#include "ui_finddialog.h"
|
||||
|
||||
FindDialog::FindDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
m_ui(new Ui::FindDialog)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
FindDialog::~FindDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void FindDialog::findClicked()
|
||||
{
|
||||
}
|
||||
|
||||
QString FindDialog::getFindText()
|
||||
{
|
||||
}
|
||||
29
doc/examples/addressbook-sdk/part5/finddialog.h
Normal file
29
doc/examples/addressbook-sdk/part5/finddialog.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef FINDDIALOG_H
|
||||
#define FINDDIALOG_H
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
namespace Ui {
|
||||
class FindDialog;
|
||||
}
|
||||
|
||||
class FindDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
FindDialog(QWidget *parent = 0);
|
||||
~FindDialog();
|
||||
QString getFindText();
|
||||
|
||||
public slots:
|
||||
void findClicked();
|
||||
|
||||
private:
|
||||
Ui::FindDialog *m_ui;
|
||||
QPushButton *findButton;
|
||||
QLineEdit *lineEdit;
|
||||
QString findText;
|
||||
};
|
||||
|
||||
#endif // FINDDIALOG_H
|
||||
@@ -1,18 +1,59 @@
|
||||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FindDialog</class>
|
||||
<widget class="QDialog" name="FindDialog" >
|
||||
<property name="geometry" >
|
||||
<widget class="QDialog" name="FindDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>486</width>
|
||||
<height>65</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Enter the name of a contact:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="findButton">
|
||||
<property name="text">
|
||||
<string>Find</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>findButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>FindDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>415</x>
|
||||
<y>42</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>385</x>
|
||||
<y>50</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
||||
@@ -1536,8 +1536,9 @@
|
||||
\bold{Display Low Level Data}
|
||||
|
||||
If special debugging of Qt objects fails due to data corruption within the
|
||||
debugged objects, you can switch the special debugging off in the
|
||||
\gui{Debug} menu. This will make the low-level structures visible again.
|
||||
debugged objects, you can switch the debugging helpers off in the
|
||||
\gui{Debugger -> Debugging Helper} options dialog.
|
||||
This will make the low-level structures visible again.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1640,7 +1641,7 @@
|
||||
\row
|
||||
\o
|
||||
\raw HTML
|
||||
System Qt
|
||||
Auto-detected Qt
|
||||
\endraw
|
||||
\target glossary-system-qt
|
||||
\o The version of Qt installed on your system. This is the Qt
|
||||
@@ -1654,7 +1655,7 @@
|
||||
\target glossary-default-qt
|
||||
\o The version of Qt configured in \gui{Tools -> Options -> Qt 4
|
||||
-> Default Qt Version}. This is the Qt version used by your
|
||||
new projects. It defaults to System Qt.
|
||||
new projects. It defaults to the Auto-detected Qt.
|
||||
|
||||
\row
|
||||
\o
|
||||
|
||||
@@ -1359,7 +1359,7 @@ Sollen sie überschrieben werden?</translation>
|
||||
<message>
|
||||
<location line="+11"/>
|
||||
<source>&Tools</source>
|
||||
<translation>&Werkzeuge</translation>
|
||||
<translation>E&xtras</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+5"/>
|
||||
@@ -10283,7 +10283,7 @@ p, li { white-space: pre-wrap; }
|
||||
<font color="#ff0000"><b>No valid Qt version set. Set one in Tools/Options </b></font>
|
||||
</source>
|
||||
<translation>
|
||||
<font color="#ff0000"><b>Es ist keine gültige Qt-Version gesetzt. Setzen Sie sie unter Werkzeuge/Einstellungen</b></font>
|
||||
<font color="#ff0000"><b>Es ist keine gültige Qt-Version gesetzt. Setzen Sie sie unter Extras/Einstellungen</b></font>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -11709,7 +11709,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich
|
||||
<message>
|
||||
<location/>
|
||||
<source>Never</source>
|
||||
<translation>NiemalsZahl</translation>
|
||||
<translation>Niemals</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location/>
|
||||
|
||||
@@ -217,11 +217,13 @@ int main(int argc, char **argv)
|
||||
QTranslator translator;
|
||||
QTranslator qtTranslator;
|
||||
const QString &locale = QLocale::system().name();
|
||||
if (translator.load(QLatin1String("qtcreator_") + locale,
|
||||
QCoreApplication::applicationDirPath()
|
||||
+ QLatin1String(SHARE_PATH "/translations"))) {
|
||||
if (qtTranslator.load(QLatin1String("qt_") + locale,
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
|
||||
const QString &creatorTrPath = QCoreApplication::applicationDirPath()
|
||||
+ QLatin1String(SHARE_PATH "/translations");
|
||||
if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) {
|
||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
const QString &qtTrFile = QLatin1String("qt_") + locale;
|
||||
// Binary installer puts Qt tr files into creatorTrPath
|
||||
if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) {
|
||||
app.installTranslator(&translator);
|
||||
app.installTranslator(&qtTranslator);
|
||||
app.setProperty("qtc_locale", locale);
|
||||
|
||||
@@ -77,7 +77,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
|
||||
|
||||
setStartId(startid);
|
||||
setOption(QWizard::NoCancelButton);
|
||||
setOption(QWizard::NoBackButtonOnStartPage);
|
||||
init();
|
||||
}
|
||||
|
||||
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory,
|
||||
@@ -93,7 +93,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
|
||||
else
|
||||
addPage(new CMakeRunPage(this, CMakeRunPage::Update, buildDirectory));
|
||||
setOption(QWizard::NoCancelButton);
|
||||
setOption(QWizard::NoBackButtonOnStartPage);
|
||||
init();
|
||||
}
|
||||
|
||||
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory,
|
||||
@@ -107,7 +107,13 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
|
||||
m_buildDirectory = oldBuildDirectory;
|
||||
addPage(new ShadowBuildPage(this, true));
|
||||
addPage(new CMakeRunPage(this, CMakeRunPage::Change));
|
||||
init();
|
||||
}
|
||||
|
||||
void CMakeOpenProjectWizard::init()
|
||||
{
|
||||
setOption(QWizard::NoBackButtonOnStartPage);
|
||||
setWindowTitle(tr("CMake Wizard"));
|
||||
}
|
||||
|
||||
CMakeManager *CMakeOpenProjectWizard::cmakeManager() const
|
||||
|
||||
@@ -83,6 +83,7 @@ public:
|
||||
void setArguments(const QStringList &args);
|
||||
ProjectExplorer::Environment environment() const;
|
||||
private:
|
||||
void init();
|
||||
bool existsUpToDateXmlFile() const;
|
||||
bool hasInSourceBuild() const;
|
||||
CMakeManager *m_cmakeManager;
|
||||
|
||||
@@ -162,6 +162,8 @@ int EditorModel::findEditor(IEditor *editor) const
|
||||
|
||||
int EditorModel::findFileName(const QString &filename) const
|
||||
{
|
||||
if (filename.isEmpty())
|
||||
return -1;
|
||||
for (int i = 0; i < m_editors.count(); ++i) {
|
||||
if (m_editors.at(i).fileName() == filename)
|
||||
return i;
|
||||
@@ -300,21 +302,10 @@ QVariant EditorModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
QModelIndex EditorModel::indexOf(IEditor *editor) const
|
||||
{
|
||||
int idx = findEditor(editor);
|
||||
if (idx < 0)
|
||||
return indexOf(editor->file()->fileName());
|
||||
int idx = findEditor(originalForDuplicate(editor));
|
||||
return createIndex(idx, 0);
|
||||
}
|
||||
|
||||
QModelIndex EditorModel::indexOf(const QString &fileName) const
|
||||
{
|
||||
int idx = findFileName(fileName);
|
||||
if (idx >= 0)
|
||||
return createIndex(idx, 0);
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
|
||||
void EditorModel::itemChanged()
|
||||
{
|
||||
emitDataChanged(qobject_cast<IEditor*>(sender()));
|
||||
@@ -588,7 +579,7 @@ void EditorView::setCurrentEditor(IEditor *editor)
|
||||
const int idx = m_container->indexOf(editor->widget());
|
||||
QTC_ASSERT(idx >= 0, return);
|
||||
m_container->setCurrentIndex(idx);
|
||||
m_editorList->setCurrentIndex(m_model->indexOf(editor->file()->fileName()).row());
|
||||
m_editorList->setCurrentIndex(m_model->indexOf(editor).row());
|
||||
updateEditorStatus(editor);
|
||||
updateToolBar(editor);
|
||||
|
||||
|
||||
@@ -100,8 +100,6 @@ public:
|
||||
IEditor *originalForDuplicate(IEditor *duplicate) const;
|
||||
void makeOriginal(IEditor *duplicate);
|
||||
QModelIndex indexOf(IEditor *editor) const;
|
||||
QModelIndex indexOf(const QString &filename) const;
|
||||
|
||||
private slots:
|
||||
void itemChanged();
|
||||
|
||||
|
||||
@@ -427,6 +427,9 @@ QStringList WelcomeMode::tipsOfTheDay()
|
||||
tips.append(tr("If you add <a href=\"qthelp://com.nokia.qtcreator/doc/creator-external-library-handling.html\""
|
||||
">external libraries</a>, Qt Creator will automatically offer syntax highlighting "
|
||||
"and code completion."));
|
||||
tips.append(tr("The code completion is CamelCase-aware. For example, to complete <tt>namespaceUri</tt> "
|
||||
"you can just type <tt>nU</tt> and hit <tt>Ctrl+Space</tt>."));
|
||||
tips.append(tr("You can force code completion at any time using <tt>Ctrl+Space</tt>."));
|
||||
}
|
||||
return tips;
|
||||
}
|
||||
|
||||
@@ -976,7 +976,7 @@ QToolButton:pressed {
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>360</width>
|
||||
<width>340</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
|
||||
@@ -1264,17 +1264,12 @@ void CppCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
|
||||
if (c.isUpper() && !first) {
|
||||
keyRegExp += QLatin1String("[a-z0-9_]*");
|
||||
keyRegExp += c;
|
||||
} else if (m_caseSensitivity == Qt::CaseInsensitive && c.isLower()) {
|
||||
keyRegExp += QLatin1Char('[');
|
||||
keyRegExp += c;
|
||||
keyRegExp += c.toUpper();
|
||||
keyRegExp += QLatin1Char(']');
|
||||
} else {
|
||||
keyRegExp += QRegExp::escape(c);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
const QRegExp regExp(keyRegExp, Qt::CaseSensitive);
|
||||
const QRegExp regExp(keyRegExp, m_caseSensitivity);
|
||||
|
||||
foreach (TextEditor::CompletionItem item, m_completions) {
|
||||
if (regExp.indexIn(item.m_text) == 0) {
|
||||
|
||||
@@ -928,8 +928,8 @@ void GdbEngine::handleAqcuiredInferior()
|
||||
reloadSourceFiles();
|
||||
|
||||
// Reverse debugging. FIXME: Should only be used when available.
|
||||
if (theDebuggerBoolSetting(EnableReverseDebugging))
|
||||
postCommand(_("target record"));
|
||||
//if (theDebuggerBoolSetting(EnableReverseDebugging))
|
||||
// postCommand(_("target record"));
|
||||
|
||||
tryLoadDebuggingHelpers();
|
||||
|
||||
|
||||
@@ -121,9 +121,12 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
QString locale = qApp->property("qtc_locale").toString();
|
||||
if (!locale.isEmpty()) {
|
||||
QTranslator *qtr = new QTranslator(this);
|
||||
qtr->load(QLatin1String("designer_") + locale,
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
qApp->installTranslator(qtr);
|
||||
const QString &creatorTrPath =
|
||||
Core::ICore::instance()->resourcePath() + QLatin1String("/translations");
|
||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
const QString &trFile = QLatin1String("designer_") + locale;
|
||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||
qApp->installTranslator(qtr);
|
||||
}
|
||||
|
||||
error->clear();
|
||||
|
||||
@@ -783,7 +783,8 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
||||
const GitSubmitEditorPanelData &data,
|
||||
const QString &messageFile,
|
||||
const QStringList &checkedFiles,
|
||||
const QStringList &origCommitFiles)
|
||||
const QStringList &origCommitFiles,
|
||||
const QStringList &origDeletedFiles)
|
||||
{
|
||||
if (Git::Constants::debug)
|
||||
qDebug() << "GitClient::addAndCommit:" << repositoryDirectory << checkedFiles << origCommitFiles;
|
||||
@@ -795,9 +796,12 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
||||
if (!synchronousReset(repositoryDirectory, resetFiles.toList()))
|
||||
return false;
|
||||
|
||||
// Re-add all to make sure we have the latest changes
|
||||
if (!synchronousAdd(repositoryDirectory, checkedFiles))
|
||||
return false;
|
||||
// Re-add all to make sure we have the latest changes, but only add those that aren't marked
|
||||
// for deletion
|
||||
QStringList addFiles = checkedFiles.toSet().subtract(origDeletedFiles.toSet()).toList();
|
||||
if (!addFiles.isEmpty())
|
||||
if (!synchronousAdd(repositoryDirectory, addFiles))
|
||||
return false;
|
||||
|
||||
// Do the final commit
|
||||
QStringList args;
|
||||
|
||||
@@ -123,7 +123,8 @@ public:
|
||||
const GitSubmitEditorPanelData &data,
|
||||
const QString &messageFile,
|
||||
const QStringList &checkedFiles,
|
||||
const QStringList &origCommitFiles);
|
||||
const QStringList &origCommitFiles,
|
||||
const QStringList &origDeletedFiles);
|
||||
|
||||
enum StatusResult { StatusChanged, StatusUnchanged, StatusFailed };
|
||||
StatusResult gitStatus(const QString &workingDirectory,
|
||||
|
||||
@@ -614,6 +614,7 @@ void GitPlugin::startCommit()
|
||||
// files to be able to unstage files the user unchecks
|
||||
m_submitRepository = data.panelInfo.repository;
|
||||
m_submitOrigCommitFiles = data.stagedFileNames();
|
||||
m_submitOrigDeleteFiles = data.stagedFileNames("deleted");
|
||||
|
||||
if (Git::Constants::debug)
|
||||
qDebug() << Q_FUNC_INFO << data << commitTemplate;
|
||||
@@ -709,7 +710,8 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor)
|
||||
editor->panelData(),
|
||||
m_changeTmpFile->fileName(),
|
||||
fileList,
|
||||
m_submitOrigCommitFiles);
|
||||
m_submitOrigCommitFiles,
|
||||
m_submitOrigDeleteFiles);
|
||||
}
|
||||
if (closeEditor)
|
||||
cleanChangeTmpFile();
|
||||
|
||||
@@ -173,6 +173,7 @@ private:
|
||||
Core::IVersionControl *m_versionControl;
|
||||
QString m_submitRepository;
|
||||
QStringList m_submitOrigCommitFiles;
|
||||
QStringList m_submitOrigDeleteFiles;
|
||||
QTemporaryFile *m_changeTmpFile;
|
||||
bool m_submitActionTriggered;
|
||||
};
|
||||
|
||||
@@ -63,11 +63,10 @@ GitSubmitEditorWidget *GitSubmitEditor::submitEditorWidget()
|
||||
|
||||
// Utility to add a list of state/file pairs to the model
|
||||
// setting a file type.
|
||||
static void addStateFileListToModel(const QList<CommitData::StateFilePair> &l,
|
||||
static void addStateFileListToModel(const QList<CommitData::StateFilePair> &l,
|
||||
bool checked, FileType ft,
|
||||
VCSBase::SubmitFileModel *model)
|
||||
{
|
||||
|
||||
typedef QList<CommitData::StateFilePair>::const_iterator ConstIterator;
|
||||
if (!l.empty()) {
|
||||
const ConstIterator cend = l.constEnd();
|
||||
|
||||
@@ -141,9 +141,16 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
QString locale = qApp->property("qtc_locale").toString();
|
||||
if (!locale.isEmpty()) {
|
||||
QTranslator *qtr = new QTranslator(this);
|
||||
qtr->load(QLatin1String("assistant_") + locale,
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
qApp->installTranslator(qtr);
|
||||
QTranslator *qhelptr = new QTranslator(this);
|
||||
const QString &creatorTrPath =
|
||||
Core::ICore::instance()->resourcePath() + QLatin1String("/translations");
|
||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
const QString &trFile = QLatin1String("assistant_") + locale;
|
||||
const QString &helpTrFile = QLatin1String("qt_help_") + locale;
|
||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||
qApp->installTranslator(qtr);
|
||||
if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath))
|
||||
qApp->installTranslator(qhelptr);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_WEBKIT
|
||||
@@ -762,12 +769,19 @@ void HelpPlugin::openHelpPage(const QUrl& url)
|
||||
|
||||
void HelpPlugin::openHelpPage(const QString& url)
|
||||
{
|
||||
activateHelpMode();
|
||||
if (m_helpEngine->findFile(url).isValid())
|
||||
if (m_helpEngine->findFile(url).isValid()) {
|
||||
activateHelpMode();
|
||||
m_centralWidget->setSource(url);
|
||||
else {
|
||||
QDesktopServices::openUrl(QLatin1String("http://doc.trolltech.com/latest/")
|
||||
+ url.mid(url.lastIndexOf('/') + 1));
|
||||
} else {
|
||||
// local help not installed, resort to external web help
|
||||
QString urlPrefix;
|
||||
if (url.startsWith("qthelp://com.nokia.qtcreator")) {
|
||||
urlPrefix = QString::fromLatin1("http://doc.trolltech.com/qtcreator-%1.%2/")
|
||||
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR);
|
||||
} else {
|
||||
urlPrefix = QLatin1String("http://doc.trolltech.com/latest/");
|
||||
}
|
||||
QDesktopServices::openUrl(urlPrefix + url.mid(url.lastIndexOf('/') + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user