It is unused. Also remove singleProjectAdded signal, and replace
the only use with the projectAdded signal.
The singleProjectAdded signal was emitted for each project that was
ever added, simply because nobody ever used addProjects(...) with
more than one project.
Change-Id: I5aee315c64a2cfb721471d580989a6a02d44fefc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Makes it more uniform to use and allows placeholder widget
creation to be independent of mode creations.
Change-Id: I4021bc9db7f8c78f0374c0cc3b3331506959afe4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Add setDocument method, implement document method, use this in all
projects.
Change-Id: I5018bf7c2739665c13eee340184ce7c41fd319bb
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Force Project Mode if the startup project is in need to be configured after
a session is loaded.
Task-number: QTCREATORBUG-15228
Change-Id: I625a9485c5233ff717be20fd2c14c85a3b9275e3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This is far from perfect but seems to work. Further work could add more
fine grained control over which projects are affected by the automatic
synchronize. Also there might be a few cases where the switching is
over zealous or missing.
Change-Id: I26ad3d59431251564917e4b408c66695dc454823
Task-number: QTCREATORBUG-5823
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Instead, switch to edit mode, show sidebar, scroll to project,
and show a tooltip next to the project.
The tooltip is somewhat easy to miss, but this is a clear improvement
in most cases.
Change-Id: Icd27f76e7d434f33e731b6fd56473ff913986a89
Task-number: QTCREATORBUG-8422
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
On switching sessions don't unload projects that are in both
sessions.
Change-Id: Iceceea262677ab523f8c3c9d2dda64faa34d6e0d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Fixes a crash on session restore for Eike. Iterating over
a const & of the list is dangerous while projects are
added to the list.
Change-Id: I1861b7f1875420769c2493fb0b4012728380efd2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This was caused by the PersistentSettingsWriter writing the old
session on being deleted. Which was after we removed the file.
So delete the PersistentSettingsReader earlier.
Change-Id: I7e73775cc1c2e31b2f2a567b1d08efefdb3ee949
Task-number: QTCREATORBUG-14285
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This avoids unnecessary detaches of the Qt container data.
The mismatches where detected by defining QT_STRICT_ITERATORS;
however, this define violates the ODR (causing linker errors),
and therefore is not added permanently.
Change-Id: Idd336a9c8b394214a820437ef1b92d2101f6101c
GPush-Base: 62b0848b9c
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
With the recent fix for restoring the mode when restoring sessions
(0d10ecd668), it would save and later
restore Welcome mode when switching sessions on Welcome mode.
Change-Id: I285dc1f25734b8358ca04cfdb887aafa93576c3d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Following 73616849, it is dangerous to store a reference to the rvalue of
toString(), since it might become dangling.
Example:
FileName foo() { return FileName::fromString(QLatin1String("/some/file")); }
void func()
{
const QString &fileName = foo().toString();
// fileName is now a dangling reference
}
Change-Id: I5dfad5dc8dd568a0a3c8f9f71ad93292dc26cbbe
Reviewed-by: hjk <hjk@theqtcompany.com>
The OS X linker makes using dynamic_casts across shared object
boundaries fail, so do all casting in the projectexplorer library
and provide functions to do it.
Task-number: QTCREATORBUG-13864
Change-Id: I0e13c0986f8342d83c3b838ffdd2dd7b8312b13c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This is a first, self-contained step only: Replac the connects
themselves, rename private slots that coincide with
signal names, apply minimal compile fixes and formatting.
Change-Id: I0a28d2ebcf4d4f6fdf68a06f582ed962ed54724d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I1d05d48b23f44e3d589cc2a790803714786b57d2
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
The idea behind NodesWatcher was that it was the central place
to catch node related signals, so that users didn't need to
connect to each individual node and the nodes didn't need to
be QObjects. Somehow Nodes ended up being QObjects anyway.
Both the recently added ProjectTree and the FlatModels consume
the signals the NodesWatcher sends. Unfortunately there's a
ordering dependency between the ProjectTree and the FlatModels.
This patch removes all NodesWatcher and instead makes the
ProjectTree singleton the emitter of various project tree
related signals. The ProjectTree also ensures that the ordering
between the FlatModel and itself is taken into account.
And it makes Node not derive from QObject, saving some memory
in that process.
Task-number: QTCREATORBUG-13756
Change-Id: I8b0d357863f1dc1d2d440ce8172502594138b9fb
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Centralize the handling inside a new class ProjectTree.
React to moving focus and remove most special handling.
This properly fixes the linked task.
Task-number: QTCREATORBUG-13357
Change-Id: I6b06aa32b1e4305ec8a6d432857b302585d8734b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
So far editors were only configured on opening, which meant that if a
project was opened after the file was already open, the editor settings
were wrong. This commit fixes that by connecting to project opening.
Also due to changes in how qmake projects are parsed on initial opening
the project has a empty filelist. Connecting to fileListChanged() fixes
that too.
Task-number: QTCREATORBUG-13299
Change-Id: Ia648818c8c0adb9c6e5047b8c855b1f6790a7ae2
Reviewed-by: David Schulz <david.schulz@digia.com>
This can use the faster route through QFileInfo::exist now.
Change-Id: Idb41b5d5185d7f02eacba498fb01f483d95e8d57
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
The only project manager that actually sometimes changes the displayname
is the cmake project manager. And that one failed to emit the right
signal. And since the signal was never emitted a few places handled the
signal wrongly.
Change-Id: I4aa75dc3032efe49263143dbadb7585a378b9be9
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Takes a member (function) pointer and a value and returns a functor,
that takes a instance of the mfp's class and returns whether it's equal
to value. Sounds complicated, but is a common pattern that is easy to
understand.
Change-Id: Iaaeb90488d34ddfd6940dadd4c66705381198fee
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Add Utils::transform and anyOf that take a member function pointer.
Remove bestElementOr it's unused.
Use declval<T> in transform's return type, because msvc does evaluate
T() and for types that don't have simple constructor this fails.
Add std::remove_reference since decltype returns a reference for
lvalues.
Change-Id: I22248b226748eeb27af0d300182d574438d7f756
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
If there are multiple file nodes for the same file, check in how many
project views they are expanded and select the one that is expanded
in most.
Task-number: QTCREATORBUG-12595
Change-Id: Ic4a640a80b8244b30b8dec62248aebeeaf9216cf
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>