To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra
all over the place.
Change-Id: I4bfef62e73275a991455141671d6071162788e9d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This doesn't fix the issue with cleaning the clear state of undo stack.
This introduced the issue when ui file is opened it's marked as modified.
It reverts 59c90e00c1
and d0c537ca75
Change-Id: Ifd4ff8483d6c297461632de500a4502b1fd0871f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
In case when the user has chosen not to reload the file.
Task-number: QTCREATORBUG-17048
Change-Id: I4eb78af2dbc655ab5e0f3fa19f506aa2302d7877
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Use fileDialogInitialDirectory() for all of them.
Conditionally initialize lastVisitedDirectory to projects directory to
preserve existing behavior on Open, when no project is open yet.
Change-Id: I318a7c7741e70a68758f0cc068ce956135103f3f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Use ApplicationState and ApplicationStateChange event instead of
deprecated ApplicationActivate event and unreliable
QApplication::activeWindow(). That fixes an issue where the file change
dialog was not shown after closing a modal dialog on Linux, because
there the activeWindow is temporarily set to 0 for some reason.
Also avoid excessive timer. Modifying a file that is open in Qt Creator
should not result in the system waking up 5 times a second afterwards.
Task-number: QTCREATORBUG-15687
Change-Id: I105d08cd590cc3c8ee5d8efdc568ad5fd2be0857
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
To fallbackSaveAsPath and fallbackSaveAsFileName. That makes it clearer
what they are for, and that they actually belong to each other.
Change-Id: Ie5b83b9db77d39a7fe9e979cc8f22b7f5b9101a3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
When saving a version controlled file, a new version might be created.
Therefore, ensure that the current file version is being monitored.
Change-Id: Icad41bc5a443561de0c0e878aa893913dc674173
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Needed for a test in ClangCodeModel in order to avoid a blocking pop-up
dialog.
Change-Id: I5a337cfcbf514052681f1941845a995d2a5856ac
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Treat documents without path as temporary when trying to come up
with a directory to open the file dialog in.
Task-number: QTCREATORBUG-14131
Change-Id: I266fe6608b7c98b479f86412a0892413e1b99bb2
Reviewed-by: Eike Ziller <eike.ziller@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: I5c6690f51488bf8ca3610ba9fb11e6e5fd814aaa
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Internal paths are supposed to be normalized
Change-Id: Ic6943ce13ad389dfdb44054a9e6f03da8c6cd88d
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This can for example happen when doing interactive git rebases.
* When a file was changed after we reloaded it, but before we removed
+readded the watcher, we wouldn't get a notification for these changes.
* When we got a file changed notification while we were in checkForReload
(because of event processing of the dialog, or file loading), the
notification was dropped and only processes when a check was triggered
again (e.g. at window activation, or when some (other) file changed)
Change-Id: Iab1861a8f05c739a3405bc1afe90ae6f2145057b
Task-number: QTCREATORBUG-9745
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
The project dir defaults to the home directory.
Task-number: QTCREATORBUG-13366
Change-Id: I5a34ae458cacde9e12df50e0796ca7d236bb123e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Move exported class out of namespace Internal, but expose only a minimal
interface. Use Qt 5 connections, adjust callers and surrounding code.
Change-Id: I52b4156d78cd1ec42ec6c94994775ce74f24ebdc
Reviewed-by: hjk <hjk121@nokiamail.com>
This eliminates a bunch of list->set->list conversions. Especially the
ProjectInfo::appendProjectPart takes lots of time converting for every
part added.
Change-Id: Ib3c8cd4b0ad6c012ccbeed12ebedd46b9b6cca95
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Less typing and less cycles than join(QString) where appropriate
Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
It was closing all existing editors and opening a single new one in the
"current" split.
Instead, open new editors in all splits where the file was open and
visible.
Change-Id: Iac7238077b2e42937ce54eea65fa1b61dcd07df1
Reviewed-by: David Schulz <david.schulz@digia.com>
Currently we pass in some places by value, elsewhere by const ref and
for some weird reason also by const value in a lot of places. The latter
is particularly annoying, as it is also used in interfaces and therefore
forces all implementors to do the same, since leaving the "const" off is
causing compiler warnings with MSVC.
Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803
Reviewed-by: hjk <hjk121@nokiamail.com>
We have fileNameCaseSensitivity and withExecutableSuffix et al.
Change-Id: I79bd2cd57e258c3f15673a661a49bab597d7afa4
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This broke when introducing delayed setting of the currentEditor when
the context changes. Simply move the logic from the document manager to
the editor manager, where it arguably belongs to anyway, and also set
the currentFile delayed in that case.
Task-number: QTCREATORBUG-12264
Change-Id: I67ee3f9a02e62cfa67671629c956a4290361cba8
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
Move item model implementation to private, adjust user code.
Change-Id: Ifbe94e7c7b9b1e8be1b4c531958dbd7a9413af13
Reviewed-by: Eike Ziller <eike.ziller@digia.com>