...
 
Commits (77)
......@@ -22,6 +22,7 @@ General
* Reworked the projects pane
* Made the welcome screen tabs into plugins, reimplement IWelcomePage
to add your own welcome screen page
* Overhauled the project pane.
Editing
* Added support for text editor color schemes
......@@ -36,14 +37,19 @@ Editing
* Handle block selection in fakevim
* Added Copy full path to the editors combobox
* Added left/right arrow buttons for "Go back/forward" in navigation history
* Added smart indentation for pasted text blocks
Refactoring
* Added rename symbol under cursor
* Find usages of a symbol
Project support
* Added support for adding and removing files from a generic Makefile-based
project
* Added better control over the environment used for running.
* Add all cmake files to the project tree (only works with a cvs cmake)
* Support cmake with Microsoft Visual Studio Compiler (only works with cvs
cmake)
* Add all cmake files to the project tree (only works with a cmake 2.8)
* Support cmake with Microsoft Visual Studio Compiler (only works with
cmake 2.8 )
* Fix a few cmake wizard bugs, where canceling left creator in a strange
state
* The qmake and make steps can now be removed.
......@@ -53,6 +59,9 @@ Project support
* Show subdirectory structure below .pro/.pri files in project tree
* Add "Show file in Finder/Explorer" (Mac/Windows) to context menu.
On Linux it opens the containing directory.
* The qmake step and make step can be removed from qt projects now.
* Made importing build settings for qt projects more robust
* Only run qmake, if it needs to be run.
Compilation
* Support multi-core compilation on Windows/MSVC via jom
......@@ -63,19 +72,25 @@ Debugging
* CDB: Added more types to the dumpers (QSharedPointer, QVector, common
QMap/QSet types), dereference reference and pointer parameters
* CDB: Simplified display of STL types in the locals window
* CDB: Fixed thread handling
* CDB: Fixed thread handling, display thread position
* CDB: Added internal dumpers for string types for debuggee crashes
* CDB: Set symbol paths correctly
* Improved QObject dumping, print out QRect/QSize, enumerations and flags
* Made it possible to use the BinEditor plugin for displaying raw memory
* Replace disassembler window by a real text editor enabling "mixed" output
* Improved dumper building on options page, run in background
Designer
* Added support for rearranging and floating form editor tools
Version control plugins
* Added CVS support
* Display diff/annotation with correct encoding
* Added "sync" menu item to the Perforce plugin
* Fixed locking of temporary submit message files on Windows
* Use a single, colored output pane for all version control systems
* Position annotation view of file at current line of editor
Wizards
* Fixed GUI project and form class wizards to use the same settings.
* Added version control checkout wizards
......@@ -88,6 +103,9 @@ Platform Specific
Mac
* Make use of system's language settings
Symbian Target
* Preliminary support for targeting Qt for Symbian applications
Additional credits go to:
* Christian Hoenig (Locator filter for symbols in current document)
* Henrik Abelsson (Configure what to do with externally modified files)
......
......@@ -348,7 +348,7 @@
\snippet examples/addressbook-sdk/part2/addressbook.h members
We also declare two private QString objects, \c oldName and \c oldAddress.
These objects are needed to hold the name and address of hte contact that
These objects are needed to hold the name and address of the contact that
was last displayed, before the user clicked \gui Add. So, when the user
clicks \gui Cancel, we can revert to displaying the details of the last
contact.
......@@ -529,7 +529,7 @@
\snippet examples/addressbook-sdk/part3/addressbook.cpp enable navigation
We also include these lins of code in the \c cancel() function.
We also include these lines of code in the \c cancel() function.
Recall that we intend to emulate a circularly-linked list with our QMap
object, \c contacts. So in the \c next() function, we obtain an iterator
......@@ -735,7 +735,7 @@
In this chapter, we look at ways to locate contacts and addresses in the
address book application.
# image
\image addressbook-tutorial-part5-screenshot.png
As we keep adding contacts to our address book, it becomes tedious to
navigate them with the \gui Next and \gui Previous buttons. In this case,
......@@ -750,13 +750,14 @@
\section1 Designing The FindDialog
#image
\image addressbook-tutorial-part5-finddialog-in-designer.png
We begin by adding a new \c{.ui} file to our project. Right click on your
We begin by adding a new \c{.ui} file and a corresponding class to our project. Right click on your
project and select \gui{Add New...}. In the \gui{New File} dialog, select
\gui{Qt Designer Form}. In the \gui{Qt Designer Form} dialog, select
\e{Dialog without buttons}. Name it \c{finddialog.ui} and add it to your
project. The \QD plugin within Qt Creator will now display your new form.
\gui{Qt Designer Form Class}. In the \gui{Qt Designer Form Class} dialog, select
\e{Dialog without buttons}. Name the class \c{FindDialog} and add the files it to your
project. Open your new form in the \QD form editor within Qt Creator by
double-clicking on the \c{finddialog.ui} file in the \gui{Project Sidebar}.
To replicate the screenshot above, we need a label, a line edit, and a push
button. Drag these onto your form. Set their text accordingly and name them
......@@ -781,17 +782,6 @@
\snippet examples/addressbook-sdk/part5/finddialog.cpp constructor
We connect our signals to their respective slots. Notice that
\c{findButton}'s \l{QPushButton:}{clicked()} signal is connected to
\c findClicked() and \l{QDialog::}{accept()}. The \l{QDialog::}{accept()}
slot provided by QDialog hides the dialog and sets the result code to
\l{QDialog::}{Accepted}. We use this function to help \c{AddressBook}'s
\c findContact() function know when the \c FindDialog object has been
closed. We will explain this logic in further detail when discussing the
\c findContact() function.
\image addressbook-tutorial-part5-signals-and-slots.png
In \c findClicked(), we validate to ensure that the user did not click the
\gui Find button without entering a contact's name. Then, we set
\c findText to the search string, extracted from \c lineEdit. After that,
......@@ -799,15 +789,24 @@
\snippet examples/addressbook-sdk/part5/finddialog.cpp findClicked
The \c findText variable has a public getter function, \c getFindText(),
associated with it. Since we only ever set \c findText directly in both
the constructor and in hte \c findClicked() function, we do not create a
setter function to accompany \c getFindText(). Because \c getFindText() is
public, classes instantiating and using \c FindDialog can always access the
search string that the user has entered and accepted.
\c findText() is public, which makes it easy for classes instantiating
and using \c FindDialog to access the search string that the user has entered
and accepted.
\snippet examples/addressbook-sdk/part5/finddialog.cpp findText
Finally, we connect our signals to their respective slots. Notice that
\c{findButton}'s \l{QPushButton::}{clicked()} signal is connected to
\c findClicked(), which calls \l{QDialog::}{accept()} or \l{QDialog::}{reject()}.
The \l{QDialog::}{accept()} slot provided by QDialog hides the dialog
and sets the result code to \l{QDialog::}{Accepted}, while \l{QDialog::}{reject()}
sets it to \l{QDialog::}{Rejected} accordingly. We use this function to help
\c{AddressBook}'s \c findContact() function know when the \c FindDialog object has been
closed. We will explain this logic in further detail when discussing the
\c findContact() function.
\image addressbook-tutorial-part5-signals-and-slots.png
\section1 The AddressBook Class
......@@ -818,7 +817,7 @@
So far, all our address book features have a QPushButton and a
corresponding slot. Similarly, for the \gui Find feature, we have
\c findButton and \c findContact().
\c{ui->findButton} and \c findContact().
\snippet examples/addressbook-sdk/part5/addressbook.h slot definition
......@@ -838,15 +837,17 @@
We start out by displaying the \c FindDialog instance, \c dialog. This is
when the user enters a contact name to look up. Once the user clicks the
dialog's \c findButton, the dialog is hidden and the result code is set to
QDialog::Accepted. THis ensures that our \c if statement is always true.
either QDialog::Accepted or QDialog::Rejected by the FindDialog's
\c findClicked() method. This ensures that we only search for a contact
if the user typed something in the FindDialog's line edit.
We then proceed to extract the search string, which in this case is
\c contactName, using \c{FindDialog}'s \c getFindText() function. If the
\c contactName, using \c{FindDialog}'s \c findText() function. If the
contact exists in our address book, we display it immediately. Otherwise,
we display the QMessageBox shown below to indicate that their search
failed.
# image
\image addressbook-tutorial-part5-dialogbox.png
The concept behind finding a contact only applies for cases where we have
more than two contacts in our address book. Hence, we implement this
......@@ -870,7 +871,7 @@
This chapter covers the file handling features of Qt that we used to write
loading and saving routines for the address book application.
# screenshot
\image addressbook-tutorial-part6-screenshot.png
Although browsing and searching for contacts are useful features, our
address book is not really ready for use until we can save existing
......@@ -910,7 +911,7 @@
the push buttons.
# screenshot of property editor
\image addressbook-tutorial-part6-propertyeditor.png
\section1 The AddressBook Class
......@@ -935,7 +936,7 @@
The file dialog that pops up is displayed in the screenshot below:
#screenshot
\image addressbook-tutorial-part6-savedialog.png
If \c fileName is not empty, we create a QFile object, \c file, with
\c fileName. The QFile object works with QDataStream as QFile is a
......@@ -967,7 +968,7 @@
On Windows, for example, this function pops up a native file dialog, as
shown in the following screenshot.
# screenshot
\image addressbook-tutorial-part6-opendialog.png
If \c fileName is not empty, again, we use a QFile object, \c file, and
attempt to open it in \l{QIODevice::}{ReadOnly} mode. Similar to our
......@@ -989,8 +990,10 @@
validate the data obtained to ensure that the file we read from actually
contains address book contacts. If it does, we display the first contact;
otherwise, we display a QMessageBox to inform the user about the problem.
Lastly, we update the interface to enable and disable the push buttons
accordingly.
Lastly, we connect the \c clicked() signal of the push buttons
with the \c loadFromFile() and \c saveToFile():
\snippet examples/addressbook-sdk/part6/addressbook.cpp connectSlots
*/
......@@ -1014,7 +1017,7 @@
\c exportButton as its \c objectName. The \c toolTip property is set to
\gui{Export as vCard}.
# screenshot
\image addressbook-tutorial-part7-screenshot.png
\section1 The AddressBook Class
......
diff --git a/doc/addressbook-sdk.qdoc b/doc/addressbook-sdk.qdoc
index 0441666..7012ea6 100644
--- a/doc/addressbook-sdk.qdoc
+++ b/doc/addressbook-sdk.qdoc
@@ -139,7 +139,7 @@
\section1 Placing Widgets on The Form
In the \gui{Project Sidebar}, double-click on the \c{addressbook.ui} file.
- The \QD plugin will be launched, allowing you to design your program's user
+ The \QD form editor will be launched, allowing you to design your program's user
interface.
We require two \l{QLabel}s to label the input fields as well as a QLineEdit
@@ -156,6 +156,7 @@
diagram below shows the layout cells and the position of our widgets. Place
your widgets accordingly and save the form by choosing
\gui{File | Save} or using the \key{Ctrl+S} shortcut.
+ (We have to actually layout the widgets in a grid layout, this step seems to be missing to me?)
\image addressbook-tutorial-part1-labeled-screenshot.png
@@ -311,7 +312,7 @@
\snippet examples/addressbook-sdk/part2/addressbook.h slot definition
Since the \c AddressBook class is a subclass of QWidget, Qt Creator
- includes QWidget in the hedaer file.
+ includes QWidget in the header file.
\snippet examples/addressbook-sdk/part2/addressbook.h include
@@ -323,7 +324,7 @@
\snippet examples/addressbook-sdk/part2/addressbook.h members
We also declare two private QString objects, \c oldName and \c oldAddress.
- These objects are needed to hold the name and address of hte contact that
+ These objects are needed to hold the name and address of the contact that
was last displayed, before the user clicked \gui Add. So, when the user
clicks \gui Cancel, we can revert to displaying the details of the last
contact.
@@ -499,7 +500,7 @@
\snippet examples/addressbook-sdk/part3/addressbook.cpp enable navigation
- We also include these lins of code in the \c cancel() function.
+ We also include these lines of code in the \c cancel() function.
Recall that we intend to emulate a circularly-linked list with our QMap
object, \c contacts. So in the \c next() function, we obtain an iterator
@@ -722,11 +723,12 @@
#image
- We begin by adding a new \c{.ui} file to our project. Right click on your
+ We begin by adding a new \c{.ui} file and a corresponding class to our project. Right click on your
project and select \gui{Add New...}. In the \gui{New File} dialog, select
- \gui{Qt Designer Form}. In the \gui{Qt Designer Form} dialog, select
- \e{Dialog without buttons}. Name it \c{finddialog.ui} and add it to your
- project. The \QD plugin within Qt Creator will now display your new form.
+ \gui{Qt Designer Form Class}. In the \gui{Qt Designer Form Class} dialog, select
+ \e{Dialog without buttons}. Name the class \c{FindDialog} and add the files it to your
+ project. Open your new form in the \QD form editor within Qt Creator by
+ double-clicking on the \c{finddialog.ui} file in the \gui{Project Sidebar}.
To replicate the screenshot above, we need a label, a line edit, and a push
button. Drag these onto your form. Set their text accordingly and name them
@@ -759,6 +761,9 @@
\c findContact() function know when the \c FindDialog object has been
closed. We will explain this logic in further detail when discussing the
\c findContact() function.
+ (The above paragraph is not up to date, since clicked() is not connected
+ to accept(). The description of accept() can move below to the implementation
+ of findClicked().)
\image addressbook-tutorial-part5-signals-and-slots.png
@@ -766,17 +771,17 @@
\gui Find button without entering a contact's name. Then, we set
\c findText to the search string, extracted from \c lineEdit. After that,
we clear the contents of \c lineEdit and hide the dialog.
+ (There is no findText member. The description of accept() should move here, together
+ with words about reject.)
\snippet examples/addressbook-sdk/part5/finddialog.cpp findClicked
- The \c findText variable has a public getter function, \c getFindText(),
- associated with it. Since we only ever set \c findText directly in both
- the constructor and in hte \c findClicked() function, we do not create a
- setter function to accompany \c getFindText(). Because \c getFindText() is
+ The \c text of the find dialog's line edit has a public getter function, \c findText(),
+ associated with it. Because \c findText() is
public, classes instantiating and using \c FindDialog can always access the
search string that the user has entered and accepted.
- \snippet examples/addressbook-sdk/part5/finddialog.cpp getFindText
+ \snippet examples/addressbook-sdk/part5/finddialog.cpp findText
\section1 The AddressBook Class
@@ -788,23 +793,9 @@
So far, all our address book features have a QPushButton and a
corresponding slot. Similarly, for the \gui Find feature, we have
- \c findButton and \c findContact().
+ \c {ui->findButton} and \c findContact().
\snippet examples/addressbook-sdk/part5/addressbook.h slot definition
- \dots
- \snippet examples/addressbook-sdk/part5/addressbook.h private members
-
- Lastly, we declare the private variable, \c dialog, which we will use to
- refer to an instance of \c FindDialog.
-
- Once we have instantiated a dialog, we might want to use it more than once;
- using a private variable allows us to refer to it from more than one place
- in the class.
-
- Within the \c AddressBook class's constructor, we insantiate our private
- objects, \c findButton and \c dialog:
-
- \snippet examples/addressbook-sdk/part5/addressbook.cpp private members
Next, we connect the \c{findButton}'s \l{QPushButton::}{clicked()} signal
to \c findContact().
@@ -818,10 +809,12 @@
We start out by displaying the \c FindDialog instance, \c dialog. This is
when the user enters a contact name to look up. Once the user clicks the
dialog's \c findButton, the dialog is hidden and the result code is set to
- QDialog::Accepted. THis ensures that our \c if statement is always true.
+ either QDialog::Accepted or QDialog::Rejected by the FindDialog's
+ \c findClicked() method. This ensures that we only search for a contact
+ if the user typed something in the FindDialog's line edit.
We then proceed to extract the search string, which in this case is
- \c contactName, using \c{FindDialog}'s \c getFindText() function. If the
+ \c contactName, using \c{FindDialog}'s \c findText() function. If the
contact exists in our address book, we display it immediately. Otherwise,
we display the QMessageBox shown below to indicate that their search
failed.
#include <QFileDialog>
#include "addressbook.h"
#include "ui_addressbook.h"
......@@ -31,6 +33,12 @@ AddressBook::AddressBook(QWidget *parent)
SLOT(removeContact()));
connect(ui->findButton, SIGNAL(clicked()), this,
SLOT(findContact()));
//! [connectSlots]
connect(ui->loadButton, SIGNAL(clicked()), this,
SLOT(loadFromFile()));
connect(ui->saveButton, SIGNAL(clicked()), this,
SLOT(saveToFile()));
//! [connectSlots]
setWindowTitle(tr("Simple Address Book"));
}
......@@ -292,7 +300,7 @@ void AddressBook::loadFromFile()
//! [loadFromFile part3]
if (contacts.isEmpty()) {
QMessagebox::information(this, tr("No contacts in file"),
QMessageBox::information(this, tr("No contacts in file"),
tr("The file you are attempting to open contains no contacts."));
} else {
QMap<QString, QString>::iterator i = contacts.begin();
......
#include <QFileDialog>
#include <QTextStream>
#include "addressbook.h"
#include "ui_addressbook.h"
......@@ -348,5 +351,5 @@ void AddressBook::exportAsVCard()
out << "END;VCARD" << "\n";
QMessageBox::information(this, tr("Export Successful"),
tr("\%1\" has been exported as a vCard.").arg(name));
tr("\"%1\" has been exported as a vCard.").arg(name));
}
This diff is collapsed.
......@@ -19,16 +19,16 @@ sources.fileextensions = "qtcreator.qdoc addressbook-sdk.qdoc"
qhp.projects = QtCreator
qhp.QtCreator.file = qtcreator.qhp
qhp.QtCreator.namespace = com.nokia.qtcreator.1293
qhp.QtCreator.namespace = com.nokia.qtcreator.1292
qhp.QtCreator.virtualFolder = doc
qhp.QtCreator.indexTitle = Qt Creator
qhp.QtCreator.indexRoot =
qhp.QtCreator.extraFiles = classic.css \
images/qt-logo.png \
images/qtcreator-screenshots.png
qhp.QtCreator.filterAttributes = qtcreator 1.2.93
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 1.2.93
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 1.2.93
qhp.QtCreator.filterAttributes = qtcreator 1.2.92
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 1.2.92
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 1.2.92
# macros.qdocconf
......@@ -211,5 +211,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
"<td width=\"40%\" align=\"left\">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"20%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \
"<td width=\"40%\" align=\"right\"><div align=\"right\">Qt Creator 1.2.93</div></td>\n" \
"<td width=\"40%\" align=\"right\"><div align=\"right\">Qt Creator 1.2.92</div></td>\n" \
"</tr></table></div></address>"
......@@ -108,3 +108,7 @@ linux-g++-* {
# to prevent checking in code that does not compile on other platforms.
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}
# Handle S60 support: default on Windows, conditionally built on other platforms.
win32:SUPPORT_QT_S60=1
else:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
......@@ -303,48 +303,6 @@
<shortcut id="FormEditor.FormSettings" >
<key value="" />
</shortcut>
<shortcut id="Git.Diff" >
<key value="Alt+G, Alt+D" />
</shortcut>
<shortcut id="Git.Status" >
<key value="Alt+G, Alt+S" />
</shortcut>
<shortcut id="Git.Log" >
<key value="Alt+G, Alt+L" />
</shortcut>
<shortcut id="Git.Blame" >
<key value="" />
</shortcut>
<shortcut id="Git.Undo" >
<key value="Alt+G, Alt+U" />
</shortcut>
<shortcut id="Git.Add" >
<key value="Alt+G, Alt+A" />
</shortcut>
<shortcut id="Git.DiffProject" >
<key value="" />
</shortcut>
<shortcut id="Git.StatusProject" >
<key value="" />
</shortcut>
<shortcut id="Git.LogProject" >
<key value="Alt+G, Alt+K" />
</shortcut>
<shortcut id="Git.UndoProject" >
<key value="" />
</shortcut>
<shortcut id="Git.ShowCommit" >
<key value="" />
</shortcut>
<shortcut id="Git.Commit" >
<key value="Alt+G, Alt+C" />
</shortcut>
<shortcut id="Git.Pull" >
<key value="" />
</shortcut>
<shortcut id="Git.Push" >
<key value="" />
</shortcut>
<shortcut id="Help.Home" >
<key value="" />
</shortcut>
......@@ -390,12 +348,6 @@
<shortcut id="QtScriptEditor.Run" >
<key value="Ctrl+R" />
</shortcut>
<shortcut id="CodePaster.Post" >
<key value="Alt+C, Alt+P" />
</shortcut>
<shortcut id="CodePaster.Fetch" >
<key value="Alt+C, Alt+F" />
</shortcut>
<shortcut id="Debugger.StartExternal" >
<key value="" />
</shortcut>
......@@ -459,57 +411,6 @@
<shortcut id="QtCreator.Mode.Debug" >
<key value="Meta+3" />
</shortcut>
<shortcut id="Perforce.Edit" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Add" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Delete" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Revert" >
<key value="" />
</shortcut>
<shortcut id="Perforce.DiffCurrent" >
<key value="" />
</shortcut>
<shortcut id="Perforce.DiffProject" >
<key value="" />
</shortcut>
<shortcut id="Perforce.DiffAll" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Opened" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Submit" >
<key value="" />
</shortcut>
<shortcut id="Perforce.PendingChanges" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Describe" >
<key value="" />
</shortcut>
<shortcut id="Perforce.AnnotateCurrent" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Annotate" >
<key value="" />
</shortcut>
<shortcut id="Perforce.FilelogCurrent" >
<key value="" />
</shortcut>
<shortcut id="Perforce.Filelog" >
<key value="" />
</shortcut>
<shortcut id="Perforce.SubmitCurrentLog" >
<key value="" />
</shortcut>
<shortcut id="Perforce.DiffSelectedFilesInLog" >
<key value="" />
</shortcut>
<shortcut id="Bookmarks.Toggle" >
<key value="Ctrl+D" />
</shortcut>
......@@ -531,36 +432,6 @@
<shortcut id="Bookmarks.NextDocument" >
<key value="" />
</shortcut>
<shortcut id="TextEditor.SelectEncoding" >
<key value="" />
</shortcut>
<shortcut id="TextEditor.AutoIndentSelection" >
<key value="Ctrl+I" />
</shortcut>
<shortcut id="TextEditor.VisualizeWhitespace" >
<key value="" />
</shortcut>
<shortcut id="TextEditor.TextWrapping" >
<key value="" />
</shortcut>
<shortcut id="TextEditor.UnCommentSelection" >
<key value="Ctrl+/" />
</shortcut>
<shortcut id="TextEditor.DeleteLine" >
<key value="Shift+Del" />
</shortcut>
<shortcut id="TextEditor.UnCollapseAll" >
<key value="" />
</shortcut>
<shortcut id="FindFilter.Files on Disk" >
<key value="" />
</shortcut>
<shortcut id="FindFilter.All Projects" >
<key value="Ctrl+Shift+F" />
</shortcut>
<shortcut id="FindFilter.Current Project" >
<key value="Ctrl+Alt+F" />
</shortcut>
<shortcut id="QtCreator.Pane.Problems" >
<key value="Ctrl+1" />
</shortcut>
......
......@@ -184,8 +184,8 @@
<key>CFBundleIdentifier</key>
<string>com.nokia.qtcreator</string>
<key>CFBundleVersion</key>
<string>1.2.93</string>
<string>1.2.92</string>
<key>CFBundleShortVersionString</key>
<string>1.2.93</string>
<string>1.2.92</string>
</dict>
</plist>
......@@ -34,56 +34,6 @@
using namespace CPlusPlus;
TranslationUnit *_previousUnit;
FastMacroResolver::FastMacroResolver(TranslationUnit *unit, const Snapshot &snapshot)
: _unit(unit), _snapshot(snapshot)
{
const QString fileName = QString::fromUtf8(unit->fileName(), unit->fileNameLength());
QSet<QString> processed;
updateCache(fileName, &processed);
}
bool FastMacroResolver::isMacro(TranslationUnit *unit, unsigned tokenIndex) const
{
if (unit != _unit){
qWarning() << Q_FUNC_INFO << "unexpected translation unit:" << unit->fileName();
return false;
}
const Token &tk = unit->tokenAt(tokenIndex);
if (tk.isNot(T_IDENTIFIER))
return false;
Identifier *id = tk.identifier;
const QByteArray macroName = QByteArray::fromRawData(id->chars(), id->size());
return _cachedMacros.contains(macroName);
}
void FastMacroResolver::updateCache(const QString &fileName, QSet<QString> *processed)
{
if (processed->contains(fileName))
return;
processed->insert(fileName);
if (Document::Ptr doc = _snapshot.value(fileName)) {
const QList<Macro> definedMacros = doc->definedMacros();
for (int i = definedMacros.size() - 1; i != -1; --i) {
const Macro &macro = definedMacros.at(i);
if (macro.isHidden())
_cachedMacros.remove(macro.name());
else
_cachedMacros.insert(macro.name());
}
foreach (const Document::Include &incl, doc->includes())
updateCache(incl.fileName(), processed);
}
}
FastPreprocessor::FastPreprocessor(const Snapshot &snapshot)
: _snapshot(snapshot),
_preproc(this, &_env)
......
......@@ -41,22 +41,6 @@
namespace CPlusPlus {
class CPLUSPLUS_EXPORT FastMacroResolver: public MacroResolver
{
public:
FastMacroResolver(TranslationUnit *unit, const Snapshot &snapshot);
virtual bool isMacro(TranslationUnit *unit, unsigned tokenIndex) const;
private:
void updateCache(const QString &fileName, QSet<QString> *processed);
private:
TranslationUnit *_unit;
Snapshot _snapshot;
QSet<QByteArray> _cachedMacros;
};
class CPLUSPLUS_EXPORT FastPreprocessor: public Client
{
Environment _env;
......
......@@ -30,6 +30,7 @@
#include "LookupContext.h"
#include "ResolveExpression.h"
#include "Overview.h"
#include "CppBindings.h"
#include <CoreTypes.h>
#include <Symbols.h>
......@@ -501,27 +502,86 @@ void LookupContext::expand(Scope *scope,
}
}
Symbol *LookupContext::canonicalSymbol(Symbol *symbol)
static void visibleClassBindings_helper(ClassBinding *classBinding,
QList<ClassBinding *> *allClassBindings,
QSet<ClassBinding *> *processed)
{
Symbol *canonical = symbol;
if (! classBinding)
return;
for (; symbol; symbol = symbol->next()) {
if (symbol->name() == canonical->name())
canonical = symbol;
else if (processed->contains(classBinding))
return;
processed->insert(classBinding);
foreach (ClassBinding *baseClassBinding, classBinding->baseClassBindings)
visibleClassBindings_helper(baseClassBinding, allClassBindings, processed);
allClassBindings->append(classBinding);
}
static QList<ClassBinding *> visibleClassBindings(Symbol *symbol, NamespaceBinding *globalNamespace)
{
QList<ClassBinding *> classBindings;
if (! symbol)
return classBindings;
else if (Class *klass = symbol->asClass()) {
QSet<ClassBinding *> processed;
visibleClassBindings_helper(NamespaceBinding::find(klass, globalNamespace),
&classBindings, &processed);
}
return canonical;
return classBindings;
}
Symbol *LookupContext::canonicalSymbol(const QList<Symbol *> &candidates)
Symbol *LookupContext::canonicalSymbol(Symbol *symbol,
NamespaceBinding *globalNamespace)
{
Symbol *canonicalSymbol = LookupContext::canonicalSymbol(symbol);
if (Identifier *symbolId = canonicalSymbol->identifier()) {
if (symbolId && canonicalSymbol->type()->isFunctionType()) {
Class *enclosingClass = canonicalSymbol->scope()->owner()->asClass();
const QList<ClassBinding *> classBindings = visibleClassBindings(enclosingClass, globalNamespace);
foreach (ClassBinding *baseClassBinding, classBindings) {
if (! baseClassBinding)
continue;
foreach (Class *baseClass, baseClassBinding->symbols) {
if (! baseClass)
continue;
for (Symbol *c = baseClass->members()->lookat(symbolId); c; c = c->next()) {
if (! symbolId->isEqualTo(c->identifier()))
continue;
else if (Function *f = c->type()->asFunctionType()) {
if (f->isVirtual())
return LookupContext::canonicalSymbol(f);
}
}
}
}
}
}
return canonicalSymbol;
}
Symbol *LookupContext::canonicalSymbol(const QList<Symbol *> &candidates,
NamespaceBinding *globalNamespaceBinding)
{
if (candidates.isEmpty())
return 0;
return canonicalSymbol(candidates.first());
return canonicalSymbol(candidates.first(), globalNamespaceBinding);
}
Symbol *LookupContext::canonicalSymbol(const QList<QPair<FullySpecifiedType, Symbol *> > &results)
Symbol *LookupContext::canonicalSymbol(const QList<QPair<FullySpecifiedType, Symbol *> > &results,
NamespaceBinding *globalNamespaceBinding)
{
QList<Symbol *> candidates;
QPair<FullySpecifiedType, Symbol *> result;
......@@ -529,5 +589,37 @@ Symbol *LookupContext::canonicalSymbol(const QList<QPair<FullySpecifiedType, Sym
foreach (result, results)
candidates.append(result.second); // ### not exacly.
return canonicalSymbol(candidates);
return canonicalSymbol(candidates, globalNamespaceBinding);
}
Symbol *LookupContext::canonicalSymbol(Symbol *symbol)
{
Symbol *canonical = symbol;
Class *canonicalClass = 0;
for (; symbol; symbol = symbol->next()) {
if (symbol->identifier() == canonical->identifier()) {
canonical = symbol;
if (Class *klass = symbol->asClass())
canonicalClass = klass;
}
}
if (canonicalClass) {
Q_ASSERT(canonical != 0);
if (canonical->isForwardClassDeclaration())
return canonicalClass; // prefer class declarations when available.
}
if (canonical && canonical->scope()->isClassScope()) {
Class *enclosingClass = canonical->scope()->owner()->asClass();
if (enclosingClass->identifier() == canonical->identifier())
return enclosingClass;
}
return canonical;
}
......@@ -54,9 +54,14 @@ public:
Document::Ptr document(const QString &fileName) const;
Snapshot snapshot() const;
static Symbol *canonicalSymbol(Symbol *symbol);
static Symbol *canonicalSymbol(const QList<Symbol *> &candidates);
static Symbol *canonicalSymbol(const QList<QPair<FullySpecifiedType, Symbol *> > &candidates); // ### FIXME
static Symbol *canonicalSymbol(const QList<Symbol *> &candidates,
NamespaceBinding *globalNamespaceBinding);
static Symbol *canonicalSymbol(Symbol *symbol,
NamespaceBinding *globalNamespaceBinding);
static Symbol *canonicalSymbol(const QList<QPair<FullySpecifiedType, Symbol *> > &candidates,
NamespaceBinding *globalNamespaceBinding);
QList<Symbol *> resolve(Name *name) const
{ return resolve(name, visibleScopes()); }
......@@ -126,6 +131,8 @@ public:
QList<Scope *> *expandedScopes) const;
private:
static Symbol *canonicalSymbol(Symbol *symbol);
QList<Symbol *> resolveQualifiedNameId(QualifiedNameId *q,
const QList<Scope *> &visibleScopes,
ResolveMode mode) const;
......
<plugin name="BinEditor" version="1.2.93" compatVersion="1.2.93">
<plugin name="BinEditor" version="1.2.92" compatVersion="1.2.92">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
......@@ -19,7 +19,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Binary editor component.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.93"/>
<dependency name="TextEditor" version="1.2.93"/>
<dependency name="Core" version="1.2.92"/>
<dependency name="TextEditor" version="1.2.92"/>
</dependencyList>
</plugin>
<plugin name="Bookmarks" version="1.2.93" compatVersion="1.2.93">
<plugin name="Bookmarks" version="1.2.92" compatVersion="1.2.92">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
......@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Bookmarks in text editors.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.93"/>
<dependency name="ProjectExplorer" version="1.2.93"/>
<dependency name="Core" version="1.2.93"/>
<dependency name="TextEditor" version="1.2.92"/>
<dependency name="ProjectExplorer" version="1.2.92"/>
<dependency name="Core" version="1.2.92"/>
</dependencyList>
</plugin>
<plugin name="CMakeProjectManager" version="1.2.93" compatVersion="1.2.93">
<plugin name="CMakeProjectManager" version="1.2.92" compatVersion="1.2.92">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
......@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>CMake support</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.93"/>
<dependency name="ProjectExplorer" version="1.2.93"/>
<dependency name="CppTools" version="1.2.93"/>
<dependency name="CppEditor" version="1.2.93"/>
<dependency name="TextEditor" version="1.2.92"/>
<dependency name="ProjectExplorer" version="1.2.92"/>
<dependency name="CppTools" version="1.2.92"/>
<dependency name="CppEditor" version="1.2.92"/>
</dependencyList>
</plugin>
<plugin name="Core" version="1.2.93" compatVersion="1.2.93">
<plugin name="Core" version="1.2.92" compatVersion="1.2.92">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
......
......@@ -35,7 +35,7 @@ namespace Constants {
#define IDE_VERSION_MAJOR 1
#define IDE_VERSION_MINOR 2
#define IDE_VERSION_RELEASE 93
#define IDE_VERSION_RELEASE 92
#define STRINGIFY_INTERNAL(x) #x
#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
......
......@@ -69,6 +69,17 @@ bool CoreImpl::showOptionsDialog(const QString &group, const QString &page, QWid
return m_mainwindow->showOptionsDialog(group, page, parent);
}
bool CoreImpl::showWarningWithOptions(const QString &title, const QString &text,
const QString &details,
const QString &settingsCategory,
const QString &settingsId,
QWidget *parent)
{
return m_mainwindow->showWarningWithOptions(title, text,
details, settingsCategory,