forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8'
This commit is contained in:
231
dist/changes-2.8.0
vendored
Normal file
231
dist/changes-2.8.0
vendored
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
Qt Creator version 2.8 contains bug fixes and new features.
|
||||||
|
|
||||||
|
There is a total of about 1250 changes by 60 individual contributors.
|
||||||
|
|
||||||
|
The most important changes are listed in this document. For a complete
|
||||||
|
list of changes, see the Git log for the Qt Creator sources that
|
||||||
|
you can check out from the public Git repository. For example:
|
||||||
|
|
||||||
|
git clone git://gitorious.org/qt-creator/qt-creator.git
|
||||||
|
git log --cherry-pick --pretty=oneline v2.7.1..origin/2.8
|
||||||
|
|
||||||
|
General
|
||||||
|
* Moved progress information from mode selector to the bottom-right
|
||||||
|
of the main window
|
||||||
|
* Added option to hide detailed progress information and show
|
||||||
|
summary progress bar instead
|
||||||
|
* Added "-block" command line option that opens files in a running
|
||||||
|
Qt Creator and blocks the command line until the editors are closed
|
||||||
|
* Made mode selector hideable (Window > Show Mode Selector)
|
||||||
|
|
||||||
|
Editing
|
||||||
|
* Added option to open extra editor windows (Window > Split New Window)
|
||||||
|
* Fixed that mouse cursor was hidden when pressing modifier key
|
||||||
|
* Added support for jumping to column with locator and Go to Line menu
|
||||||
|
* Added that clicking on line and column display opens locator with line and column filter
|
||||||
|
(QTCREATORBUG-8811)
|
||||||
|
* Added option to show file encoding next to line and column display
|
||||||
|
(QTCREATORBUG-8376)
|
||||||
|
|
||||||
|
Managing Projects
|
||||||
|
* Fixed opening projects created with wizard even if version control
|
||||||
|
creation fails (QTCREATORBUG-8892)
|
||||||
|
|
||||||
|
Compilers
|
||||||
|
* Fixed detection of PowerPC ABI
|
||||||
|
* Fixed detection of ARM-based Windows CE ABI
|
||||||
|
* Fixed compile output parsers cutting off last character (QTCREATORBUG-9032)
|
||||||
|
* Added support for new warnings and errors in compile output from GCC 4.8
|
||||||
|
|
||||||
|
Devices
|
||||||
|
* Fixed setting default device (QTCREATORBUG-7812)
|
||||||
|
* Added support for configuring Desktop device
|
||||||
|
(for example free ports for debugging)
|
||||||
|
|
||||||
|
QMake Projects
|
||||||
|
* Added support for OBJECTIVE_HEADERS
|
||||||
|
|
||||||
|
CMake Projects
|
||||||
|
* Fixed sorting of build targets
|
||||||
|
* Fixed CXXFLAGS detection when Ninja is used (QTCREATORBUG-9047)
|
||||||
|
|
||||||
|
Qbs Projects
|
||||||
|
* Fixed defines that are passed to the C++ code model
|
||||||
|
* Added install build step
|
||||||
|
* Fixed several issues with project tree
|
||||||
|
* Added run configuration for products in the project
|
||||||
|
* Added building of single files
|
||||||
|
|
||||||
|
Autotools Projects
|
||||||
|
* Added parsing of defines and C++ flags from Makefile
|
||||||
|
|
||||||
|
Generic Projects
|
||||||
|
* Added filtering for files to add instead of only filtering for files to ignore when
|
||||||
|
importing projects (QTCREATORBUG-8805)
|
||||||
|
|
||||||
|
Debugging
|
||||||
|
* GDB
|
||||||
|
* Added option to load system GDB pretty printers
|
||||||
|
* Made adding tasks for missing debug info packages optional
|
||||||
|
(QTCREATORBUG-8949)
|
||||||
|
* CDB
|
||||||
|
* Fixed stepping out of disassembled function
|
||||||
|
* Added warning when debugging release build
|
||||||
|
* Fixed and added nice display of several data types
|
||||||
|
(QPixmap, QChar, 64bit integers in containers, QString in QVariant)
|
||||||
|
* Fixed that debugger would sometimes stop at disabled breakpoints (QTCREATORBUG-9295)
|
||||||
|
* LLDB
|
||||||
|
* Added experimental support
|
||||||
|
* QML
|
||||||
|
* Fixed that a fixed port was used instead of using port from device settings
|
||||||
|
* Added support for IPv6
|
||||||
|
|
||||||
|
Analyzer
|
||||||
|
* Fixed that a fixed port was used instead of using port from device settings
|
||||||
|
* Added support for IPv6
|
||||||
|
* Fixed attaching profiler to QML applications to use kits
|
||||||
|
|
||||||
|
C++ Support
|
||||||
|
* Added refactoring action that moves function definition from header to
|
||||||
|
source (QTCREATORBUG-516)
|
||||||
|
* Added refactoring action that assigns a function return value or new expression
|
||||||
|
to local variable (QTCREATORBUG-9052)
|
||||||
|
* Added refactoring action that adds implementations for pure virtual methods
|
||||||
|
* Fixed parsing of try-catch in constructor initializer (QTCREATORBUG-9064)
|
||||||
|
* Fixed handling of non-arguments in function parameter scope (QTCREATORBUG-8316)
|
||||||
|
* Fixed crash when adding include for undefined identifier in file that
|
||||||
|
has no other include (QTCREATORBUG-8799)
|
||||||
|
* Fixed that system headers were not reparsed when project configuration
|
||||||
|
changes (QTCREATORBUG-9056)
|
||||||
|
* Fixed highlighting for template parameters for function calls
|
||||||
|
* Improved support for anonymous classes
|
||||||
|
(QTCREATORBUG-6497, QTCREATORBUG-8963, QTCREATORBUG-3610, QTCREATORBUG-7579)
|
||||||
|
* Fixed support for typedef of templated typedefs (QTCREATORBUG-8375)
|
||||||
|
* Fixed code completion with 'using' declaration inside functions (QTCREATORBUG-2668)
|
||||||
|
* Fixed highlighting of types when there is 'using Namespace::TypeName' (QTCREATORBUG-7903)
|
||||||
|
|
||||||
|
Python Support
|
||||||
|
* Added an editor with highlighter and indenter
|
||||||
|
* Added file and class wizards
|
||||||
|
|
||||||
|
Diff Viewer
|
||||||
|
* Enabled by default
|
||||||
|
* Added folding of skipped lines
|
||||||
|
* Added folding of files
|
||||||
|
* Added jumping to original file on double-click
|
||||||
|
* Added file list combo box
|
||||||
|
|
||||||
|
Version Control Systems
|
||||||
|
* Added "Select All" to clean dialog
|
||||||
|
* Git
|
||||||
|
* Added new side-by-side diff viewer
|
||||||
|
* Added support for interactive rebase
|
||||||
|
* Added support for updating submodules
|
||||||
|
* Added support for checking out commit
|
||||||
|
* Added continue and abort for operations in progress
|
||||||
|
(rebase, cherry-pick etc.)
|
||||||
|
* Added support for fixing up previous commit
|
||||||
|
* Moved all change related actions to a single dialog
|
||||||
|
* Improved stash handling
|
||||||
|
* Added dialog for pushing to Gerrit
|
||||||
|
* Added tags to branches dialog
|
||||||
|
* Added ability to save repository location for Gerrit
|
||||||
|
* Added graph toggle button for log viewer
|
||||||
|
* ClearCase
|
||||||
|
* Removed useless hijack button for dynamic view
|
||||||
|
|
||||||
|
FakeVim
|
||||||
|
* Fixed movement between views with Ctrl+W, Arrow
|
||||||
|
* Added setting for .vimrc location (QTCREATORBUG-8748)
|
||||||
|
* Fixed z., zz, zb and z- commands
|
||||||
|
* Added support for Vim macro recording
|
||||||
|
|
||||||
|
Platform Specific
|
||||||
|
|
||||||
|
Linux
|
||||||
|
* Made crash handler for debug builds optional
|
||||||
|
|
||||||
|
Qt Support
|
||||||
|
* Fixed that Qt Creator preferred Qt 4 qmake over the system default
|
||||||
|
(QTCREATORBUG-9068)
|
||||||
|
|
||||||
|
QNX
|
||||||
|
* Added warning for too big icons and splash screens
|
||||||
|
* Added more application permissions to bar descriptor editor
|
||||||
|
* Added check for device development mode before deploying
|
||||||
|
* Fixed certificate marshalling with newer BlackBerry NDKs
|
||||||
|
* Added auto-detection of device PIN for new debug tokens (QTCREATORBUG-9062)
|
||||||
|
* Enabled QML debugging for pure QNX devices
|
||||||
|
* Fixed that key generation locked up UI (QTCREATORBUG-9078)
|
||||||
|
* Added option to sign packages when creating them
|
||||||
|
|
||||||
|
Android
|
||||||
|
* Fixed that Android device would show up even when no Android SDK
|
||||||
|
was configured
|
||||||
|
* Added support for mixed C++/QML debugging
|
||||||
|
* Added support for QML profiling
|
||||||
|
* Added more sanity checks for package names (QTCREATORBUG-9200)
|
||||||
|
* Added visual editor for Android manifest files
|
||||||
|
|
||||||
|
Credits for these changes go to:
|
||||||
|
|
||||||
|
Aaron McCarthy
|
||||||
|
Adrien Bustany
|
||||||
|
Alan Alpert
|
||||||
|
Alessandro Portale
|
||||||
|
Andreas Holzammer
|
||||||
|
André Hartmann
|
||||||
|
André Pönitz
|
||||||
|
Andrey M. Tokarev
|
||||||
|
Aurindam Jana
|
||||||
|
Christian Kandeler
|
||||||
|
Christian Stenger
|
||||||
|
Christian Strømme
|
||||||
|
Daniel Teske
|
||||||
|
David Schulz
|
||||||
|
Debao Zhang
|
||||||
|
Dmitry Savchenko
|
||||||
|
Eike Ziller
|
||||||
|
El Mehdi Fekari
|
||||||
|
Erik Verbruggen
|
||||||
|
Eskil Abrahamsen Blomfeldt
|
||||||
|
Fawzi Mohamed
|
||||||
|
Friedemann Kleint
|
||||||
|
Lukas Holecek
|
||||||
|
Hugues Delorme
|
||||||
|
Jaroslaw Kobus
|
||||||
|
Jesper K. Pedersen
|
||||||
|
Jörg Bornemann
|
||||||
|
J-P Nurmi
|
||||||
|
Kai Köhne
|
||||||
|
Knut Petter Svendsen
|
||||||
|
Laurent Montel
|
||||||
|
Leena Miettinen
|
||||||
|
Lorenz Haas
|
||||||
|
Lukas Holecek
|
||||||
|
Marc Mutz
|
||||||
|
Marco Bubke
|
||||||
|
Martin T. H. Sandsmark
|
||||||
|
Michal Klocek
|
||||||
|
Mitch Curtis
|
||||||
|
Montel Laurent
|
||||||
|
Morten Johan Sørvig
|
||||||
|
Nikolai Kosjar
|
||||||
|
Orgad Shaneh
|
||||||
|
Oswald Buddenhagen
|
||||||
|
Pawel Faron
|
||||||
|
Petar Perisin
|
||||||
|
Przemyslaw Gorszkowski
|
||||||
|
Rafael Roquetto
|
||||||
|
Robert Löhning
|
||||||
|
Sergey Belyashov
|
||||||
|
Sergey Shambir
|
||||||
|
Shane Peelar
|
||||||
|
Thiago Macieira
|
||||||
|
Thomas Hartmann
|
||||||
|
Tim Jenssen
|
||||||
|
Timo Jyrinki
|
||||||
|
Tobias Hunger
|
||||||
|
Tobias Nätterlund
|
||||||
|
Tor Arne Vestbø
|
||||||
|
Victor Ostashevsky
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 26 KiB |
@@ -92,8 +92,8 @@
|
|||||||
\image qtcreator-deploy-android.png "Deploy configurations"
|
\image qtcreator-deploy-android.png "Deploy configurations"
|
||||||
|
|
||||||
To copy Qt libraries and files to the project directory and to bundle them
|
To copy Qt libraries and files to the project directory and to bundle them
|
||||||
as part of the APK, select the \gui {Use Qt libraries from device} option
|
as part of the APK, select the \gui {Bundle Qt libraries in APK} option.
|
||||||
and the \gui {Use local Qt libraries} check box. This is the default option
|
This is the default option
|
||||||
when developing with Qt 5.
|
when developing with Qt 5.
|
||||||
|
|
||||||
\section1 Using Ministro to Install Qt Libraries
|
\section1 Using Ministro to Install Qt Libraries
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
created by \QC.
|
created by \QC.
|
||||||
|
|
||||||
To use Ministro to install the Qt libraries, select the
|
To use Ministro to install the Qt libraries, select the
|
||||||
\gui {Use Qt libraries from device} option (without any other options).
|
\gui {Use Ministro service to install Qt} option.
|
||||||
|
|
||||||
This is the default option when developing with Qt 4.
|
This is the default option when developing with Qt 4.
|
||||||
|
|
||||||
@@ -128,11 +128,16 @@
|
|||||||
during development.
|
during development.
|
||||||
|
|
||||||
Select \gui Projects > \gui Run > \gui {Deploy configurations} >
|
Select \gui Projects > \gui Run > \gui {Deploy configurations} >
|
||||||
\gui Details, and then select the \gui {Deploy local Qt libraries} option
|
\gui Details, and then select the
|
||||||
and the \gui {Use local Qt libraries} check box to deploy Qt libraries to
|
\gui {Deploy local Qt libraries to temporary directory} option to deploy
|
||||||
|
Qt libraries to
|
||||||
the \c{/data/local/tmp/qt} folder on the device and to run the application
|
the \c{/data/local/tmp/qt} folder on the device and to run the application
|
||||||
against them.
|
against them.
|
||||||
|
|
||||||
|
To deploy new Qt libraries to the device, select
|
||||||
|
\gui {Clean Temporary Libraries Directory on Device}. The next time you
|
||||||
|
deploy the application, Qt libraries are copied to the device again.
|
||||||
|
|
||||||
\section1 Installing Ministro
|
\section1 Installing Ministro
|
||||||
|
|
||||||
The easiest way to install Ministro is to do it on the device via Google
|
The easiest way to install Ministro is to do it on the device via Google
|
||||||
@@ -143,8 +148,7 @@
|
|||||||
from the Google Market or from the
|
from the Google Market or from the
|
||||||
\l{http://necessitas.kde.org/necessitas/ministro.php}{Ministro} home page.
|
\l{http://necessitas.kde.org/necessitas/ministro.php}{Ministro} home page.
|
||||||
|
|
||||||
Then select the \gui {Install Ministro, system-wide Qt shared
|
Then select \gui {Install Ministro from APK} in \gui Projects > \gui Run >
|
||||||
libraries installer} option in \gui Projects > \gui Run >
|
|
||||||
\gui {Deploy configurations} > \gui Details.
|
\gui {Deploy configurations} > \gui Details.
|
||||||
|
|
||||||
You can use this option also to install any Android package (.apk).
|
You can use this option also to install any Android package (.apk).
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
|
!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
|
||||||
QTCREATOR_PRI_INCLUDED = 1
|
QTCREATOR_PRI_INCLUDED = 1
|
||||||
|
|
||||||
QTCREATOR_VERSION = 2.7.81
|
QTCREATOR_VERSION = 2.7.82
|
||||||
|
|
||||||
isEqual(QT_MAJOR_VERSION, 5) {
|
isEqual(QT_MAJOR_VERSION, 5) {
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Project {
|
|||||||
|
|
||||||
property string ide_version_major: '2'
|
property string ide_version_major: '2'
|
||||||
property string ide_version_minor: '7'
|
property string ide_version_minor: '7'
|
||||||
property string ide_version_release: '81'
|
property string ide_version_release: '82'
|
||||||
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
|
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
|
||||||
property string ide_app_path: qbs.targetOS == "mac" ? "" : "bin"
|
property string ide_app_path: qbs.targetOS == "mac" ? "" : "bin"
|
||||||
property string ide_app_target: qbs.targetOS == "mac" ? "Qt Creator" : "qtcreator"
|
property string ide_app_target: qbs.targetOS == "mac" ? "Qt Creator" : "qtcreator"
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ lldb.SBType.unqualified = lambda self: self.GetUnqualifiedType()
|
|||||||
lldb.SBType.pointer = lambda self: self.GetPointerType()
|
lldb.SBType.pointer = lambda self: self.GetPointerType()
|
||||||
lldb.SBType.code = lambda self: self.GetTypeClass()
|
lldb.SBType.code = lambda self: self.GetTypeClass()
|
||||||
lldb.SBType.sizeof = property(lambda self: self.GetByteSize())
|
lldb.SBType.sizeof = property(lambda self: self.GetByteSize())
|
||||||
lldb.SBType.strip_typedefs = lambda self: self
|
lldb.SBType.strip_typedefs = lambda self: self.GetCanonicalType()
|
||||||
|
|
||||||
def simpleEncoding(typeobj):
|
def simpleEncoding(typeobj):
|
||||||
code = typeobj.GetTypeClass()
|
code = typeobj.GetTypeClass()
|
||||||
@@ -504,6 +504,8 @@ class Dumper:
|
|||||||
self.useLldbDumpers = False
|
self.useLldbDumpers = False
|
||||||
self.ns = ""
|
self.ns = ""
|
||||||
self.autoDerefPointers = True
|
self.autoDerefPointers = True
|
||||||
|
self.useDynamicType = True
|
||||||
|
self.useLoop = True
|
||||||
|
|
||||||
self.currentIName = None
|
self.currentIName = None
|
||||||
self.currentValuePriority = -100
|
self.currentValuePriority = -100
|
||||||
@@ -517,11 +519,13 @@ class Dumper:
|
|||||||
self.currentChildType = None
|
self.currentChildType = None
|
||||||
self.currentChildNumChild = None
|
self.currentChildNumChild = None
|
||||||
|
|
||||||
|
self.executable_ = None
|
||||||
self.charType_ = None
|
self.charType_ = None
|
||||||
self.intType_ = None
|
self.intType_ = None
|
||||||
self.sizetType_ = None
|
self.sizetType_ = None
|
||||||
self.charPtrType_ = None
|
self.charPtrType_ = None
|
||||||
self.voidType_ = None
|
self.voidType_ = None
|
||||||
|
self.isShuttingDown_ = False
|
||||||
|
|
||||||
def extractTemplateArgument(self, typename, index):
|
def extractTemplateArgument(self, typename, index):
|
||||||
level = 0
|
level = 0
|
||||||
@@ -564,12 +568,12 @@ class Dumper:
|
|||||||
|
|
||||||
def intType(self):
|
def intType(self):
|
||||||
if self.intType_ is None:
|
if self.intType_ is None:
|
||||||
self.intType_ = self.target.GetModuleAtIndex(0).FindFirstType('int')
|
self.intType_ = self.target.FindFirstType('int')
|
||||||
return self.intType_
|
return self.intType_
|
||||||
|
|
||||||
def charType(self):
|
def charType(self):
|
||||||
if self.charType_ is None:
|
if self.charType_ is None:
|
||||||
self.charType_ = self.target.GetModuleAtIndex(0).FindFirstType('char')
|
self.charType_ = self.target.FindFirstType('char')
|
||||||
return self.charType_
|
return self.charType_
|
||||||
|
|
||||||
def charPtrType(self):
|
def charPtrType(self):
|
||||||
@@ -578,9 +582,11 @@ class Dumper:
|
|||||||
return self.charPtrType_
|
return self.charPtrType_
|
||||||
|
|
||||||
def voidPtrType(self):
|
def voidPtrType(self):
|
||||||
|
return None
|
||||||
return self.charPtrType() # FIXME
|
return self.charPtrType() # FIXME
|
||||||
|
|
||||||
def voidPtrSize(self):
|
def voidPtrSize(self):
|
||||||
|
return None
|
||||||
return self.charPtrType().GetByteSize()
|
return self.charPtrType().GetByteSize()
|
||||||
|
|
||||||
def sizetType(self):
|
def sizetType(self):
|
||||||
@@ -676,41 +682,44 @@ class Dumper:
|
|||||||
return xrange(min(self.currentMaxNumChild, self.currentNumChild))
|
return xrange(min(self.currentMaxNumChild, self.currentNumChild))
|
||||||
|
|
||||||
def lookupType(self, name):
|
def lookupType(self, name):
|
||||||
#warn("LOOKUP: %s" % self.target.GetModuleAtIndex(0).FindFirstType(name))
|
#warn("LOOKUP: %s" % self.target.FindFirstType(name))
|
||||||
return self.target.GetModuleAtIndex(0).FindFirstType(name)
|
return self.target.FindFirstType(name)
|
||||||
|
|
||||||
def setupInferior(self, args):
|
def setupInferior(self, args):
|
||||||
fileName = args['executable']
|
executable = args['executable']
|
||||||
|
self.executable_ = executable
|
||||||
error = lldb.SBError()
|
error = lldb.SBError()
|
||||||
self.target = self.debugger.CreateTarget(fileName, None, None, True, error)
|
self.target = self.debugger.CreateTarget(executable, None, None, True, error)
|
||||||
if self.target.IsValid():
|
self.listener = self.target.GetDebugger().GetListener()
|
||||||
self.report('state="inferiorsetupok",msg="%s",exe="%s"' % (error, fileName))
|
self.process = self.target.Launch(self.listener, None, None,
|
||||||
else:
|
None, None, None,
|
||||||
self.report('state="inferiorsetupfailed",msg="%s",exe="%s"' % (error, fileName))
|
None, 0, True, error)
|
||||||
|
self.broadcaster = self.process.GetBroadcaster()
|
||||||
|
rc = self.broadcaster.AddListener(self.listener, 15)
|
||||||
|
if rc != 15:
|
||||||
|
warn("ADDING LISTENER FAILED: %s" % rc)
|
||||||
|
|
||||||
self.importDumpers()
|
self.importDumpers()
|
||||||
|
|
||||||
|
if self.target.IsValid():
|
||||||
|
self.report('state="inferiorsetupok",msg="%s",exe="%s"' % (error, executable))
|
||||||
|
else:
|
||||||
|
self.report('state="inferiorsetupfailed",msg="%s",exe="%s"' % (error, executable))
|
||||||
|
|
||||||
|
warn("STATE AFTER LAUNCH: %s" % stateNames[self.process.GetState()])
|
||||||
|
|
||||||
def runEngine(self, _):
|
def runEngine(self, _):
|
||||||
error = lldb.SBError()
|
error = lldb.SBError()
|
||||||
#launchInfo = lldb.SBLaunchInfo(["-s"])
|
|
||||||
#self.process = self.target.Launch(self.listener, None, None,
|
|
||||||
# None, '/tmp/stdout.txt', None,
|
|
||||||
# None, 0, True, error)
|
|
||||||
self.listener = lldb.SBListener("event_Listener")
|
|
||||||
self.process = self.target.Launch(self.listener, None, None,
|
|
||||||
None, None, None,
|
|
||||||
os.getcwd(),
|
|
||||||
lldb.eLaunchFlagExec
|
|
||||||
+ lldb.eLaunchFlagDebug
|
|
||||||
#+ lldb.eLaunchFlagDebug
|
|
||||||
#+ lldb.eLaunchFlagStopAtEntry
|
|
||||||
#+ lldb.eLaunchFlagDisableSTDIO
|
|
||||||
#+ lldb.eLaunchFlagLaunchInSeparateProcessGroup
|
|
||||||
, False, error)
|
|
||||||
self.reportError(error)
|
|
||||||
self.pid = self.process.GetProcessID()
|
self.pid = self.process.GetProcessID()
|
||||||
self.report('pid="%s"' % self.pid)
|
self.report('pid="%s"' % self.pid)
|
||||||
self.report('state="enginerunok"')
|
self.consumeEvents()
|
||||||
|
error = self.process.Continue()
|
||||||
|
self.consumeEvents()
|
||||||
|
self.reportError(error)
|
||||||
|
|
||||||
|
self.report('state="enginerunandinferiorrunok"')
|
||||||
|
|
||||||
|
if self.useLoop:
|
||||||
s = threading.Thread(target=self.loop, args=[])
|
s = threading.Thread(target=self.loop, args=[])
|
||||||
s.start()
|
s.start()
|
||||||
|
|
||||||
@@ -809,15 +818,16 @@ class Dumper:
|
|||||||
self.currentType = str(type)
|
self.currentType = str(type)
|
||||||
self.currentTypePriority = self.currentTypePriority + 1
|
self.currentTypePriority = self.currentTypePriority + 1
|
||||||
|
|
||||||
|
|
||||||
def readRawMemory(self, base, size):
|
def readRawMemory(self, base, size):
|
||||||
error = lldb.SBError()
|
if size == 0:
|
||||||
|
return ""
|
||||||
#warn("BASE: %s " % base)
|
#warn("BASE: %s " % base)
|
||||||
#warn("SIZE: %s " % size)
|
#warn("SIZE: %s " % size)
|
||||||
base = int(base) & 0xFFFFFFFFFFFFFFFF
|
base = int(base) & 0xFFFFFFFFFFFFFFFF
|
||||||
size = int(size) & 0xFFFFFFFF
|
size = int(size) & 0xFFFFFFFF
|
||||||
#warn("BASEX: %s " % base)
|
#warn("BASEX: %s " % base)
|
||||||
#warn("SIZEX: %s " % size)
|
#warn("SIZEX: %s " % size)
|
||||||
|
error = lldb.SBError()
|
||||||
contents = self.process.ReadMemory(base, size, error)
|
contents = self.process.ReadMemory(base, size, error)
|
||||||
return binascii.hexlify(contents)
|
return binascii.hexlify(contents)
|
||||||
|
|
||||||
@@ -1010,18 +1020,26 @@ class Dumper:
|
|||||||
if state != self.eventState:
|
if state != self.eventState:
|
||||||
self.report('state="%s"' % stateNames[state])
|
self.report('state="%s"' % stateNames[state])
|
||||||
self.eventState = state
|
self.eventState = state
|
||||||
#if state == lldb.eStateExited:
|
if state == lldb.eStateExited:
|
||||||
# warn("PROCESS EXITED. %d: %s"
|
if self.isShuttingDown_:
|
||||||
# % (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
self.report('state="inferiorshutdownok"')
|
||||||
|
else:
|
||||||
|
self.report('state="inferiorexited"')
|
||||||
|
self.report('exited={status="%s",desc="%s"}'
|
||||||
|
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
||||||
if type == lldb.SBProcess.eBroadcastBitStateChanged:
|
if type == lldb.SBProcess.eBroadcastBitStateChanged:
|
||||||
#if state == lldb.eStateStopped:
|
|
||||||
self.reportData()
|
self.reportData()
|
||||||
elif type == lldb.SBProcess.eBroadcastBitInterrupt:
|
elif type == lldb.SBProcess.eBroadcastBitInterrupt:
|
||||||
pass
|
pass
|
||||||
elif type == lldb.SBProcess.eBroadcastBitSTDOUT:
|
elif type == lldb.SBProcess.eBroadcastBitSTDOUT:
|
||||||
pass
|
# FIXME: Size?
|
||||||
|
msg = self.process.GetSTDOUT(1024)
|
||||||
|
self.report('output={channel="stdout",data="%s"}'
|
||||||
|
% binascii.hexlify(msg))
|
||||||
elif type == lldb.SBProcess.eBroadcastBitSTDERR:
|
elif type == lldb.SBProcess.eBroadcastBitSTDERR:
|
||||||
pass
|
msg = self.process.GetSTDERR(1024)
|
||||||
|
self.report('output={channel="stdout",data="%s"}'
|
||||||
|
% binascii.hexlify(msg))
|
||||||
elif type == lldb.SBProcess.eBroadcastBitProfileData:
|
elif type == lldb.SBProcess.eBroadcastBitProfileData:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -1127,7 +1145,8 @@ class Dumper:
|
|||||||
|
|
||||||
def listModules(self, args):
|
def listModules(self, args):
|
||||||
result = 'modules=['
|
result = 'modules=['
|
||||||
for module in self.target.modules:
|
for i in xrange(self.target.GetNumModules()):
|
||||||
|
module = self.target.GetModuleAtIndex(i)
|
||||||
result += '{file="%s"' % module.file.fullpath
|
result += '{file="%s"' % module.file.fullpath
|
||||||
result += ',name="%s"' % module.file.basename
|
result += ',name="%s"' % module.file.basename
|
||||||
result += ',addrsize="%s"' % module.addr_size
|
result += ',addrsize="%s"' % module.addr_size
|
||||||
@@ -1146,7 +1165,8 @@ class Dumper:
|
|||||||
moduleName = args['module']
|
moduleName = args['module']
|
||||||
#file = lldb.SBFileSpec(moduleName)
|
#file = lldb.SBFileSpec(moduleName)
|
||||||
#module = self.target.FindModule(file)
|
#module = self.target.FindModule(file)
|
||||||
for module in self.target.modules:
|
for i in xrange(self.target.GetNumModules()):
|
||||||
|
module = self.target.GetModuleAtIndex(i)
|
||||||
if module.file.fullpath == moduleName:
|
if module.file.fullpath == moduleName:
|
||||||
break
|
break
|
||||||
result = 'symbols={module="%s"' % moduleName
|
result = 'symbols={module="%s"' % moduleName
|
||||||
@@ -1174,8 +1194,13 @@ class Dumper:
|
|||||||
def executeStep(self, _ = None):
|
def executeStep(self, _ = None):
|
||||||
self.currentThread().StepInto()
|
self.currentThread().StepInto()
|
||||||
|
|
||||||
|
def shutdownInferior(self, _ = None):
|
||||||
|
self.isShuttingDown_ = True
|
||||||
|
self.process.Kill()
|
||||||
|
|
||||||
def quit(self, _ = None):
|
def quit(self, _ = None):
|
||||||
self.debugger.Terminate()
|
self.report('state="engineshutdownok"')
|
||||||
|
self.process.Kill()
|
||||||
|
|
||||||
def executeStepI(self, _ = None):
|
def executeStepI(self, _ = None):
|
||||||
self.currentThread().StepInstruction(lldb.eOnlyThisThread)
|
self.currentThread().StepInstruction(lldb.eOnlyThisThread)
|
||||||
@@ -1202,8 +1227,9 @@ class Dumper:
|
|||||||
self.currentThread().SetSelectedFrame(args['index'])
|
self.currentThread().SetSelectedFrame(args['index'])
|
||||||
self.reportData()
|
self.reportData()
|
||||||
|
|
||||||
def selectThread(self, thread):
|
def selectThread(self, args):
|
||||||
self.handleCommand("thread select " + thread)
|
self.process.SetSelectedThreadByID(args['id'])
|
||||||
|
self.reportData()
|
||||||
|
|
||||||
def requestModuleSymbols(self, frame):
|
def requestModuleSymbols(self, frame):
|
||||||
self.handleCommand("target module list " + frame)
|
self.handleCommand("target module list " + frame)
|
||||||
@@ -1213,11 +1239,7 @@ class Dumper:
|
|||||||
command = args['command']
|
command = args['command']
|
||||||
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
|
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
|
||||||
success = result.Succeeded()
|
success = result.Succeeded()
|
||||||
if success:
|
|
||||||
output = result.GetOutput()
|
output = result.GetOutput()
|
||||||
error = ''
|
|
||||||
else:
|
|
||||||
output = ''
|
|
||||||
error = str(result.GetError())
|
error = str(result.GetError())
|
||||||
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
||||||
|
|
||||||
@@ -1226,6 +1248,10 @@ class Dumper:
|
|||||||
|
|
||||||
def updateData(self, args):
|
def updateData(self, args):
|
||||||
self.expandedINames = set(args['expanded'].split(','))
|
self.expandedINames = set(args['expanded'].split(','))
|
||||||
|
self.autoDerefPointers = int(args['autoderef'])
|
||||||
|
self.useDynamicType = int(args['dyntype'])
|
||||||
|
# Keep always True for now.
|
||||||
|
#self.passExceptions = args['pe']
|
||||||
self.reportData()
|
self.reportData()
|
||||||
|
|
||||||
def disassemble(self, args):
|
def disassemble(self, args):
|
||||||
@@ -1279,19 +1305,42 @@ class Dumper:
|
|||||||
def execute(self, args):
|
def execute(self, args):
|
||||||
getattr(self, args['cmd'])(args)
|
getattr(self, args['cmd'])(args)
|
||||||
self.report('token="%s"' % args['token'])
|
self.report('token="%s"' % args['token'])
|
||||||
try:
|
if 'continuation' in args:
|
||||||
cont = args['continuation']
|
cont = args['continuation']
|
||||||
self.report('continuation="%s"' % cont)
|
self.report('continuation="%s"' % cont)
|
||||||
except:
|
|
||||||
pass
|
def consumeEvents(self):
|
||||||
|
event = lldb.SBEvent()
|
||||||
|
if self.listener and self.listener.PeekAtNextEvent(event):
|
||||||
|
self.listener.GetNextEvent(event)
|
||||||
|
self.handleEvent(event)
|
||||||
|
|
||||||
|
|
||||||
currentDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
currentDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
||||||
execfile(os.path.join(currentDir, "qttypes.py"))
|
execfile(os.path.join(currentDir, "qttypes.py"))
|
||||||
|
|
||||||
|
|
||||||
def doit():
|
def doit1():
|
||||||
|
|
||||||
db = Dumper()
|
db = Dumper()
|
||||||
|
db.useLoop = False
|
||||||
|
db.report('state="enginesetupok"')
|
||||||
|
|
||||||
|
while True:
|
||||||
|
db.consumeEvents()
|
||||||
|
|
||||||
|
readable, _, _ = select.select([sys.stdin], [], [], 0.1)
|
||||||
|
if sys.stdin in readable:
|
||||||
|
line = raw_input()
|
||||||
|
if line.startswith("db "):
|
||||||
|
db.execute(eval(line[3:]))
|
||||||
|
|
||||||
|
db.consumeEvents()
|
||||||
|
|
||||||
|
def doit2():
|
||||||
|
|
||||||
|
db = Dumper()
|
||||||
|
db.useLoop = True
|
||||||
db.report('state="enginesetupok"')
|
db.report('state="enginesetupok"')
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -1304,9 +1353,9 @@ def doit():
|
|||||||
db.execute(eval(line[3:]))
|
db.execute(eval(line[3:]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def testit():
|
def testit():
|
||||||
db = Dumper()
|
db = Dumper()
|
||||||
|
db.useLoop = False
|
||||||
|
|
||||||
error = lldb.SBError()
|
error = lldb.SBError()
|
||||||
db.target = db.debugger.CreateTarget(sys.argv[2], None, None, True, error)
|
db.target = db.debugger.CreateTarget(sys.argv[2], None, None, True, error)
|
||||||
@@ -1344,4 +1393,4 @@ def testit():
|
|||||||
if len(sys.argv) > 2:
|
if len(sys.argv) > 2:
|
||||||
testit()
|
testit()
|
||||||
else:
|
else:
|
||||||
doit()
|
doit2()
|
||||||
|
|||||||
@@ -83,10 +83,9 @@ void AndroidDeployStep::ctor()
|
|||||||
setDefaultDisplayName(tr("Deploy to Android device"));
|
setDefaultDisplayName(tr("Deploy to Android device"));
|
||||||
m_deployAction = NoDeploy;
|
m_deployAction = NoDeploy;
|
||||||
|
|
||||||
m_useLocalQtLibs = false;
|
|
||||||
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit()))
|
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit()))
|
||||||
if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
|
if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
|
||||||
m_useLocalQtLibs = true;
|
m_deployAction = BundleLibraries;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployStep::init()
|
bool AndroidDeployStep::init()
|
||||||
@@ -118,7 +117,6 @@ bool AndroidDeployStep::init()
|
|||||||
m_apkPathDebug = AndroidManager::apkPath(target(), AndroidManager::DebugBuild).toString();
|
m_apkPathDebug = AndroidManager::apkPath(target(), AndroidManager::DebugBuild).toString();
|
||||||
m_apkPathRelease = AndroidManager::apkPath(target(), AndroidManager::ReleaseBuildSigned).toString();
|
m_apkPathRelease = AndroidManager::apkPath(target(), AndroidManager::ReleaseBuildSigned).toString();
|
||||||
m_buildDirectory = static_cast<Qt4Project *>(target()->project())->rootQt4ProjectNode()->buildDir();
|
m_buildDirectory = static_cast<Qt4Project *>(target()->project())->rootQt4ProjectNode()->buildDir();
|
||||||
m_runQASIPackagePath = m_QASIPackagePath;
|
|
||||||
m_runDeployAction = m_deployAction;
|
m_runDeployAction = m_deployAction;
|
||||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (!tc || tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) {
|
if (!tc || tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) {
|
||||||
@@ -148,15 +146,15 @@ AndroidDeployStep::AndroidDeployAction AndroidDeployStep::deployAction()
|
|||||||
return m_deployAction;
|
return m_deployAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployStep::useLocalQtLibs()
|
|
||||||
{
|
|
||||||
return m_useLocalQtLibs;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AndroidDeployStep::fromMap(const QVariantMap &map)
|
bool AndroidDeployStep::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
m_useLocalQtLibs = map.value(QLatin1String(USE_LOCAL_QT_KEY), false).toBool();
|
|
||||||
m_deployAction = AndroidDeployAction(map.value(QLatin1String(DEPLOY_ACTION_KEY), NoDeploy).toInt());
|
m_deployAction = AndroidDeployAction(map.value(QLatin1String(DEPLOY_ACTION_KEY), NoDeploy).toInt());
|
||||||
|
QVariant useLocalQt = map.value(QLatin1String(USE_LOCAL_QT_KEY));
|
||||||
|
if (useLocalQt.isValid()) { // old settings
|
||||||
|
if (useLocalQt.toBool() && m_deployAction == NoDeploy)
|
||||||
|
m_deployAction = BundleLibraries;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_deployAction == InstallQASI)
|
if (m_deployAction == InstallQASI)
|
||||||
m_deployAction = NoDeploy;
|
m_deployAction = NoDeploy;
|
||||||
return ProjectExplorer::BuildStep::fromMap(map);
|
return ProjectExplorer::BuildStep::fromMap(map);
|
||||||
@@ -165,7 +163,6 @@ bool AndroidDeployStep::fromMap(const QVariantMap &map)
|
|||||||
QVariantMap AndroidDeployStep::toMap() const
|
QVariantMap AndroidDeployStep::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap map = ProjectExplorer::BuildStep::toMap();
|
QVariantMap map = ProjectExplorer::BuildStep::toMap();
|
||||||
map.insert(QLatin1String(USE_LOCAL_QT_KEY), m_useLocalQtLibs);
|
|
||||||
map.insert(QLatin1String(DEPLOY_ACTION_KEY), m_deployAction);
|
map.insert(QLatin1String(DEPLOY_ACTION_KEY), m_deployAction);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
@@ -184,7 +181,7 @@ void AndroidDeployStep::cleanLibsOnDevice()
|
|||||||
QProcess *process = new QProcess(this);
|
QProcess *process = new QProcess(this);
|
||||||
QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber);
|
QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber);
|
||||||
arguments << QLatin1String("shell") << QLatin1String("rm") << QLatin1String("-r") << QLatin1String("/data/local/tmp/qt");
|
arguments << QLatin1String("shell") << QLatin1String("rm") << QLatin1String("-r") << QLatin1String("/data/local/tmp/qt");
|
||||||
connect(process, SIGNAL(finished(int)), this, SLOT(cleanLibsFinished()));
|
connect(process, SIGNAL(finished(int)), this, SLOT(processFinished()));
|
||||||
const QString adb = AndroidConfigurations::instance().adbToolPath().toString();
|
const QString adb = AndroidConfigurations::instance().adbToolPath().toString();
|
||||||
Core::MessageManager::instance()->printToOutputPane(adb + QLatin1String(" ")
|
Core::MessageManager::instance()->printToOutputPane(adb + QLatin1String(" ")
|
||||||
+ arguments.join(QLatin1String(" ")),
|
+ arguments.join(QLatin1String(" ")),
|
||||||
@@ -194,7 +191,7 @@ void AndroidDeployStep::cleanLibsOnDevice()
|
|||||||
delete process;
|
delete process;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidDeployStep::cleanLibsFinished()
|
void AndroidDeployStep::processFinished()
|
||||||
{
|
{
|
||||||
QProcess *process = qobject_cast<QProcess *>(sender());
|
QProcess *process = qobject_cast<QProcess *>(sender());
|
||||||
QTC_ASSERT(process, return);
|
QTC_ASSERT(process, return);
|
||||||
@@ -204,6 +201,31 @@ void AndroidDeployStep::cleanLibsFinished()
|
|||||||
process->deleteLater();
|
process->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AndroidDeployStep::installQASIPackage(const QString &packagePath)
|
||||||
|
{
|
||||||
|
const QString targetArch = AndroidManager::targetArch(target());
|
||||||
|
const QString targetSDK = AndroidManager::targetSDK(target());
|
||||||
|
int deviceAPILevel = targetSDK.mid(targetSDK.indexOf(QLatin1Char('-')) + 1).toInt();
|
||||||
|
QString deviceSerialNumber = AndroidConfigurations::instance().getDeployDeviceSerialNumber(&deviceAPILevel, targetArch);
|
||||||
|
if (!deviceSerialNumber.length()) {
|
||||||
|
Core::MessageManager::instance()->printToOutputPane(tr("Could not run adb. No device found."), Core::MessageManager::NoModeSwitch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProcess *process = new QProcess(this);
|
||||||
|
QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber);
|
||||||
|
arguments << QLatin1String("install") << QLatin1String("-r ") << packagePath;
|
||||||
|
|
||||||
|
connect(process, SIGNAL(finished(int)), this, SLOT(processFinished()));
|
||||||
|
const QString adb = AndroidConfigurations::instance().adbToolPath().toString();
|
||||||
|
Core::MessageManager::instance()->printToOutputPane(adb + QLatin1String(" ")
|
||||||
|
+ arguments.join(QLatin1String(" ")),
|
||||||
|
Core::MessageManager::NoModeSwitch);
|
||||||
|
process->start(adb, arguments);
|
||||||
|
if (!process->waitForFinished(500))
|
||||||
|
delete process;
|
||||||
|
}
|
||||||
|
|
||||||
void AndroidDeployStep::setDeployAction(AndroidDeployStep::AndroidDeployAction deploy)
|
void AndroidDeployStep::setDeployAction(AndroidDeployStep::AndroidDeployAction deploy)
|
||||||
{
|
{
|
||||||
m_deployAction = deploy;
|
m_deployAction = deploy;
|
||||||
@@ -211,18 +233,6 @@ void AndroidDeployStep::setDeployAction(AndroidDeployStep::AndroidDeployAction d
|
|||||||
AndroidManager::updateDeploymentSettings(target());
|
AndroidManager::updateDeploymentSettings(target());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidDeployStep::setDeployQASIPackagePath(const QString &package)
|
|
||||||
{
|
|
||||||
m_QASIPackagePath = package;
|
|
||||||
setDeployAction(InstallQASI);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AndroidDeployStep::setUseLocalQtLibs(bool useLocal)
|
|
||||||
{
|
|
||||||
m_useLocalQtLibs = useLocal;
|
|
||||||
AndroidManager::updateDeploymentSettings(target());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AndroidDeployStep::runCommand(QProcess *buildProc,
|
bool AndroidDeployStep::runCommand(QProcess *buildProc,
|
||||||
const QString &program, const QStringList &arguments)
|
const QString &program, const QStringList &arguments)
|
||||||
{
|
{
|
||||||
@@ -453,17 +463,6 @@ bool AndroidDeployStep::deployPackage()
|
|||||||
AndroidPackageCreationStep::removeDirectory(tempPath);
|
AndroidPackageCreationStep::removeDirectory(tempPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_runDeployAction == InstallQASI) {
|
|
||||||
if (!runCommand(deployProc, AndroidConfigurations::instance().adbToolPath().toString(),
|
|
||||||
AndroidDeviceInfo::adbSelector(m_deviceSerialNumber)
|
|
||||||
<< QLatin1String("install") << QLatin1String("-r ") << m_runQASIPackagePath)) {
|
|
||||||
raiseError(tr("Qt Android smart installer installation failed"));
|
|
||||||
disconnect(deployProc, 0, this, 0);
|
|
||||||
deployProc->deleteLater();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
emit resetDelopyAction();
|
|
||||||
}
|
|
||||||
deployProc->setWorkingDirectory(m_androidDirPath.toString());
|
deployProc->setWorkingDirectory(m_androidDirPath.toString());
|
||||||
|
|
||||||
writeOutput(tr("Installing package onto %1.").arg(m_deviceSerialNumber));
|
writeOutput(tr("Installing package onto %1.").arg(m_deviceSerialNumber));
|
||||||
|
|||||||
@@ -75,9 +75,10 @@ class AndroidDeployStep : public ProjectExplorer::BuildStep
|
|||||||
public:
|
public:
|
||||||
enum AndroidDeployAction
|
enum AndroidDeployAction
|
||||||
{
|
{
|
||||||
NoDeploy,
|
NoDeploy, // use ministro
|
||||||
DeployLocal,
|
DeployLocal,
|
||||||
InstallQASI
|
InstallQASI, // unused old value
|
||||||
|
BundleLibraries
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -89,28 +90,25 @@ public:
|
|||||||
int deviceAPILevel();
|
int deviceAPILevel();
|
||||||
|
|
||||||
AndroidDeployAction deployAction();
|
AndroidDeployAction deployAction();
|
||||||
bool useLocalQtLibs();
|
|
||||||
|
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
void cleanLibsOnDevice();
|
void cleanLibsOnDevice();
|
||||||
|
void installQASIPackage(const QString &packagePath);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setDeployAction(AndroidDeployAction deploy);
|
void setDeployAction(AndroidDeployAction deploy);
|
||||||
void setDeployQASIPackagePath(const QString &package);
|
|
||||||
void setUseLocalQtLibs(bool useLocal);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void done();
|
void done();
|
||||||
void error();
|
void error();
|
||||||
void resetDelopyAction();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
bool deployPackage();
|
bool deployPackage();
|
||||||
void handleBuildOutput();
|
void handleBuildOutput();
|
||||||
void handleBuildError();
|
void handleBuildError();
|
||||||
void cleanLibsFinished();
|
void processFinished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AndroidDeployStep(ProjectExplorer::BuildStepList *bc,
|
AndroidDeployStep(ProjectExplorer::BuildStepList *bc,
|
||||||
@@ -140,7 +138,6 @@ private:
|
|||||||
|
|
||||||
QString m_QASIPackagePath;
|
QString m_QASIPackagePath;
|
||||||
AndroidDeployAction m_deployAction;
|
AndroidDeployAction m_deployAction;
|
||||||
bool m_useLocalQtLibs;
|
|
||||||
|
|
||||||
// members to transfer data from init() to run
|
// members to transfer data from init() to run
|
||||||
QString m_packageName;
|
QString m_packageName;
|
||||||
|
|||||||
@@ -47,21 +47,26 @@ AndroidDeployStepWidget::AndroidDeployStepWidget(AndroidDeployStep *step) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->useLocalQtLibs->setChecked(m_step->useLocalQtLibs());
|
|
||||||
switch (m_step->deployAction()) {
|
switch (m_step->deployAction()) {
|
||||||
|
case AndroidDeployStep::NoDeploy:
|
||||||
|
ui->ministroOption->setChecked(true);
|
||||||
|
break;
|
||||||
case AndroidDeployStep::DeployLocal:
|
case AndroidDeployStep::DeployLocal:
|
||||||
ui->deployQtLibs->setChecked(true);
|
ui->temporaryQtOption->setChecked(true);
|
||||||
|
break;
|
||||||
|
case AndroidDeployStep::BundleLibraries:
|
||||||
|
ui->bundleQtOption->setChecked(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ui->devicesQtLibs->setChecked(true);
|
ui->ministroOption->setChecked(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(m_step, SIGNAL(resetDelopyAction()), SLOT(resetAction()));
|
connect(ui->ministroOption, SIGNAL(clicked()), SLOT(setMinistro()));
|
||||||
connect(ui->devicesQtLibs, SIGNAL(clicked()), SLOT(resetAction()));
|
connect(ui->temporaryQtOption, SIGNAL(clicked()), SLOT(setDeployLocalQtLibs()));
|
||||||
connect(ui->deployQtLibs, SIGNAL(clicked()), SLOT(setDeployLocalQtLibs()));
|
connect(ui->bundleQtOption, SIGNAL(clicked()), SLOT(setBundleQtLibs()));
|
||||||
|
|
||||||
connect(ui->chooseButton, SIGNAL(clicked()), SLOT(setQASIPackagePath()));
|
connect(ui->chooseButton, SIGNAL(clicked()), SLOT(setQASIPackagePath()));
|
||||||
connect(ui->useLocalQtLibs, SIGNAL(stateChanged(int)), SLOT(useLocalQtLibsStateChanged(int)));
|
|
||||||
connect(ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice()));
|
connect(ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,9 +85,8 @@ QString AndroidDeployStepWidget::summaryText() const
|
|||||||
return displayName();
|
return displayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidDeployStepWidget::resetAction()
|
void AndroidDeployStepWidget::setMinistro()
|
||||||
{
|
{
|
||||||
ui->devicesQtLibs->setChecked(true);
|
|
||||||
m_step->setDeployAction(AndroidDeployStep::NoDeploy);
|
m_step->setDeployAction(AndroidDeployStep::NoDeploy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,19 +95,20 @@ void AndroidDeployStepWidget::setDeployLocalQtLibs()
|
|||||||
m_step->setDeployAction(AndroidDeployStep::DeployLocal);
|
m_step->setDeployAction(AndroidDeployStep::DeployLocal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AndroidDeployStepWidget::setBundleQtLibs()
|
||||||
|
{
|
||||||
|
m_step->setDeployAction(AndroidDeployStep::BundleLibraries);
|
||||||
|
}
|
||||||
|
|
||||||
void AndroidDeployStepWidget::setQASIPackagePath()
|
void AndroidDeployStepWidget::setQASIPackagePath()
|
||||||
{
|
{
|
||||||
QString packagePath =
|
QString packagePath =
|
||||||
QFileDialog::getOpenFileName(this, tr("Qt Android Smart Installer"),
|
QFileDialog::getOpenFileName(this, tr("Qt Android Smart Installer"),
|
||||||
QDir::homePath(), tr("Android package (*.apk)"));
|
QDir::homePath(), tr("Android package (*.apk)"));
|
||||||
if (packagePath.length())
|
if (!packagePath.isEmpty())
|
||||||
m_step->setDeployQASIPackagePath(packagePath);
|
m_step->installQASIPackage(packagePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidDeployStepWidget::useLocalQtLibsStateChanged(int state)
|
|
||||||
{
|
|
||||||
m_step->setUseLocalQtLibs(state == Qt::Checked);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AndroidDeployStepWidget::cleanLibsOnDevice()
|
void AndroidDeployStepWidget::cleanLibsOnDevice()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,10 +49,11 @@ public:
|
|||||||
~AndroidDeployStepWidget();
|
~AndroidDeployStepWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void resetAction();
|
void setMinistro();
|
||||||
void setDeployLocalQtLibs();
|
void setDeployLocalQtLibs();
|
||||||
|
void setBundleQtLibs();
|
||||||
|
|
||||||
void setQASIPackagePath();
|
void setQASIPackagePath();
|
||||||
void useLocalQtLibsStateChanged(int);
|
|
||||||
void cleanLibsOnDevice();
|
void cleanLibsOnDevice();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>560</width>
|
<width>678</width>
|
||||||
<height>145</height>
|
<height>155</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -19,91 +19,71 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QRadioButton" name="devicesQtLibs">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Qt Deployment</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="ministroOption">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Use Qt libraries from device</string>
|
<string>Use the external Ministro application to download and maintain Qt libraries.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use Qt libraries from device</string>
|
<string>Use Ministro service to install Qt</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="deployQtLibs">
|
<widget class="QRadioButton" name="temporaryQtOption">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Push local Qt libraries to device.
|
<string>Push local Qt libraries to device. You must have Qt libraries compiled for that platform.
|
||||||
You must have Qt libraries compiled for that platform</string>
|
The APK will not be usable on any other device.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Deploy local Qt libraries</string>
|
<string>Deploy local Qt libraries to temporary directory</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="useLocalQtLibs">
|
<widget class="QRadioButton" name="bundleQtOption">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Check this option to force the application to use local Qt libraries instead of system libraries.</string>
|
<string>Creates a standalone APK.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use local Qt libraries</string>
|
<string>Bundle Qt libraries in APK</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Advanced Actions</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
<widget class="QPushButton" name="cleanLibsPushButton">
|
<widget class="QPushButton" name="cleanLibsPushButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Clean Libs on Device</string>
|
<string>Clean Temporary Libraries Directory on Device</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="1" column="0">
|
||||||
|
<widget class="QPushButton" name="chooseButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Install Ministro from APK</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="installQASI">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Choose and install Ministro system wide Qt shared libraries.
|
|
||||||
This option is useful when you want to try your application on devices which don't have Android Market (e.g. Android Emulator).</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Install Ministro, system-wide Qt shared libraries installer</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="chooseButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Choose APK</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@@ -111,46 +91,16 @@ This option is useful when you want to try your application on devices which don
|
|||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>41</height>
|
<height>40</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections/>
|
||||||
<connection>
|
|
||||||
<sender>installQASI</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>chooseButton</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>119</x>
|
|
||||||
<y>68</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>272</x>
|
|
||||||
<y>64</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>deployQtLibs</sender>
|
|
||||||
<signal>clicked(bool)</signal>
|
|
||||||
<receiver>useLocalQtLibs</receiver>
|
|
||||||
<slot>setChecked(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>138</x>
|
|
||||||
<y>43</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>343</x>
|
|
||||||
<y>44</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -319,8 +319,7 @@ bool AndroidManager::bundleQt(ProjectExplorer::Target *target)
|
|||||||
AndroidRunConfiguration *androidRunConfiguration = qobject_cast<AndroidRunConfiguration *>(runConfiguration);
|
AndroidRunConfiguration *androidRunConfiguration = qobject_cast<AndroidRunConfiguration *>(runConfiguration);
|
||||||
if (androidRunConfiguration != 0) {
|
if (androidRunConfiguration != 0) {
|
||||||
AndroidDeployStep *deployStep = androidRunConfiguration->deployStep();
|
AndroidDeployStep *deployStep = androidRunConfiguration->deployStep();
|
||||||
return deployStep->deployAction() == AndroidDeployStep::NoDeploy
|
return deployStep->deployAction() == AndroidDeployStep::BundleLibraries;
|
||||||
&& deployStep->useLocalQtLibs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -340,9 +339,10 @@ bool AndroidManager::updateDeploymentSettings(ProjectExplorer::Target *target)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
AndroidDeployStep *deployStep = androidRunConfiguration->deployStep();
|
AndroidDeployStep *deployStep = androidRunConfiguration->deployStep();
|
||||||
bool useLocalLibs = deployStep->useLocalQtLibs();
|
AndroidDeployStep::AndroidDeployAction deployAction = deployStep->deployAction();
|
||||||
bool deployQtLibs = deployStep->deployAction() != AndroidDeployStep::NoDeploy;
|
bool useLocalLibs = deployAction == AndroidDeployStep::DeployLocal
|
||||||
bool bundleQtLibs = useLocalLibs && !deployQtLibs;
|
|| deployAction == AndroidDeployStep::BundleLibraries;
|
||||||
|
bool bundleQtLibs = deployAction == AndroidDeployStep::BundleLibraries;
|
||||||
|
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
if (!openManifest(target, doc))
|
if (!openManifest(target, doc))
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ void AndroidPackageCreationStep::checkRequiredLibrariesForRun()
|
|||||||
QMetaObject::invokeMethod(this, "setQtLibs",Qt::BlockingQueuedConnection,
|
QMetaObject::invokeMethod(this, "setQtLibs",Qt::BlockingQueuedConnection,
|
||||||
Q_ARG(QStringList, m_qtLibsWithDependencies));
|
Q_ARG(QStringList, m_qtLibsWithDependencies));
|
||||||
|
|
||||||
QMetaObject::invokeMethod(this, "getBundleInformation");
|
QMetaObject::invokeMethod(this, "getBundleInformation", Qt::BlockingQueuedConnection);
|
||||||
|
|
||||||
emit updateRequiredLibrariesModels();
|
emit updateRequiredLibrariesModels();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,7 +234,8 @@ void AndroidPackageCreationWidget::setQtLibs(QModelIndex, QModelIndex)
|
|||||||
{
|
{
|
||||||
AndroidManager::setQtLibs(m_step->target(), m_qtLibsModel->checkedItems());
|
AndroidManager::setQtLibs(m_step->target(), m_qtLibsModel->checkedItems());
|
||||||
AndroidDeployStep * const deployStep = AndroidGlobal::buildStep<AndroidDeployStep>(m_step->target()->activeDeployConfiguration());
|
AndroidDeployStep * const deployStep = AndroidGlobal::buildStep<AndroidDeployStep>(m_step->target()->activeDeployConfiguration());
|
||||||
if (deployStep->useLocalQtLibs())
|
if (deployStep->deployAction() == AndroidDeployStep::DeployLocal
|
||||||
|
|| deployStep->deployAction() == AndroidDeployStep::BundleLibraries)
|
||||||
AndroidManager::updateDeploymentSettings(m_step->target());
|
AndroidManager::updateDeploymentSettings(m_step->target());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +243,8 @@ void AndroidPackageCreationWidget::setPrebundledLibs(QModelIndex, QModelIndex)
|
|||||||
{
|
{
|
||||||
AndroidManager::setPrebundledLibs(m_step->target(), m_prebundledLibs->checkedItems());
|
AndroidManager::setPrebundledLibs(m_step->target(), m_prebundledLibs->checkedItems());
|
||||||
AndroidDeployStep * const deployStep = AndroidGlobal::buildStep<AndroidDeployStep>(m_step->target()->activeDeployConfiguration());
|
AndroidDeployStep * const deployStep = AndroidGlobal::buildStep<AndroidDeployStep>(m_step->target()->activeDeployConfiguration());
|
||||||
if (deployStep->useLocalQtLibs())
|
if (deployStep->deployAction() == AndroidDeployStep::DeployLocal
|
||||||
|
|| deployStep->deployAction() == AndroidDeployStep::BundleLibraries)
|
||||||
AndroidManager::updateDeploymentSettings(m_step->target());
|
AndroidManager::updateDeploymentSettings(m_step->target());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ AndroidRunner::AndroidRunner(QObject *parent,
|
|||||||
}
|
}
|
||||||
ProjectExplorer::Target *target = runConfig->target();
|
ProjectExplorer::Target *target = runConfig->target();
|
||||||
AndroidDeployStep *ds = runConfig->deployStep();
|
AndroidDeployStep *ds = runConfig->deployStep();
|
||||||
if ((m_useLocalQtLibs = ds->useLocalQtLibs())) {
|
m_useLocalQtLibs = ds->deployAction() == AndroidDeployStep::DeployLocal
|
||||||
|
|| ds->deployAction() == AndroidDeployStep::BundleLibraries;
|
||||||
|
if (m_useLocalQtLibs) {
|
||||||
m_localLibs = AndroidManager::loadLocalLibs(target, ds->deviceAPILevel());
|
m_localLibs = AndroidManager::loadLocalLibs(target, ds->deviceAPILevel());
|
||||||
m_localJars = AndroidManager::loadLocalJars(target, ds->deviceAPILevel());
|
m_localJars = AndroidManager::loadLocalJars(target, ds->deviceAPILevel());
|
||||||
m_localJarsInitClasses = AndroidManager::loadLocalJarsInitClasses(target, ds->deviceAPILevel());
|
m_localJarsInitClasses = AndroidManager::loadLocalJarsInitClasses(target, ds->deviceAPILevel());
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
|
#include <texteditor/texteditorsettings.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -85,7 +86,7 @@ static QByteArray calculateHexPattern(const QByteArray &pattern)
|
|||||||
|
|
||||||
namespace BINEditor {
|
namespace BINEditor {
|
||||||
|
|
||||||
BinEditor::BinEditor(QWidget *parent)
|
BinEditorWidget::BinEditorWidget(QWidget *parent)
|
||||||
: QAbstractScrollArea(parent)
|
: QAbstractScrollArea(parent)
|
||||||
{
|
{
|
||||||
m_bytesPerLine = 16;
|
m_bytesPerLine = 16;
|
||||||
@@ -106,13 +107,20 @@ BinEditor::BinEditor(QWidget *parent)
|
|||||||
m_canRequestNewWindow = false;
|
m_canRequestNewWindow = false;
|
||||||
setFocusPolicy(Qt::WheelFocus);
|
setFocusPolicy(Qt::WheelFocus);
|
||||||
setFrameStyle(QFrame::Plain);
|
setFrameStyle(QFrame::Plain);
|
||||||
|
|
||||||
|
// Font settings
|
||||||
|
TextEditor::TextEditorSettings *settings = TextEditor::TextEditorSettings::instance();
|
||||||
|
setFontSettings(settings->fontSettings());
|
||||||
|
connect(settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
|
||||||
|
this, SLOT(setFontSettings(TextEditor::FontSettings)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BinEditor::~BinEditor()
|
BinEditorWidget::~BinEditorWidget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::init()
|
void BinEditorWidget::init()
|
||||||
{
|
{
|
||||||
const int addressStringWidth =
|
const int addressStringWidth =
|
||||||
2*m_addressBytes + (m_addressBytes - 1) / 2;
|
2*m_addressBytes + (m_addressBytes - 1) / 2;
|
||||||
@@ -162,7 +170,7 @@ void BinEditor::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BinEditor::addData(quint64 block, const QByteArray &data)
|
void BinEditorWidget::addData(quint64 block, const QByteArray &data)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(data.size() == m_blockSize, return);
|
QTC_ASSERT(data.size() == m_blockSize, return);
|
||||||
const quint64 addr = block * m_blockSize;
|
const quint64 addr = block * m_blockSize;
|
||||||
@@ -176,7 +184,7 @@ void BinEditor::addData(quint64 block, const QByteArray &data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::requestDataAt(int pos) const
|
bool BinEditorWidget::requestDataAt(int pos) const
|
||||||
{
|
{
|
||||||
int block = pos / m_blockSize;
|
int block = pos / m_blockSize;
|
||||||
BlockMap::const_iterator it = m_modifiedData.find(block);
|
BlockMap::const_iterator it = m_modifiedData.find(block);
|
||||||
@@ -187,27 +195,27 @@ bool BinEditor::requestDataAt(int pos) const
|
|||||||
return true;
|
return true;
|
||||||
if (!m_requests.contains(block)) {
|
if (!m_requests.contains(block)) {
|
||||||
m_requests.insert(block);
|
m_requests.insert(block);
|
||||||
emit const_cast<BinEditor*>(this)->
|
emit const_cast<BinEditorWidget*>(this)->
|
||||||
dataRequested(editor(), m_baseAddr / m_blockSize + block);
|
dataRequested(m_baseAddr / m_blockSize + block);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::requestOldDataAt(int pos) const
|
bool BinEditorWidget::requestOldDataAt(int pos) const
|
||||||
{
|
{
|
||||||
int block = pos / m_blockSize;
|
int block = pos / m_blockSize;
|
||||||
BlockMap::const_iterator it = m_oldData.find(block);
|
BlockMap::const_iterator it = m_oldData.find(block);
|
||||||
return it != m_oldData.end();
|
return it != m_oldData.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
char BinEditor::dataAt(int pos, bool old) const
|
char BinEditorWidget::dataAt(int pos, bool old) const
|
||||||
{
|
{
|
||||||
int block = pos / m_blockSize;
|
int block = pos / m_blockSize;
|
||||||
return blockData(block, old).at(pos - block*m_blockSize);
|
return blockData(block, old).at(pos - block*m_blockSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::changeDataAt(int pos, char c)
|
void BinEditorWidget::changeDataAt(int pos, char c)
|
||||||
{
|
{
|
||||||
int block = pos / m_blockSize;
|
int block = pos / m_blockSize;
|
||||||
BlockMap::iterator it = m_modifiedData.find(block);
|
BlockMap::iterator it = m_modifiedData.find(block);
|
||||||
@@ -222,10 +230,10 @@ void BinEditor::changeDataAt(int pos, char c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit dataChanged(editor(), m_baseAddr + pos, QByteArray(1, c));
|
emit dataChanged(m_baseAddr + pos, QByteArray(1, c));
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray BinEditor::dataMid(int from, int length, bool old) const
|
QByteArray BinEditorWidget::dataMid(int from, int length, bool old) const
|
||||||
{
|
{
|
||||||
int end = from + length;
|
int end = from + length;
|
||||||
int block = from / m_blockSize;
|
int block = from / m_blockSize;
|
||||||
@@ -239,7 +247,7 @@ QByteArray BinEditor::dataMid(int from, int length, bool old) const
|
|||||||
return data.mid(from - ((from / m_blockSize) * m_blockSize), length);
|
return data.mid(from - ((from / m_blockSize) * m_blockSize), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray BinEditor::blockData(int block, bool old) const
|
QByteArray BinEditorWidget::blockData(int block, bool old) const
|
||||||
{
|
{
|
||||||
if (old) {
|
if (old) {
|
||||||
BlockMap::const_iterator it = m_modifiedData.find(block);
|
BlockMap::const_iterator it = m_modifiedData.find(block);
|
||||||
@@ -251,12 +259,12 @@ QByteArray BinEditor::blockData(int block, bool old) const
|
|||||||
? it.value() : m_data.value(block, m_emptyBlock);
|
? it.value() : m_data.value(block, m_emptyBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setFontSettings(const TextEditor::FontSettings &fs)
|
void BinEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
|
||||||
{
|
{
|
||||||
setFont(fs.toTextCharFormat(TextEditor::C_TEXT).font());
|
setFont(fs.toTextCharFormat(TextEditor::C_TEXT).font());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setBlinkingCursorEnabled(bool enable)
|
void BinEditorWidget::setBlinkingCursorEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable && QApplication::cursorFlashTime() > 0)
|
if (enable && QApplication::cursorFlashTime() > 0)
|
||||||
m_cursorBlinkTimer.start(QApplication::cursorFlashTime() / 2, this);
|
m_cursorBlinkTimer.start(QApplication::cursorFlashTime() / 2, this);
|
||||||
@@ -266,17 +274,17 @@ void BinEditor::setBlinkingCursorEnabled(bool enable)
|
|||||||
updateLines();
|
updateLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::focusInEvent(QFocusEvent *)
|
void BinEditorWidget::focusInEvent(QFocusEvent *)
|
||||||
{
|
{
|
||||||
setBlinkingCursorEnabled(true);
|
setBlinkingCursorEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::focusOutEvent(QFocusEvent *)
|
void BinEditorWidget::focusOutEvent(QFocusEvent *)
|
||||||
{
|
{
|
||||||
setBlinkingCursorEnabled(false);
|
setBlinkingCursorEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::timerEvent(QTimerEvent *e)
|
void BinEditorWidget::timerEvent(QTimerEvent *e)
|
||||||
{
|
{
|
||||||
if (e->timerId() == m_autoScrollTimer.timerId()) {
|
if (e->timerId() == m_autoScrollTimer.timerId()) {
|
||||||
QRect visible = viewport()->rect();
|
QRect visible = viewport()->rect();
|
||||||
@@ -314,7 +322,7 @@ void BinEditor::timerEvent(QTimerEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BinEditor::setModified(bool modified)
|
void BinEditorWidget::setModified(bool modified)
|
||||||
{
|
{
|
||||||
int unmodifiedState = modified ? -1 : m_undoStack.size();
|
int unmodifiedState = modified ? -1 : m_undoStack.size();
|
||||||
if (unmodifiedState == m_unmodifiedState)
|
if (unmodifiedState == m_unmodifiedState)
|
||||||
@@ -323,22 +331,22 @@ void BinEditor::setModified(bool modified)
|
|||||||
emit modificationChanged(m_undoStack.size() != m_unmodifiedState);
|
emit modificationChanged(m_undoStack.size() != m_unmodifiedState);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::isModified() const
|
bool BinEditorWidget::isModified() const
|
||||||
{
|
{
|
||||||
return (m_undoStack.size() != m_unmodifiedState);
|
return (m_undoStack.size() != m_unmodifiedState);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setReadOnly(bool readOnly)
|
void BinEditorWidget::setReadOnly(bool readOnly)
|
||||||
{
|
{
|
||||||
m_readOnly = readOnly;
|
m_readOnly = readOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::isReadOnly() const
|
bool BinEditorWidget::isReadOnly() const
|
||||||
{
|
{
|
||||||
return m_readOnly;
|
return m_readOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::save(QString *errorString, const QString &oldFileName, const QString &newFileName)
|
bool BinEditorWidget::save(QString *errorString, const QString &oldFileName, const QString &newFileName)
|
||||||
{
|
{
|
||||||
if (oldFileName != newFileName) {
|
if (oldFileName != newFileName) {
|
||||||
QString tmpName;
|
QString tmpName;
|
||||||
@@ -381,7 +389,7 @@ bool BinEditor::save(QString *errorString, const QString &oldFileName, const QSt
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setSizes(quint64 startAddr, int range, int blockSize)
|
void BinEditorWidget::setSizes(quint64 startAddr, int range, int blockSize)
|
||||||
{
|
{
|
||||||
int newBlockSize = blockSize;
|
int newBlockSize = blockSize;
|
||||||
QTC_ASSERT((blockSize/m_bytesPerLine) * m_bytesPerLine == blockSize,
|
QTC_ASSERT((blockSize/m_bytesPerLine) * m_bytesPerLine == blockSize,
|
||||||
@@ -423,23 +431,23 @@ void BinEditor::setSizes(quint64 startAddr, int range, int blockSize)
|
|||||||
viewport()->update();
|
viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::resizeEvent(QResizeEvent *)
|
void BinEditorWidget::resizeEvent(QResizeEvent *)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::scrollContentsBy(int dx, int dy)
|
void BinEditorWidget::scrollContentsBy(int dx, int dy)
|
||||||
{
|
{
|
||||||
viewport()->scroll(isRightToLeft() ? -dx : dx, dy * m_lineHeight);
|
viewport()->scroll(isRightToLeft() ? -dx : dx, dy * m_lineHeight);
|
||||||
const QScrollBar * const scrollBar = verticalScrollBar();
|
const QScrollBar * const scrollBar = verticalScrollBar();
|
||||||
const int scrollPos = scrollBar->value();
|
const int scrollPos = scrollBar->value();
|
||||||
if (dy <= 0 && scrollPos == scrollBar->maximum())
|
if (dy <= 0 && scrollPos == scrollBar->maximum())
|
||||||
emit newRangeRequested(editor(), baseAddress() + m_size);
|
emit newRangeRequested(baseAddress() + m_size);
|
||||||
else if (dy >= 0 && scrollPos == scrollBar->minimum())
|
else if (dy >= 0 && scrollPos == scrollBar->minimum())
|
||||||
emit newRangeRequested(editor(), baseAddress());
|
emit newRangeRequested(baseAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::changeEvent(QEvent *e)
|
void BinEditorWidget::changeEvent(QEvent *e)
|
||||||
{
|
{
|
||||||
QAbstractScrollArea::changeEvent(e);
|
QAbstractScrollArea::changeEvent(e);
|
||||||
if (e->type() == QEvent::ActivationChange) {
|
if (e->type() == QEvent::ActivationChange) {
|
||||||
@@ -451,7 +459,7 @@ void BinEditor::changeEvent(QEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BinEditor::wheelEvent(QWheelEvent *e)
|
void BinEditorWidget::wheelEvent(QWheelEvent *e)
|
||||||
{
|
{
|
||||||
if (e->modifiers() & Qt::ControlModifier) {
|
if (e->modifiers() & Qt::ControlModifier) {
|
||||||
const int delta = e->delta();
|
const int delta = e->delta();
|
||||||
@@ -466,7 +474,7 @@ void BinEditor::wheelEvent(QWheelEvent *e)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
QRect BinEditor::cursorRect() const
|
QRect BinEditorWidget::cursorRect() const
|
||||||
{
|
{
|
||||||
int topLine = verticalScrollBar()->value();
|
int topLine = verticalScrollBar()->value();
|
||||||
int line = m_cursorPosition / m_bytesPerLine;
|
int line = m_cursorPosition / m_bytesPerLine;
|
||||||
@@ -481,7 +489,7 @@ QRect BinEditor::cursorRect() const
|
|||||||
return QRect(x, y, w, m_lineHeight);
|
return QRect(x, y, w, m_lineHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BinEditor::posAt(const QPoint &pos) const
|
int BinEditorWidget::posAt(const QPoint &pos) const
|
||||||
{
|
{
|
||||||
int xoffset = horizontalScrollBar()->value();
|
int xoffset = horizontalScrollBar()->value();
|
||||||
int x = xoffset + pos.x() - m_margin - m_labelWidth;
|
int x = xoffset + pos.x() - m_margin - m_labelWidth;
|
||||||
@@ -508,19 +516,19 @@ int BinEditor::posAt(const QPoint &pos) const
|
|||||||
return qMin(m_size, qMin(m_numLines, topLine + line) * m_bytesPerLine) + column;
|
return qMin(m_size, qMin(m_numLines, topLine + line) * m_bytesPerLine) + column;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::inTextArea(const QPoint &pos) const
|
bool BinEditorWidget::inTextArea(const QPoint &pos) const
|
||||||
{
|
{
|
||||||
int xoffset = horizontalScrollBar()->value();
|
int xoffset = horizontalScrollBar()->value();
|
||||||
int x = xoffset + pos.x() - m_margin - m_labelWidth;
|
int x = xoffset + pos.x() - m_margin - m_labelWidth;
|
||||||
return (x > m_bytesPerLine * m_columnWidth + m_charWidth/2);
|
return (x > m_bytesPerLine * m_columnWidth + m_charWidth/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::updateLines()
|
void BinEditorWidget::updateLines()
|
||||||
{
|
{
|
||||||
updateLines(m_cursorPosition, m_cursorPosition);
|
updateLines(m_cursorPosition, m_cursorPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::updateLines(int fromPosition, int toPosition)
|
void BinEditorWidget::updateLines(int fromPosition, int toPosition)
|
||||||
{
|
{
|
||||||
int topLine = verticalScrollBar()->value();
|
int topLine = verticalScrollBar()->value();
|
||||||
int firstLine = qMin(fromPosition, toPosition) / m_bytesPerLine;
|
int firstLine = qMin(fromPosition, toPosition) / m_bytesPerLine;
|
||||||
@@ -531,7 +539,7 @@ void BinEditor::updateLines(int fromPosition, int toPosition)
|
|||||||
viewport()->update(0, y, viewport()->width(), h);
|
viewport()->update(0, y, viewport()->width(), h);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BinEditor::dataIndexOf(const QByteArray &pattern, int from, bool caseSensitive) const
|
int BinEditorWidget::dataIndexOf(const QByteArray &pattern, int from, bool caseSensitive) const
|
||||||
{
|
{
|
||||||
int trailing = pattern.size();
|
int trailing = pattern.size();
|
||||||
if (trailing > m_blockSize)
|
if (trailing > m_blockSize)
|
||||||
@@ -564,7 +572,7 @@ int BinEditor::dataIndexOf(const QByteArray &pattern, int from, bool caseSensiti
|
|||||||
return end == m_size ? -1 : -2;
|
return end == m_size ? -1 : -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int BinEditor::dataLastIndexOf(const QByteArray &pattern, int from, bool caseSensitive) const
|
int BinEditorWidget::dataLastIndexOf(const QByteArray &pattern, int from, bool caseSensitive) const
|
||||||
{
|
{
|
||||||
int trailing = pattern.size();
|
int trailing = pattern.size();
|
||||||
if (trailing > m_blockSize)
|
if (trailing > m_blockSize)
|
||||||
@@ -596,7 +604,7 @@ int BinEditor::dataLastIndexOf(const QByteArray &pattern, int from, bool caseSen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int BinEditor::find(const QByteArray &pattern_arg, int from,
|
int BinEditorWidget::find(const QByteArray &pattern_arg, int from,
|
||||||
QTextDocument::FindFlags findFlags)
|
QTextDocument::FindFlags findFlags)
|
||||||
{
|
{
|
||||||
if (pattern_arg.isEmpty())
|
if (pattern_arg.isEmpty())
|
||||||
@@ -633,7 +641,7 @@ int BinEditor::find(const QByteArray &pattern_arg, int from,
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int BinEditor::findPattern(const QByteArray &data, const QByteArray &dataHex,
|
int BinEditorWidget::findPattern(const QByteArray &data, const QByteArray &dataHex,
|
||||||
int from, int offset, int *match)
|
int from, int offset, int *match)
|
||||||
{
|
{
|
||||||
if (m_searchPattern.isEmpty())
|
if (m_searchPattern.isEmpty())
|
||||||
@@ -658,7 +666,7 @@ int BinEditor::findPattern(const QByteArray &data, const QByteArray &dataHex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BinEditor::drawItems(QPainter *painter, int x, int y, const QString &itemString)
|
void BinEditorWidget::drawItems(QPainter *painter, int x, int y, const QString &itemString)
|
||||||
{
|
{
|
||||||
if (m_isMonospacedFont) {
|
if (m_isMonospacedFont) {
|
||||||
painter->drawText(x, y, itemString);
|
painter->drawText(x, y, itemString);
|
||||||
@@ -668,7 +676,7 @@ void BinEditor::drawItems(QPainter *painter, int x, int y, const QString &itemSt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::drawChanges(QPainter *painter, int x, int y, const char *changes)
|
void BinEditorWidget::drawChanges(QPainter *painter, int x, int y, const char *changes)
|
||||||
{
|
{
|
||||||
const QBrush red(QColor(250, 150, 150));
|
const QBrush red(QColor(250, 150, 150));
|
||||||
for (int i = 0; i < m_bytesPerLine; ++i) {
|
for (int i = 0; i < m_bytesPerLine; ++i) {
|
||||||
@@ -679,7 +687,7 @@ void BinEditor::drawChanges(QPainter *painter, int x, int y, const char *changes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BinEditor::addressString(quint64 address)
|
QString BinEditorWidget::addressString(quint64 address)
|
||||||
{
|
{
|
||||||
QChar *addressStringData = m_addressString.data();
|
QChar *addressStringData = m_addressString.data();
|
||||||
const char *hex = "0123456789abcdef";
|
const char *hex = "0123456789abcdef";
|
||||||
@@ -698,7 +706,7 @@ QString BinEditor::addressString(quint64 address)
|
|||||||
return m_addressString;
|
return m_addressString;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::paintEvent(QPaintEvent *e)
|
void BinEditorWidget::paintEvent(QPaintEvent *e)
|
||||||
{
|
{
|
||||||
QPainter painter(viewport());
|
QPainter painter(viewport());
|
||||||
const int topLine = verticalScrollBar()->value();
|
const int topLine = verticalScrollBar()->value();
|
||||||
@@ -930,12 +938,12 @@ void BinEditor::paintEvent(QPaintEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int BinEditor::cursorPosition() const
|
int BinEditorWidget::cursorPosition() const
|
||||||
{
|
{
|
||||||
return m_cursorPosition;
|
return m_cursorPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setCursorPosition(int pos, MoveMode moveMode)
|
void BinEditorWidget::setCursorPosition(int pos, MoveMode moveMode)
|
||||||
{
|
{
|
||||||
pos = qMin(m_size-1, qMax(0, pos));
|
pos = qMin(m_size-1, qMax(0, pos));
|
||||||
int oldCursorPosition = m_cursorPosition;
|
int oldCursorPosition = m_cursorPosition;
|
||||||
@@ -957,7 +965,7 @@ void BinEditor::setCursorPosition(int pos, MoveMode moveMode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BinEditor::ensureCursorVisible()
|
void BinEditorWidget::ensureCursorVisible()
|
||||||
{
|
{
|
||||||
QRect cr = cursorRect();
|
QRect cr = cursorRect();
|
||||||
QRect vr = viewport()->rect();
|
QRect vr = viewport()->rect();
|
||||||
@@ -969,7 +977,7 @@ void BinEditor::ensureCursorVisible()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::mousePressEvent(QMouseEvent *e)
|
void BinEditorWidget::mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (e->button() != Qt::LeftButton)
|
if (e->button() != Qt::LeftButton)
|
||||||
return;
|
return;
|
||||||
@@ -982,7 +990,7 @@ void BinEditor::mousePressEvent(QMouseEvent *e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::mouseMoveEvent(QMouseEvent *e)
|
void BinEditorWidget::mouseMoveEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (!(e->buttons() & Qt::LeftButton))
|
if (!(e->buttons() & Qt::LeftButton))
|
||||||
return;
|
return;
|
||||||
@@ -998,7 +1006,7 @@ void BinEditor::mouseMoveEvent(QMouseEvent *e)
|
|||||||
m_autoScrollTimer.start(100, this);
|
m_autoScrollTimer.start(100, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::mouseReleaseEvent(QMouseEvent *)
|
void BinEditorWidget::mouseReleaseEvent(QMouseEvent *)
|
||||||
{
|
{
|
||||||
if (m_autoScrollTimer.isActive()) {
|
if (m_autoScrollTimer.isActive()) {
|
||||||
m_autoScrollTimer.stop();
|
m_autoScrollTimer.stop();
|
||||||
@@ -1006,13 +1014,13 @@ void BinEditor::mouseReleaseEvent(QMouseEvent *)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::selectAll()
|
void BinEditorWidget::selectAll()
|
||||||
{
|
{
|
||||||
setCursorPosition(0);
|
setCursorPosition(0);
|
||||||
setCursorPosition(m_size-1, KeepAnchor);
|
setCursorPosition(m_size-1, KeepAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::clear()
|
void BinEditorWidget::clear()
|
||||||
{
|
{
|
||||||
m_baseAddr = 0;
|
m_baseAddr = 0;
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
@@ -1034,7 +1042,7 @@ void BinEditor::clear()
|
|||||||
viewport()->update();
|
viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::event(QEvent *e)
|
bool BinEditorWidget::event(QEvent *e)
|
||||||
{
|
{
|
||||||
switch (e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::KeyPress:
|
case QEvent::KeyPress:
|
||||||
@@ -1050,7 +1058,7 @@ bool BinEditor::event(QEvent *e)
|
|||||||
const QScrollBar * const scrollBar = verticalScrollBar();
|
const QScrollBar * const scrollBar = verticalScrollBar();
|
||||||
const int maximum = scrollBar->maximum();
|
const int maximum = scrollBar->maximum();
|
||||||
if (maximum && scrollBar->value() >= maximum - 1) {
|
if (maximum && scrollBar->value() >= maximum - 1) {
|
||||||
emit newRangeRequested(editor(), baseAddress() + m_size);
|
emit newRangeRequested(baseAddress() + m_size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1075,7 +1083,7 @@ bool BinEditor::event(QEvent *e)
|
|||||||
return QAbstractScrollArea::event(e);
|
return QAbstractScrollArea::event(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BinEditor::toolTip(const QHelpEvent *helpEvent) const
|
QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
|
||||||
{
|
{
|
||||||
// Selection if mouse is in, else 1 byte at cursor
|
// Selection if mouse is in, else 1 byte at cursor
|
||||||
int selStart = selectionStart();
|
int selStart = selectionStart();
|
||||||
@@ -1257,7 +1265,7 @@ QString BinEditor::toolTip(const QHelpEvent *helpEvent) const
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::keyPressEvent(QKeyEvent *e)
|
void BinEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (e == QKeySequence::SelectAll) {
|
if (e == QKeySequence::SelectAll) {
|
||||||
@@ -1356,7 +1364,7 @@ void BinEditor::keyPressEvent(QKeyEvent *e)
|
|||||||
e->accept();
|
e->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::zoomIn(int range)
|
void BinEditorWidget::zoomIn(int range)
|
||||||
{
|
{
|
||||||
QFont f = font();
|
QFont f = font();
|
||||||
const int newSize = f.pointSize() + range;
|
const int newSize = f.pointSize() + range;
|
||||||
@@ -1366,12 +1374,12 @@ void BinEditor::zoomIn(int range)
|
|||||||
setFont(f);
|
setFont(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::zoomOut(int range)
|
void BinEditorWidget::zoomOut(int range)
|
||||||
{
|
{
|
||||||
zoomIn(-range);
|
zoomIn(-range);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::copy(bool raw)
|
void BinEditorWidget::copy(bool raw)
|
||||||
{
|
{
|
||||||
int selStart = selectionStart();
|
int selStart = selectionStart();
|
||||||
int selEnd = selectionEnd();
|
int selEnd = selectionEnd();
|
||||||
@@ -1400,7 +1408,7 @@ void BinEditor::copy(bool raw)
|
|||||||
QApplication::clipboard()->setText(hexString);
|
QApplication::clipboard()->setText(hexString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::highlightSearchResults(const QByteArray &pattern, QTextDocument::FindFlags findFlags)
|
void BinEditorWidget::highlightSearchResults(const QByteArray &pattern, QTextDocument::FindFlags findFlags)
|
||||||
{
|
{
|
||||||
if (m_searchPattern == pattern)
|
if (m_searchPattern == pattern)
|
||||||
return;
|
return;
|
||||||
@@ -1412,7 +1420,7 @@ void BinEditor::highlightSearchResults(const QByteArray &pattern, QTextDocument:
|
|||||||
viewport()->update();
|
viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::changeData(int position, uchar character, bool highNibble)
|
void BinEditorWidget::changeData(int position, uchar character, bool highNibble)
|
||||||
{
|
{
|
||||||
if (!requestDataAt(position))
|
if (!requestDataAt(position))
|
||||||
return;
|
return;
|
||||||
@@ -1444,7 +1452,7 @@ void BinEditor::changeData(int position, uchar character, bool highNibble)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BinEditor::undo()
|
void BinEditorWidget::undo()
|
||||||
{
|
{
|
||||||
if (m_undoStack.isEmpty())
|
if (m_undoStack.isEmpty())
|
||||||
return;
|
return;
|
||||||
@@ -1464,7 +1472,7 @@ void BinEditor::undo()
|
|||||||
emit redoAvailable(true);
|
emit redoAvailable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::redo()
|
void BinEditorWidget::redo()
|
||||||
{
|
{
|
||||||
if (m_redoStack.isEmpty())
|
if (m_redoStack.isEmpty())
|
||||||
return;
|
return;
|
||||||
@@ -1483,7 +1491,7 @@ void BinEditor::redo()
|
|||||||
emit redoAvailable(false);
|
emit redoAvailable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::contextMenuEvent(QContextMenuEvent *event)
|
void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
const int selStart = selectionStart();
|
const int selStart = selectionStart();
|
||||||
const int byteCount = selectionEnd() - selStart + 1;
|
const int byteCount = selectionEnd() - selStart + 1;
|
||||||
@@ -1545,7 +1553,7 @@ void BinEditor::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
delete contextMenu;
|
delete contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setupJumpToMenuAction(QMenu *menu, QAction *actionHere,
|
void BinEditorWidget::setupJumpToMenuAction(QMenu *menu, QAction *actionHere,
|
||||||
QAction *actionNew, quint64 addr)
|
QAction *actionNew, quint64 addr)
|
||||||
{
|
{
|
||||||
actionHere->setText(tr("Jump to Address 0x%1 in This Window")
|
actionHere->setText(tr("Jump to Address 0x%1 in This Window")
|
||||||
@@ -1558,34 +1566,34 @@ void BinEditor::setupJumpToMenuAction(QMenu *menu, QAction *actionHere,
|
|||||||
actionNew->setEnabled(false);
|
actionNew->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::jumpToAddress(quint64 address)
|
void BinEditorWidget::jumpToAddress(quint64 address)
|
||||||
{
|
{
|
||||||
if (address >= m_baseAddr && address < m_baseAddr + m_size)
|
if (address >= m_baseAddr && address < m_baseAddr + m_size)
|
||||||
setCursorPosition(address - m_baseAddr);
|
setCursorPosition(address - m_baseAddr);
|
||||||
else
|
else
|
||||||
emit newRangeRequested(editor(), address);
|
emit newRangeRequested(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setNewWindowRequestAllowed(bool c)
|
void BinEditorWidget::setNewWindowRequestAllowed(bool c)
|
||||||
{
|
{
|
||||||
m_canRequestNewWindow = c;
|
m_canRequestNewWindow = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::updateContents()
|
void BinEditorWidget::updateContents()
|
||||||
{
|
{
|
||||||
m_oldData = m_data;
|
m_oldData = m_data;
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
setSizes(baseAddress() + cursorPosition(), m_size, m_blockSize);
|
setSizes(baseAddress() + cursorPosition(), m_size, m_blockSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint BinEditor::offsetToPos(int offset) const
|
QPoint BinEditorWidget::offsetToPos(int offset) const
|
||||||
{
|
{
|
||||||
const int x = m_labelWidth + (offset % m_bytesPerLine) * m_columnWidth;
|
const int x = m_labelWidth + (offset % m_bytesPerLine) * m_columnWidth;
|
||||||
const int y = (offset / m_bytesPerLine - verticalScrollBar()->value()) * m_lineHeight;
|
const int y = (offset / m_bytesPerLine - verticalScrollBar()->value()) * m_lineHeight;
|
||||||
return QPoint(x, y);
|
return QPoint(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::asFloat(int offset, float &value, bool old) const
|
void BinEditorWidget::asFloat(int offset, float &value, bool old) const
|
||||||
{
|
{
|
||||||
value = 0;
|
value = 0;
|
||||||
const QByteArray data = dataMid(offset, sizeof(float), old);
|
const QByteArray data = dataMid(offset, sizeof(float), old);
|
||||||
@@ -1594,7 +1602,7 @@ void BinEditor::asFloat(int offset, float &value, bool old) const
|
|||||||
value = *f;
|
value = *f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::asDouble(int offset, double &value, bool old) const
|
void BinEditorWidget::asDouble(int offset, double &value, bool old) const
|
||||||
{
|
{
|
||||||
value = 0;
|
value = 0;
|
||||||
const QByteArray data = dataMid(offset, sizeof(double), old);
|
const QByteArray data = dataMid(offset, sizeof(double), old);
|
||||||
@@ -1603,7 +1611,7 @@ void BinEditor::asDouble(int offset, double &value, bool old) const
|
|||||||
value = *f;
|
value = *f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::asIntegers(int offset, int count, quint64 &bigEndianValue,
|
void BinEditorWidget::asIntegers(int offset, int count, quint64 &bigEndianValue,
|
||||||
quint64 &littleEndianValue, bool old) const
|
quint64 &littleEndianValue, bool old) const
|
||||||
{
|
{
|
||||||
bigEndianValue = littleEndianValue = 0;
|
bigEndianValue = littleEndianValue = 0;
|
||||||
@@ -1615,12 +1623,12 @@ void BinEditor::asIntegers(int offset, int count, quint64 &bigEndianValue,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditor::isMemoryView() const
|
bool BinEditorWidget::isMemoryView() const
|
||||||
{
|
{
|
||||||
return editor()->property("MemoryView").toBool();
|
return editor()->property("MemoryView").toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::setMarkup(const QList<Markup> &markup)
|
void BinEditorWidget::setMarkup(const QList<Markup> &markup)
|
||||||
{
|
{
|
||||||
m_markup = markup;
|
m_markup = markup;
|
||||||
viewport()->update();
|
viewport()->update();
|
||||||
|
|||||||
@@ -55,16 +55,17 @@ class FontSettings;
|
|||||||
|
|
||||||
namespace BINEditor {
|
namespace BINEditor {
|
||||||
|
|
||||||
class BinEditor : public QAbstractScrollArea
|
class BinEditorWidget : public QAbstractScrollArea
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool modified READ isModified WRITE setModified DESIGNABLE false)
|
Q_PROPERTY(bool modified READ isModified WRITE setModified DESIGNABLE false)
|
||||||
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE false)
|
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE false)
|
||||||
Q_PROPERTY(QList<BINEditor::Markup> markup READ markup WRITE setMarkup DESIGNABLE false)
|
Q_PROPERTY(QList<BINEditor::Markup> markup READ markup WRITE setMarkup DESIGNABLE false)
|
||||||
Q_PROPERTY(bool newWindowRequestAllowed READ newWindowRequestAllowed WRITE setNewWindowRequestAllowed DESIGNABLE false)
|
Q_PROPERTY(bool newWindowRequestAllowed READ newWindowRequestAllowed WRITE setNewWindowRequestAllowed DESIGNABLE false)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BinEditor(QWidget *parent = 0);
|
BinEditorWidget(QWidget *parent = 0);
|
||||||
~BinEditor();
|
~BinEditorWidget();
|
||||||
|
|
||||||
quint64 baseAddress() const { return m_baseAddr; }
|
quint64 baseAddress() const { return m_baseAddr; }
|
||||||
|
|
||||||
@@ -138,11 +139,11 @@ Q_SIGNALS:
|
|||||||
void redoAvailable(bool);
|
void redoAvailable(bool);
|
||||||
void cursorPositionChanged(int position);
|
void cursorPositionChanged(int position);
|
||||||
|
|
||||||
void dataRequested(Core::IEditor *editor, quint64 block);
|
void dataRequested(quint64 block);
|
||||||
void newWindowRequested(quint64 address);
|
void newWindowRequested(quint64 address);
|
||||||
void newRangeRequested(Core::IEditor *, quint64 address);
|
void newRangeRequested(quint64 address);
|
||||||
void addWatchpointRequested(quint64 address, uint size);
|
void addWatchpointRequested(quint64 address, uint size);
|
||||||
void dataChanged(Core::IEditor *, quint64 address, const QByteArray &data);
|
void dataChanged(quint64 address, const QByteArray &data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void scrollContentsBy(int dx, int dy);
|
void scrollContentsBy(int dx, int dy);
|
||||||
|
|||||||
@@ -58,8 +58,6 @@
|
|||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <find/ifindsupport.h>
|
#include <find/ifindsupport.h>
|
||||||
#include <texteditor/fontsettings.h>
|
|
||||||
#include <texteditor/texteditorsettings.h>
|
|
||||||
#include <utils/reloadpromptutils.h>
|
#include <utils/reloadpromptutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -70,15 +68,18 @@ using namespace BINEditor::Internal;
|
|||||||
class BinEditorFind : public Find::IFindSupport
|
class BinEditorFind : public Find::IFindSupport
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BinEditorFind(BinEditor *editor)
|
BinEditorFind(BinEditorWidget *widget)
|
||||||
{
|
{
|
||||||
m_editor = editor;
|
m_widget = widget;
|
||||||
m_incrementalStartPos = m_contPos = -1;
|
m_incrementalStartPos = m_contPos = -1;
|
||||||
}
|
}
|
||||||
~BinEditorFind() {}
|
|
||||||
|
|
||||||
bool supportsReplace() const { return false; }
|
bool supportsReplace() const { return false; }
|
||||||
|
QString currentFindString() const { return QString(); }
|
||||||
|
QString completedFindString() const { return QString(); }
|
||||||
|
|
||||||
Find::FindFlags supportedFindFlags() const
|
Find::FindFlags supportedFindFlags() const
|
||||||
{
|
{
|
||||||
return Find::FindBackward | Find::FindCaseSensitively;
|
return Find::FindBackward | Find::FindCaseSensitively;
|
||||||
@@ -91,21 +92,22 @@ public:
|
|||||||
|
|
||||||
virtual void highlightAll(const QString &txt, Find::FindFlags findFlags)
|
virtual void highlightAll(const QString &txt, Find::FindFlags findFlags)
|
||||||
{
|
{
|
||||||
m_editor->highlightSearchResults(txt.toLatin1(), Find::textDocumentFlagsForFindFlags(findFlags));
|
m_widget->highlightSearchResults(txt.toLatin1(), Find::textDocumentFlagsForFindFlags(findFlags));
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearResults() { m_editor->highlightSearchResults(QByteArray()); }
|
void clearResults()
|
||||||
QString currentFindString() const { return QString(); }
|
{
|
||||||
QString completedFindString() const { return QString(); }
|
m_widget->highlightSearchResults(QByteArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
int find(const QByteArray &pattern, int pos, Find::FindFlags findFlags)
|
||||||
int find(const QByteArray &pattern, int pos, Find::FindFlags findFlags) {
|
{
|
||||||
if (pattern.isEmpty()) {
|
if (pattern.isEmpty()) {
|
||||||
m_editor->setCursorPosition(pos);
|
m_widget->setCursorPosition(pos);
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_editor->find(pattern, pos, Find::textDocumentFlagsForFindFlags(findFlags));
|
return m_widget->find(pattern, pos, Find::textDocumentFlagsForFindFlags(findFlags));
|
||||||
}
|
}
|
||||||
|
|
||||||
Result findIncremental(const QString &txt, Find::FindFlags findFlags) {
|
Result findIncremental(const QString &txt, Find::FindFlags findFlags) {
|
||||||
@@ -114,25 +116,25 @@ public:
|
|||||||
resetIncrementalSearch(); // Because we don't search for nibbles.
|
resetIncrementalSearch(); // Because we don't search for nibbles.
|
||||||
m_lastPattern = pattern;
|
m_lastPattern = pattern;
|
||||||
if (m_incrementalStartPos < 0)
|
if (m_incrementalStartPos < 0)
|
||||||
m_incrementalStartPos = m_editor->selectionStart();
|
m_incrementalStartPos = m_widget->selectionStart();
|
||||||
if (m_contPos == -1)
|
if (m_contPos == -1)
|
||||||
m_contPos = m_incrementalStartPos;
|
m_contPos = m_incrementalStartPos;
|
||||||
int found = find(pattern, m_contPos, findFlags);
|
int found = find(pattern, m_contPos, findFlags);
|
||||||
Result result;
|
Result result;
|
||||||
if (found >= 0) {
|
if (found >= 0) {
|
||||||
result = Found;
|
result = Found;
|
||||||
m_editor->highlightSearchResults(pattern, Find::textDocumentFlagsForFindFlags(findFlags));
|
m_widget->highlightSearchResults(pattern, Find::textDocumentFlagsForFindFlags(findFlags));
|
||||||
m_contPos = -1;
|
m_contPos = -1;
|
||||||
} else {
|
} else {
|
||||||
if (found == -2) {
|
if (found == -2) {
|
||||||
result = NotYetFound;
|
result = NotYetFound;
|
||||||
m_contPos +=
|
m_contPos +=
|
||||||
findFlags & Find::FindBackward
|
findFlags & Find::FindBackward
|
||||||
? -BinEditor::SearchStride : BinEditor::SearchStride;
|
? -BinEditorWidget::SearchStride : BinEditorWidget::SearchStride;
|
||||||
} else {
|
} else {
|
||||||
result = NotFound;
|
result = NotFound;
|
||||||
m_contPos = -1;
|
m_contPos = -1;
|
||||||
m_editor->highlightSearchResults(QByteArray(), 0);
|
m_widget->highlightSearchResults(QByteArray(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -142,9 +144,9 @@ public:
|
|||||||
QByteArray pattern = txt.toLatin1();
|
QByteArray pattern = txt.toLatin1();
|
||||||
bool wasReset = (m_incrementalStartPos < 0);
|
bool wasReset = (m_incrementalStartPos < 0);
|
||||||
if (m_contPos == -1) {
|
if (m_contPos == -1) {
|
||||||
m_contPos = m_editor->cursorPosition();
|
m_contPos = m_widget->cursorPosition();
|
||||||
if (findFlags & Find::FindBackward)
|
if (findFlags & Find::FindBackward)
|
||||||
m_contPos = m_editor->selectionStart()-1;
|
m_contPos = m_widget->selectionStart()-1;
|
||||||
}
|
}
|
||||||
int found = find(pattern, m_contPos, findFlags);
|
int found = find(pattern, m_contPos, findFlags);
|
||||||
Result result;
|
Result result;
|
||||||
@@ -153,11 +155,11 @@ public:
|
|||||||
m_incrementalStartPos = found;
|
m_incrementalStartPos = found;
|
||||||
m_contPos = -1;
|
m_contPos = -1;
|
||||||
if (wasReset)
|
if (wasReset)
|
||||||
m_editor->highlightSearchResults(pattern, Find::textDocumentFlagsForFindFlags(findFlags));
|
m_widget->highlightSearchResults(pattern, Find::textDocumentFlagsForFindFlags(findFlags));
|
||||||
} else if (found == -2) {
|
} else if (found == -2) {
|
||||||
result = NotYetFound;
|
result = NotYetFound;
|
||||||
m_contPos += findFlags & Find::FindBackward
|
m_contPos += findFlags & Find::FindBackward
|
||||||
? -BinEditor::SearchStride : BinEditor::SearchStride;
|
? -BinEditorWidget::SearchStride : BinEditorWidget::SearchStride;
|
||||||
} else {
|
} else {
|
||||||
result = NotFound;
|
result = NotFound;
|
||||||
m_contPos = -1;
|
m_contPos = -1;
|
||||||
@@ -167,7 +169,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BinEditor *m_editor;
|
BinEditorWidget *m_widget;
|
||||||
int m_incrementalStartPos;
|
int m_incrementalStartPos;
|
||||||
int m_contPos; // Only valid if last result was NotYetFound.
|
int m_contPos; // Only valid if last result was NotYetFound.
|
||||||
QByteArray m_lastPattern;
|
QByteArray m_lastPattern;
|
||||||
@@ -178,14 +180,14 @@ class BinEditorDocument : public Core::IDocument
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
BinEditorDocument(BinEditor *parent) :
|
BinEditorDocument(BinEditorWidget *parent) :
|
||||||
Core::IDocument(parent)
|
Core::IDocument(parent)
|
||||||
{
|
{
|
||||||
m_editor = parent;
|
m_widget = parent;
|
||||||
connect(m_editor, SIGNAL(dataRequested(Core::IEditor*,quint64)),
|
connect(m_widget, SIGNAL(dataRequested(quint64)),
|
||||||
this, SLOT(provideData(Core::IEditor*,quint64)));
|
this, SLOT(provideData(quint64)));
|
||||||
connect(m_editor, SIGNAL(newRangeRequested(Core::IEditor*,quint64)),
|
connect(m_widget, SIGNAL(newRangeRequested(quint64)),
|
||||||
this, SLOT(provideNewRange(Core::IEditor*,quint64)));
|
this, SLOT(provideNewRange(quint64)));
|
||||||
}
|
}
|
||||||
~BinEditorDocument() {}
|
~BinEditorDocument() {}
|
||||||
|
|
||||||
@@ -198,9 +200,9 @@ public:
|
|||||||
QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive
|
QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive
|
||||||
const QString fileNameToUse
|
const QString fileNameToUse
|
||||||
= fileName.isEmpty() ? m_fileName : fileName;
|
= fileName.isEmpty() ? m_fileName : fileName;
|
||||||
if (m_editor->save(errorString, m_fileName, fileNameToUse)) {
|
if (m_widget->save(errorString, m_fileName, fileNameToUse)) {
|
||||||
m_fileName = fileNameToUse;
|
m_fileName = fileNameToUse;
|
||||||
m_editor->editor()->setDisplayName(QFileInfo(fileNameToUse).fileName());
|
m_widget->editor()->setDisplayName(QFileInfo(fileNameToUse).fileName());
|
||||||
emit changed();
|
emit changed();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -210,7 +212,7 @@ public:
|
|||||||
|
|
||||||
void rename(const QString &newName) {
|
void rename(const QString &newName) {
|
||||||
m_fileName = newName;
|
m_fileName = newName;
|
||||||
m_editor->editor()->setDisplayName(QFileInfo(fileName()).fileName());
|
m_widget->editor()->setDisplayName(QFileInfo(fileName()).fileName());
|
||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,8 +232,8 @@ public:
|
|||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
file.close();
|
file.close();
|
||||||
m_fileName = fileName;
|
m_fileName = fileName;
|
||||||
m_editor->setSizes(offset, file.size());
|
m_widget->setSizes(offset, file.size());
|
||||||
m_editor->editor()->setDisplayName(QFileInfo(fileName).fileName());
|
m_widget->editor()->setDisplayName(QFileInfo(fileName).fileName());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
QString errStr = tr("Cannot open %1: %2").arg(
|
QString errStr = tr("Cannot open %1: %2").arg(
|
||||||
@@ -244,19 +246,20 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void provideData(Core::IEditor *, quint64 block) {
|
void provideData(quint64 block)
|
||||||
|
{
|
||||||
if (m_fileName.isEmpty())
|
if (m_fileName.isEmpty())
|
||||||
return;
|
return;
|
||||||
QFile file(m_fileName);
|
QFile file(m_fileName);
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
int blockSize = m_editor->dataBlockSize();
|
int blockSize = m_widget->dataBlockSize();
|
||||||
file.seek(block * blockSize);
|
file.seek(block * blockSize);
|
||||||
QByteArray data = file.read(blockSize);
|
QByteArray data = file.read(blockSize);
|
||||||
file.close();
|
file.close();
|
||||||
const int dataSize = data.size();
|
const int dataSize = data.size();
|
||||||
if (dataSize != blockSize)
|
if (dataSize != blockSize)
|
||||||
data += QByteArray(blockSize - dataSize, 0);
|
data += QByteArray(blockSize - dataSize, 0);
|
||||||
m_editor->addData(block, data);
|
m_widget->addData(block, data);
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"),
|
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"),
|
||||||
tr("Cannot open %1: %2").arg(
|
tr("Cannot open %1: %2").arg(
|
||||||
@@ -264,7 +267,8 @@ private slots:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void provideNewRange(Core::IEditor *, quint64 offset) {
|
void provideNewRange(quint64 offset)
|
||||||
|
{
|
||||||
open(0, m_fileName, offset);
|
open(0, m_fileName, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,10 +284,10 @@ public:
|
|||||||
|
|
||||||
QString suggestedFileName() const { return QString(); }
|
QString suggestedFileName() const { return QString(); }
|
||||||
|
|
||||||
bool isModified() const { return m_editor->isMemoryView() ? false : m_editor->isModified(); }
|
bool isModified() const { return m_widget->isMemoryView() ? false : m_widget->isModified(); }
|
||||||
|
|
||||||
bool isFileReadOnly() const {
|
bool isFileReadOnly() const {
|
||||||
if (m_editor->isMemoryView() || m_fileName.isEmpty())
|
if (m_widget->isMemoryView() || m_fileName.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
const QFileInfo fi(m_fileName);
|
const QFileInfo fi(m_fileName);
|
||||||
return !fi.isWritable();
|
return !fi.isWritable();
|
||||||
@@ -306,19 +310,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BinEditor *m_editor;
|
BinEditorWidget *m_widget;
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BinEditorInterface : public Core::IEditor
|
class BinEditor : public Core::IEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
BinEditorInterface(BinEditor *editor)
|
BinEditor(BinEditorWidget *widget)
|
||||||
{
|
{
|
||||||
setWidget(editor);
|
setWidget(widget);
|
||||||
m_editor = editor;
|
m_widget = widget;
|
||||||
m_file = new BinEditorDocument(m_editor);
|
m_file = new BinEditorDocument(m_widget);
|
||||||
m_context.add(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
m_context.add(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
||||||
m_context.add(Constants::C_BINEDITOR);
|
m_context.add(Constants::C_BINEDITOR);
|
||||||
m_addressEdit = new QLineEdit;
|
m_addressEdit = new QLineEdit;
|
||||||
@@ -339,19 +343,21 @@ public:
|
|||||||
m_toolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
m_toolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
m_toolBar->addWidget(w);
|
m_toolBar->addWidget(w);
|
||||||
|
|
||||||
connect(m_editor, SIGNAL(cursorPositionChanged(int)), this,
|
widget->setEditor(this);
|
||||||
SLOT(updateCursorPosition(int)));
|
|
||||||
connect(m_file, SIGNAL(changed()), this, SIGNAL(changed()));
|
connect(m_widget, SIGNAL(cursorPositionChanged(int)), SLOT(updateCursorPosition(int)));
|
||||||
connect(m_addressEdit, SIGNAL(editingFinished()), this,
|
connect(m_file, SIGNAL(changed()), SIGNAL(changed()));
|
||||||
SLOT(jumpToAddress()));
|
connect(m_addressEdit, SIGNAL(editingFinished()), SLOT(jumpToAddress()));
|
||||||
updateCursorPosition(m_editor->cursorPosition());
|
connect(m_widget, SIGNAL(modificationChanged(bool)), SIGNAL(changed()));
|
||||||
|
updateCursorPosition(m_widget->cursorPosition());
|
||||||
}
|
}
|
||||||
~BinEditorInterface() {
|
|
||||||
delete m_editor;
|
~BinEditor() {
|
||||||
|
delete m_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool createNew(const QString & /* contents */ = QString()) {
|
bool createNew(const QString & /* contents */ = QString()) {
|
||||||
m_editor->clear();
|
m_widget->clear();
|
||||||
m_file->setFilename(QString());
|
m_file->setFilename(QString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -366,20 +372,20 @@ public:
|
|||||||
|
|
||||||
QWidget *toolBar() { return m_toolBar; }
|
QWidget *toolBar() { return m_toolBar; }
|
||||||
|
|
||||||
bool isTemporary() const { return m_editor->isMemoryView(); }
|
bool isTemporary() const { return m_widget->isMemoryView(); }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateCursorPosition(int position) {
|
void updateCursorPosition(int position) {
|
||||||
m_addressEdit->setText(QString::number(m_editor->baseAddress() + position, 16));
|
m_addressEdit->setText(QString::number(m_widget->baseAddress() + position, 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
void jumpToAddress() {
|
void jumpToAddress() {
|
||||||
m_editor->jumpToAddress(m_addressEdit->text().toULongLong(0, 16));
|
m_widget->jumpToAddress(m_addressEdit->text().toULongLong(0, 16));
|
||||||
updateCursorPosition(m_editor->cursorPosition());
|
updateCursorPosition(m_widget->cursorPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BinEditor *m_editor;
|
BinEditorWidget *m_widget;
|
||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
BinEditorDocument *m_file;
|
BinEditorDocument *m_file;
|
||||||
QToolBar *m_toolBar;
|
QToolBar *m_toolBar;
|
||||||
@@ -408,9 +414,11 @@ QString BinEditorFactory::displayName() const
|
|||||||
|
|
||||||
Core::IEditor *BinEditorFactory::createEditor(QWidget *parent)
|
Core::IEditor *BinEditorFactory::createEditor(QWidget *parent)
|
||||||
{
|
{
|
||||||
BinEditor *editor = new BinEditor(parent);
|
BinEditorWidget *widget = new BinEditorWidget(parent);
|
||||||
m_owner->initializeEditor(editor);
|
BinEditor *editor = new BinEditor(widget);
|
||||||
return editor->editor();
|
|
||||||
|
m_owner->initializeEditor(widget);
|
||||||
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList BinEditorFactory::mimeTypes() const
|
QStringList BinEditorFactory::mimeTypes() const
|
||||||
@@ -433,7 +441,7 @@ BinEditorWidgetFactory::BinEditorWidgetFactory(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *BinEditorWidgetFactory::createWidget(QWidget *parent)
|
QWidget *BinEditorWidgetFactory::createWidget(QWidget *parent)
|
||||||
{
|
{
|
||||||
return new BinEditor(parent);
|
return new BinEditorWidget(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////// BinEditorPlugin //////////////////////////////////
|
///////////////////////////////// BinEditorPlugin //////////////////////////////////
|
||||||
@@ -467,12 +475,8 @@ QAction *BinEditorPlugin::registerNewAction(Core::Id id,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditorPlugin::initializeEditor(BinEditor *editor)
|
void BinEditorPlugin::initializeEditor(BinEditorWidget *widget)
|
||||||
{
|
{
|
||||||
BinEditorInterface *editorInterface = new BinEditorInterface(editor);
|
|
||||||
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
|
|
||||||
editor->setEditor(editorInterface);
|
|
||||||
|
|
||||||
m_context.add(Constants::C_BINEDITOR);
|
m_context.add(Constants::C_BINEDITOR);
|
||||||
if (!m_undoAction) {
|
if (!m_undoAction) {
|
||||||
m_undoAction = registerNewAction(Core::Constants::UNDO, this, SLOT(undoAction()), tr("&Undo"));
|
m_undoAction = registerNewAction(Core::Constants::UNDO, this, SLOT(undoAction()), tr("&Undo"));
|
||||||
@@ -481,19 +485,13 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
|
|||||||
m_selectAllAction = registerNewAction(Core::Constants::SELECTALL, this, SLOT(selectAllAction()));
|
m_selectAllAction = registerNewAction(Core::Constants::SELECTALL, this, SLOT(selectAllAction()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Font settings
|
QObject::connect(widget, SIGNAL(undoAvailable(bool)), this, SLOT(updateActions()));
|
||||||
TextEditor::TextEditorSettings *settings = TextEditor::TextEditorSettings::instance();
|
QObject::connect(widget, SIGNAL(redoAvailable(bool)), this, SLOT(updateActions()));
|
||||||
editor->setFontSettings(settings->fontSettings());
|
|
||||||
connect(settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
|
|
||||||
editor, SLOT(setFontSettings(TextEditor::FontSettings)));
|
|
||||||
|
|
||||||
QObject::connect(editor, SIGNAL(undoAvailable(bool)), this, SLOT(updateActions()));
|
|
||||||
QObject::connect(editor, SIGNAL(redoAvailable(bool)), this, SLOT(updateActions()));
|
|
||||||
|
|
||||||
Aggregation::Aggregate *aggregate = new Aggregation::Aggregate;
|
Aggregation::Aggregate *aggregate = new Aggregation::Aggregate;
|
||||||
BinEditorFind *binEditorFind = new BinEditorFind(editor);
|
BinEditorFind *binEditorFind = new BinEditorFind(widget);
|
||||||
aggregate->add(binEditorFind);
|
aggregate->add(binEditorFind);
|
||||||
aggregate->add(editor);
|
aggregate->add(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
bool BinEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
@@ -515,9 +513,9 @@ void BinEditorPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
void BinEditorPlugin::updateCurrentEditor(Core::IEditor *editor)
|
void BinEditorPlugin::updateCurrentEditor(Core::IEditor *editor)
|
||||||
{
|
{
|
||||||
BinEditor *binEditor = 0;
|
BinEditorWidget *binEditor = 0;
|
||||||
if (editor)
|
if (editor)
|
||||||
binEditor = qobject_cast<BinEditor *>(editor->widget());
|
binEditor = qobject_cast<BinEditorWidget *>(editor->widget());
|
||||||
if (m_currentEditor == binEditor)
|
if (m_currentEditor == binEditor)
|
||||||
return;
|
return;
|
||||||
m_currentEditor = binEditor;
|
m_currentEditor = binEditor;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
namespace BINEditor {
|
namespace BINEditor {
|
||||||
class BinEditor;
|
class BinEditorWidget;
|
||||||
|
|
||||||
class BinEditorWidgetFactory : public QObject
|
class BinEditorWidgetFactory : public QObject
|
||||||
{
|
{
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
|
|
||||||
// Connect editor to settings changed signals.
|
// Connect editor to settings changed signals.
|
||||||
void initializeEditor(BinEditor *editor);
|
void initializeEditor(BinEditorWidget *editor);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void undoAction();
|
void undoAction();
|
||||||
@@ -92,7 +92,7 @@ private:
|
|||||||
Core::IEditor *createEditor(QWidget *parent);
|
Core::IEditor *createEditor(QWidget *parent);
|
||||||
|
|
||||||
BinEditorFactory *m_factory;
|
BinEditorFactory *m_factory;
|
||||||
QPointer<BinEditor> m_currentEditor;
|
QPointer<BinEditorWidget> m_currentEditor;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BinEditorFactory : public Core::IEditorFactory
|
class BinEditorFactory : public Core::IEditorFactory
|
||||||
|
|||||||
@@ -123,14 +123,11 @@ void NavigationWidgetFactory::saveSettings(int position, QWidget *widget)
|
|||||||
NavigationWidget *pw = qobject_cast<NavigationWidget *>(widget);
|
NavigationWidget *pw = qobject_cast<NavigationWidget *>(widget);
|
||||||
QTC_ASSERT(pw, return);
|
QTC_ASSERT(pw, return);
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
|
|
||||||
// .beginGroup is not used - to prevent simultaneous access
|
// .beginGroup is not used - to prevent simultaneous access
|
||||||
QString group = settingsPrefix(position);
|
QString group = settingsPrefix(position);
|
||||||
|
|
||||||
// save settings
|
// Save settings
|
||||||
settings->setValue(group, pw->flatMode());
|
Core::ICore::settings()->setValue(group, pw->flatMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationWidgetFactory::restoreSettings(int position, QWidget *widget)
|
void NavigationWidgetFactory::restoreSettings(int position, QWidget *widget)
|
||||||
@@ -138,14 +135,11 @@ void NavigationWidgetFactory::restoreSettings(int position, QWidget *widget)
|
|||||||
NavigationWidget *pw = qobject_cast<NavigationWidget *>(widget);
|
NavigationWidget *pw = qobject_cast<NavigationWidget *>(widget);
|
||||||
QTC_ASSERT(pw, return);
|
QTC_ASSERT(pw, return);
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
|
|
||||||
// .beginGroup is not used - to prevent simultaneous access
|
// .beginGroup is not used - to prevent simultaneous access
|
||||||
QString group = settingsPrefix(position);
|
QString group = settingsPrefix(position);
|
||||||
|
|
||||||
// load settings
|
// Load settings
|
||||||
pw->setFlatMode(settings->value(group, false).toBool());
|
pw->setFlatMode(Core::ICore::settings()->value(group, false).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ int ReadOnlyFilesDialog::exec()
|
|||||||
if (QDialog::exec() != QDialog::Accepted)
|
if (QDialog::exec() != QDialog::Accepted)
|
||||||
return RO_Cancel;
|
return RO_Cancel;
|
||||||
|
|
||||||
ReadOnlyResult result;
|
ReadOnlyResult result = RO_Cancel;
|
||||||
QStringList failedToMakeWritable;
|
QStringList failedToMakeWritable;
|
||||||
foreach (ReadOnlyFilesDialogPrivate::ButtonGroupForFile buttengroup, d->buttonGroups) {
|
foreach (ReadOnlyFilesDialogPrivate::ButtonGroupForFile buttengroup, d->buttonGroups) {
|
||||||
result = static_cast<ReadOnlyResult>(buttengroup.group->checkedId());
|
result = static_cast<ReadOnlyResult>(buttengroup.group->checkedId());
|
||||||
@@ -313,7 +313,7 @@ void ReadOnlyFilesDialog::setAll(int index)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Get the selected type from the select all combo box.
|
// Get the selected type from the select all combo box.
|
||||||
ReadOnlyFilesTreeColumn type;
|
ReadOnlyFilesTreeColumn type = NumberOfColumns;
|
||||||
if (index == d->setAllIndexForOperation[MakeWritable])
|
if (index == d->setAllIndexForOperation[MakeWritable])
|
||||||
type = MakeWritable;
|
type = MakeWritable;
|
||||||
else if (index == d->setAllIndexForOperation[OpenWithVCS])
|
else if (index == d->setAllIndexForOperation[OpenWithVCS])
|
||||||
|
|||||||
@@ -107,14 +107,12 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
|||||||
m_widget = new QWidget(parent);
|
m_widget = new QWidget(parent);
|
||||||
m_page->setupUi(m_widget);
|
m_page->setupUi(m_widget);
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
|
||||||
Q_UNUSED(settings) // Windows
|
|
||||||
|
|
||||||
fillLanguageBox();
|
fillLanguageBox();
|
||||||
|
|
||||||
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
||||||
m_page->reloadBehavior->setCurrentIndex(EditorManager::instance()->reloadSetting());
|
m_page->reloadBehavior->setCurrentIndex(EditorManager::instance()->reloadSetting());
|
||||||
if (HostOsInfo::isAnyUnixHost()) {
|
if (HostOsInfo::isAnyUnixHost()) {
|
||||||
|
QSettings *settings = Core::ICore::settings();
|
||||||
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
||||||
const QString currentTerminal = ConsoleProcess::terminalEmulator(settings, false);
|
const QString currentTerminal = ConsoleProcess::terminalEmulator(settings, false);
|
||||||
const QString currentTerminalExplicit = ConsoleProcess::terminalEmulator(settings, true);
|
const QString currentTerminalExplicit = ConsoleProcess::terminalEmulator(settings, true);
|
||||||
@@ -128,6 +126,7 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) {
|
if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) {
|
||||||
|
QSettings *settings = Core::ICore::settings();
|
||||||
m_page->externalFileBrowserEdit->setText(UnixUtils::fileBrowser(settings));
|
m_page->externalFileBrowserEdit->setText(UnixUtils::fileBrowser(settings));
|
||||||
} else {
|
} else {
|
||||||
m_page->externalFileBrowserLabel->hide();
|
m_page->externalFileBrowserLabel->hide();
|
||||||
|
|||||||
@@ -52,11 +52,8 @@ CodePasterSettingsPage::CodePasterSettingsPage()
|
|||||||
setDisplayCategory(QCoreApplication::translate("CodePaster",
|
setDisplayCategory(QCoreApplication::translate("CodePaster",
|
||||||
Constants::CPASTER_SETTINGS_TR_CATEGORY));
|
Constants::CPASTER_SETTINGS_TR_CATEGORY));
|
||||||
|
|
||||||
m_settings = Core::ICore::settings();
|
|
||||||
if (m_settings) {
|
|
||||||
const QString keyRoot = QLatin1String(settingsGroupC) + QLatin1Char('/');
|
const QString keyRoot = QLatin1String(settingsGroupC) + QLatin1Char('/');
|
||||||
m_host = m_settings->value(keyRoot + QLatin1String(serverKeyC), QString()).toString();
|
m_host = Core::ICore::settings()->value(keyRoot + QLatin1String(serverKeyC), QString()).toString();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
|
QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
|
||||||
@@ -83,12 +80,11 @@ QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
|
|||||||
|
|
||||||
void CodePasterSettingsPage::apply()
|
void CodePasterSettingsPage::apply()
|
||||||
{
|
{
|
||||||
if (!m_settings)
|
QSettings *settings = Core::ICore::settings();
|
||||||
return;
|
const QString keyRoot = QLatin1String(settingsGroupC) + QLatin1Char('/');
|
||||||
|
settings->beginGroup(QLatin1String(settingsGroupC));
|
||||||
m_settings->beginGroup(QLatin1String(settingsGroupC));
|
settings->setValue(QLatin1String(serverKeyC), m_host);
|
||||||
m_settings->setValue(QLatin1String(serverKeyC), m_host);
|
settings->endGroup();
|
||||||
m_settings->endGroup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodePasterSettingsPage::serverChanged(const QString &host)
|
void CodePasterSettingsPage::serverChanged(const QString &host)
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ public slots:
|
|||||||
void serverChanged(const QString &host);
|
void serverChanged(const QString &host);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSettings *m_settings;
|
|
||||||
QString m_host;
|
QString m_host;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -590,17 +590,14 @@ void CppCodeStyleSettingsPage::apply()
|
|||||||
CppCodeStylePreferences *originalCppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle();
|
CppCodeStylePreferences *originalCppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle();
|
||||||
if (originalCppCodeStylePreferences->codeStyleSettings() != m_pageCppCodeStylePreferences->codeStyleSettings()) {
|
if (originalCppCodeStylePreferences->codeStyleSettings() != m_pageCppCodeStylePreferences->codeStyleSettings()) {
|
||||||
originalCppCodeStylePreferences->setCodeStyleSettings(m_pageCppCodeStylePreferences->codeStyleSettings());
|
originalCppCodeStylePreferences->setCodeStyleSettings(m_pageCppCodeStylePreferences->codeStyleSettings());
|
||||||
if (s)
|
|
||||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||||
}
|
}
|
||||||
if (originalCppCodeStylePreferences->tabSettings() != m_pageCppCodeStylePreferences->tabSettings()) {
|
if (originalCppCodeStylePreferences->tabSettings() != m_pageCppCodeStylePreferences->tabSettings()) {
|
||||||
originalCppCodeStylePreferences->setTabSettings(m_pageCppCodeStylePreferences->tabSettings());
|
originalCppCodeStylePreferences->setTabSettings(m_pageCppCodeStylePreferences->tabSettings());
|
||||||
if (s)
|
|
||||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||||
}
|
}
|
||||||
if (originalCppCodeStylePreferences->currentDelegate() != m_pageCppCodeStylePreferences->currentDelegate()) {
|
if (originalCppCodeStylePreferences->currentDelegate() != m_pageCppCodeStylePreferences->currentDelegate()) {
|
||||||
originalCppCodeStylePreferences->setCurrentDelegate(m_pageCppCodeStylePreferences->currentDelegate());
|
originalCppCodeStylePreferences->setCurrentDelegate(m_pageCppCodeStylePreferences->currentDelegate());
|
||||||
if (s)
|
|
||||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,25 +79,25 @@ void ProjectPart::evaluateToolchain(const ToolChain *tc,
|
|||||||
ToolChain::CompilerFlags c = (cxxflags == cflags)
|
ToolChain::CompilerFlags c = (cxxflags == cflags)
|
||||||
? cxx : tc->compilerFlags(cflags);
|
? cxx : tc->compilerFlags(cflags);
|
||||||
|
|
||||||
if (c | ToolChain::StandardC11)
|
if (c & ToolChain::StandardC11)
|
||||||
cVersion = C11;
|
cVersion = C11;
|
||||||
else if (c | ToolChain::StandardC99)
|
else if (c & ToolChain::StandardC99)
|
||||||
cVersion = C99;
|
cVersion = C99;
|
||||||
else
|
else
|
||||||
cVersion = C89;
|
cVersion = C89;
|
||||||
|
|
||||||
if (cxx | ToolChain::StandardCxx11)
|
if (cxx & ToolChain::StandardCxx11)
|
||||||
cxxVersion = CXX11;
|
cxxVersion = CXX11;
|
||||||
else
|
else
|
||||||
cxxVersion = CXX98;
|
cxxVersion = CXX98;
|
||||||
|
|
||||||
if (cxx | ToolChain::BorlandExtensions)
|
if (cxx & ToolChain::BorlandExtensions)
|
||||||
cxxExtensions |= BorlandExtensions;
|
cxxExtensions |= BorlandExtensions;
|
||||||
if (cxx | ToolChain::GnuExtensions)
|
if (cxx & ToolChain::GnuExtensions)
|
||||||
cxxExtensions |= GnuExtensions;
|
cxxExtensions |= GnuExtensions;
|
||||||
if (cxx | ToolChain::MicrosoftExtensions)
|
if (cxx & ToolChain::MicrosoftExtensions)
|
||||||
cxxExtensions |= MicrosoftExtensions;
|
cxxExtensions |= MicrosoftExtensions;
|
||||||
if (cxx | ToolChain::OpenMP)
|
if (cxx & ToolChain::OpenMP)
|
||||||
cxxExtensions |= OpenMP;
|
cxxExtensions |= OpenMP;
|
||||||
|
|
||||||
cWarningFlags = tc->warningFlags(cflags);
|
cWarningFlags = tc->warningFlags(cflags);
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
|
|||||||
|
|
||||||
// load global settings (after built-in settings are added to the pool)
|
// load global settings (after built-in settings are added to the pool)
|
||||||
QSettings *s = Core::ICore::settings();
|
QSettings *s = Core::ICore::settings();
|
||||||
d->m_globalCodeStyle->fromSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), Core::ICore::settings());
|
d->m_globalCodeStyle->fromSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||||
|
|
||||||
// legacy handling start (Qt Creator Version < 2.4)
|
// legacy handling start (Qt Creator Version < 2.4)
|
||||||
const bool legacyTransformed =
|
const bool legacyTransformed =
|
||||||
|
|||||||
@@ -233,8 +233,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
if (!ICore::mimeDatabase()->addMimeTypes(QLatin1String(":/trolltech.cvs/CVS.mimetypes.xml"), errorMessage))
|
if (!ICore::mimeDatabase()->addMimeTypes(QLatin1String(":/trolltech.cvs/CVS.mimetypes.xml"), errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (QSettings *settings = ICore::settings())
|
m_settings.fromSettings(ICore::settings());
|
||||||
m_settings.fromSettings(settings);
|
|
||||||
|
|
||||||
addAutoReleasedObject(new SettingsPage);
|
addAutoReleasedObject(new SettingsPage);
|
||||||
|
|
||||||
@@ -1299,8 +1298,7 @@ void CvsPlugin::setSettings(const CvsSettings &s)
|
|||||||
{
|
{
|
||||||
if (s != m_settings) {
|
if (s != m_settings) {
|
||||||
m_settings = s;
|
m_settings = s;
|
||||||
if (QSettings *settings = ICore::settings())
|
m_settings.toSettings(ICore::settings());
|
||||||
m_settings.toSettings(settings);
|
|
||||||
cvsVersionControl()->emitConfigurationChanged();
|
cvsVersionControl()->emitConfigurationChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ bool CdbOptionsPage::matches(const QString &s) const
|
|||||||
|
|
||||||
class CdbPathsPageWidget : public QWidget
|
class CdbPathsPageWidget : public QWidget
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Utils::SavedActionSet group;
|
Utils::SavedActionSet group;
|
||||||
|
|
||||||
@@ -346,3 +347,5 @@ bool CdbPathsPage::matches(const QString &searchKeyWord) const
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
|
#include "cdboptionspage.moc"
|
||||||
|
|||||||
@@ -552,8 +552,6 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
|
|||||||
void DebuggerMainWindow::writeSettings() const
|
void DebuggerMainWindow::writeSettings() const
|
||||||
{
|
{
|
||||||
QSettings *settings = ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
|
|
||||||
settings->beginGroup(QLatin1String("DebugMode.CppMode"));
|
settings->beginGroup(QLatin1String("DebugMode.CppMode"));
|
||||||
QHashIterator<QString, QVariant> it(d->m_dockWidgetActiveStateCpp);
|
QHashIterator<QString, QVariant> it(d->m_dockWidgetActiveStateCpp);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
@@ -574,8 +572,6 @@ void DebuggerMainWindow::writeSettings() const
|
|||||||
void DebuggerMainWindow::readSettings()
|
void DebuggerMainWindow::readSettings()
|
||||||
{
|
{
|
||||||
QSettings *settings = ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
|
|
||||||
d->m_dockWidgetActiveStateCpp.clear();
|
d->m_dockWidgetActiveStateCpp.clear();
|
||||||
d->m_dockWidgetActiveStateQmlCpp.clear();
|
d->m_dockWidgetActiveStateQmlCpp.clear();
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,17 @@ LldbEngine::LldbEngine(const DebuggerStartParameters &startParameters)
|
|||||||
m_lastAgentId = 0;
|
m_lastAgentId = 0;
|
||||||
m_lastToken = 0;
|
m_lastToken = 0;
|
||||||
setObjectName(QLatin1String("LldbEngine"));
|
setObjectName(QLatin1String("LldbEngine"));
|
||||||
|
|
||||||
|
connect(debuggerCore()->action(AutoDerefPointers), SIGNAL(valueChanged(QVariant)),
|
||||||
|
SLOT(updateLocals()));
|
||||||
|
connect(debuggerCore()->action(CreateFullBacktrace), SIGNAL(triggered()),
|
||||||
|
SLOT(updateAll()));
|
||||||
|
connect(debuggerCore()->action(UseDebuggingHelpers), SIGNAL(valueChanged(QVariant)),
|
||||||
|
SLOT(updateLocals()));
|
||||||
|
connect(debuggerCore()->action(UseDynamicType), SIGNAL(valueChanged(QVariant)),
|
||||||
|
SLOT(updateLocals()));
|
||||||
|
connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
|
||||||
|
SLOT(updateAll()));
|
||||||
}
|
}
|
||||||
|
|
||||||
LldbEngine::~LldbEngine()
|
LldbEngine::~LldbEngine()
|
||||||
@@ -108,7 +119,7 @@ void LldbEngine::runCommand(const Command &command)
|
|||||||
void LldbEngine::shutdownInferior()
|
void LldbEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
||||||
notifyInferiorShutdownOk();
|
runCommand(Command("shutdownInferior"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::shutdownEngine()
|
void LldbEngine::shutdownEngine()
|
||||||
@@ -249,6 +260,8 @@ void LldbEngine::handleResponse(const QByteArray &response)
|
|||||||
refreshSymbols(item);
|
refreshSymbols(item);
|
||||||
else if (name == "bkpts")
|
else if (name == "bkpts")
|
||||||
refreshBreakpoints(item);
|
refreshBreakpoints(item);
|
||||||
|
else if (name == "output")
|
||||||
|
refreshOutput(item);
|
||||||
else if (name == "disassembly")
|
else if (name == "disassembly")
|
||||||
refreshDisassembly(item);
|
refreshDisassembly(item);
|
||||||
else if (name == "memory")
|
else if (name == "memory")
|
||||||
@@ -483,6 +496,18 @@ void LldbEngine::refreshMemory(const GdbMi &data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LldbEngine::refreshOutput(const GdbMi &output)
|
||||||
|
{
|
||||||
|
QByteArray channel = output["channel"].data();
|
||||||
|
QByteArray data = QByteArray::fromHex(output["data"].data());
|
||||||
|
LogChannel ch = AppStuff;
|
||||||
|
if (channel == "stdout")
|
||||||
|
ch = AppOutput;
|
||||||
|
else if (channel == "stderr")
|
||||||
|
ch = AppError;
|
||||||
|
showMessage(QString::fromUtf8(data), ch);
|
||||||
|
}
|
||||||
|
|
||||||
void LldbEngine::refreshBreakpoints(const GdbMi &bkpts)
|
void LldbEngine::refreshBreakpoints(const GdbMi &bkpts)
|
||||||
{
|
{
|
||||||
BreakHandler *handler = breakHandler();
|
BreakHandler *handler = breakHandler();
|
||||||
@@ -640,6 +665,10 @@ bool LldbEngine::setToolTipExpression(const QPoint &mousePos,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LldbEngine::updateAll()
|
||||||
|
{
|
||||||
|
updateLocals();
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@@ -663,6 +692,11 @@ void LldbEngine::updateWatchData(const WatchData &data, const WatchUpdateFlags &
|
|||||||
{
|
{
|
||||||
Q_UNUSED(data);
|
Q_UNUSED(data);
|
||||||
Q_UNUSED(flags);
|
Q_UNUSED(flags);
|
||||||
|
updateLocals();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LldbEngine::updateLocals()
|
||||||
|
{
|
||||||
WatchHandler *handler = watchHandler();
|
WatchHandler *handler = watchHandler();
|
||||||
|
|
||||||
Command cmd("updateData");
|
Command cmd("updateData");
|
||||||
@@ -787,7 +821,7 @@ void LldbEngine::readLldbStandardError()
|
|||||||
qDebug() << "\nLLDB STDERR" << err;
|
qDebug() << "\nLLDB STDERR" << err;
|
||||||
//qWarning() << "Unexpected lldb stderr:" << err;
|
//qWarning() << "Unexpected lldb stderr:" << err;
|
||||||
showMessage(_("Lldb stderr: " + err));
|
showMessage(_("Lldb stderr: " + err));
|
||||||
//handleOutput(err);
|
m_lldbProc.kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::readLldbStandardOutput()
|
void LldbEngine::readLldbStandardOutput()
|
||||||
@@ -859,11 +893,6 @@ QByteArray LldbEngine::currentOptions() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::updateAll()
|
|
||||||
{
|
|
||||||
runCommand("reportData");
|
|
||||||
}
|
|
||||||
|
|
||||||
void LldbEngine::refreshLocals(const GdbMi &vars)
|
void LldbEngine::refreshLocals(const GdbMi &vars)
|
||||||
{
|
{
|
||||||
//const bool partial = response.cookie.toBool();
|
//const bool partial = response.cookie.toBool();
|
||||||
@@ -985,8 +1014,20 @@ void LldbEngine::refreshState(const GdbMi &reportedState)
|
|||||||
notifyInferiorSpontaneousStop();
|
notifyInferiorSpontaneousStop();
|
||||||
else if (newState == "inferiorsetupok")
|
else if (newState == "inferiorsetupok")
|
||||||
notifyInferiorSetupOk();
|
notifyInferiorSetupOk();
|
||||||
else if (newState == "enginerunok")
|
else if (newState == "enginerunandinferiorrunok")
|
||||||
notifyEngineRunAndInferiorRunOk();
|
notifyEngineRunAndInferiorRunOk();
|
||||||
|
else if (newState == "enginerunandinferiorstopok")
|
||||||
|
notifyEngineRunAndInferiorStopOk();
|
||||||
|
else if (newState == "inferiorshutdownok")
|
||||||
|
notifyInferiorShutdownOk();
|
||||||
|
else if (newState == "inferiorshutdownfailed")
|
||||||
|
notifyInferiorShutdownFailed();
|
||||||
|
else if (newState == "engineshutdownok")
|
||||||
|
notifyEngineShutdownOk();
|
||||||
|
else if (newState == "engineshutdownfailed")
|
||||||
|
notifyEngineShutdownFailed();
|
||||||
|
else if (newState == "inferiorexited")
|
||||||
|
notifyInferiorExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::refreshLocation(const GdbMi &reportedLocation)
|
void LldbEngine::refreshLocation(const GdbMi &reportedLocation)
|
||||||
|
|||||||
@@ -153,21 +153,22 @@ private:
|
|||||||
Q_SLOT void readLldbStandardError();
|
Q_SLOT void readLldbStandardError();
|
||||||
Q_SLOT void handleResponse(const QByteArray &data);
|
Q_SLOT void handleResponse(const QByteArray &data);
|
||||||
Q_SLOT void runEngine2();
|
Q_SLOT void runEngine2();
|
||||||
|
Q_SLOT void updateAll();
|
||||||
|
Q_SLOT void updateLocals();
|
||||||
void refreshAll(const GdbMi &all);
|
void refreshAll(const GdbMi &all);
|
||||||
void refreshThreads(const GdbMi &threads);
|
void refreshThreads(const GdbMi &threads);
|
||||||
void refreshStack(const GdbMi &stack);
|
void refreshStack(const GdbMi &stack);
|
||||||
void refreshRegisters(const GdbMi &stack);
|
void refreshRegisters(const GdbMi ®isters);
|
||||||
void refreshLocals(const GdbMi &vars);
|
void refreshLocals(const GdbMi &vars);
|
||||||
void refreshTypeInfo(const GdbMi &typeInfo);
|
void refreshTypeInfo(const GdbMi &typeInfo);
|
||||||
void refreshState(const GdbMi &state);
|
void refreshState(const GdbMi &state);
|
||||||
void refreshLocation(const GdbMi &location);
|
void refreshLocation(const GdbMi &location);
|
||||||
void refreshModules(const GdbMi &modules);
|
void refreshModules(const GdbMi &modules);
|
||||||
void refreshSymbols(const GdbMi &symbols);
|
void refreshSymbols(const GdbMi &symbols);
|
||||||
|
void refreshOutput(const GdbMi &output);
|
||||||
void refreshBreakpoints(const GdbMi &bkpts);
|
void refreshBreakpoints(const GdbMi &bkpts);
|
||||||
void runContinuation(const GdbMi &data);
|
void runContinuation(const GdbMi &data);
|
||||||
|
|
||||||
void updateAll();
|
|
||||||
|
|
||||||
typedef void (LldbEngine::*LldbCommandContinuation)();
|
typedef void (LldbEngine::*LldbCommandContinuation)();
|
||||||
|
|
||||||
QByteArray currentOptions() const;
|
QByteArray currentOptions() const;
|
||||||
|
|||||||
@@ -129,24 +129,12 @@ void MemoryAgent::updateMemoryView(quint64 address, quint64 length)
|
|||||||
|
|
||||||
void MemoryAgent::connectBinEditorWidget(QWidget *w)
|
void MemoryAgent::connectBinEditorWidget(QWidget *w)
|
||||||
{
|
{
|
||||||
connect(w,
|
connect(w, SIGNAL(dataRequested(quint64)), SLOT(fetchLazyData(quint64)));
|
||||||
SIGNAL(dataRequested(Core::IEditor*,quint64)),
|
connect(w, SIGNAL(newWindowRequested(quint64)), SLOT(createBinEditor(quint64)));
|
||||||
SLOT(fetchLazyData(Core::IEditor*,quint64)));
|
connect(w, SIGNAL(newRangeRequested(quint64)), SLOT(provideNewRange(quint64)));
|
||||||
connect(w,
|
connect(w, SIGNAL(dataChanged(quint64,QByteArray)), SLOT(handleDataChanged(quint64,QByteArray)));
|
||||||
SIGNAL(newWindowRequested(quint64)),
|
connect(w, SIGNAL(dataChanged(quint64,QByteArray)), SLOT(handleDataChanged(quint64,QByteArray)));
|
||||||
SLOT(createBinEditor(quint64)));
|
connect(w, SIGNAL(addWatchpointRequested(quint64,uint)), SLOT(handleWatchpointRequest(quint64,uint)));
|
||||||
connect(w,
|
|
||||||
SIGNAL(newRangeRequested(Core::IEditor*,quint64)),
|
|
||||||
SLOT(provideNewRange(Core::IEditor*,quint64)));
|
|
||||||
connect(w,
|
|
||||||
SIGNAL(dataChanged(Core::IEditor*,quint64,QByteArray)),
|
|
||||||
SLOT(handleDataChanged(Core::IEditor*,quint64,QByteArray)));
|
|
||||||
connect(w,
|
|
||||||
SIGNAL(dataChanged(Core::IEditor*,quint64,QByteArray)),
|
|
||||||
SLOT(handleDataChanged(Core::IEditor*,quint64,QByteArray)));
|
|
||||||
connect(w,
|
|
||||||
SIGNAL(addWatchpointRequested(quint64,uint)),
|
|
||||||
SLOT(handleWatchpointRequest(quint64,uint)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MemoryAgent::doCreateBinEditor(quint64 addr, unsigned flags,
|
bool MemoryAgent::doCreateBinEditor(quint64 addr, unsigned flags,
|
||||||
@@ -222,7 +210,7 @@ void MemoryAgent::createBinEditor(quint64 addr)
|
|||||||
createBinEditor(addr, 0, QList<MemoryMarkup>(), QPoint(), QString(), 0);
|
createBinEditor(addr, 0, QList<MemoryMarkup>(), QPoint(), QString(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryAgent::fetchLazyData(IEditor *, quint64 block)
|
void MemoryAgent::fetchLazyData(quint64 block)
|
||||||
{
|
{
|
||||||
m_engine->fetchMemory(this, sender(), BinBlockSize * block, BinBlockSize);
|
m_engine->fetchMemory(this, sender(), BinBlockSize * block, BinBlockSize);
|
||||||
}
|
}
|
||||||
@@ -235,15 +223,14 @@ void MemoryAgent::addLazyData(QObject *editorToken, quint64 addr,
|
|||||||
MemoryView::binEditorAddData(w, addr, ba);
|
MemoryView::binEditorAddData(w, addr, ba);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryAgent::provideNewRange(IEditor *, quint64 address)
|
void MemoryAgent::provideNewRange(quint64 address)
|
||||||
{
|
{
|
||||||
QWidget *w = qobject_cast<QWidget *>(sender());
|
QWidget *w = qobject_cast<QWidget *>(sender());
|
||||||
QTC_ASSERT(w, return);
|
QTC_ASSERT(w, return);
|
||||||
MemoryView::setBinEditorRange(w, address, DataRange, BinBlockSize);
|
MemoryView::setBinEditorRange(w, address, DataRange, BinBlockSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryAgent::handleDataChanged(IEditor *,
|
void MemoryAgent::handleDataChanged(quint64 addr, const QByteArray &data)
|
||||||
quint64 addr, const QByteArray &data)
|
|
||||||
{
|
{
|
||||||
m_engine->changeMemory(this, sender(), addr, data);
|
m_engine->changeMemory(this, sender(), addr, data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,10 +95,9 @@ public slots:
|
|||||||
void closeViews();
|
void closeViews();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void fetchLazyData(Core::IEditor *, quint64 block);
|
void fetchLazyData(quint64 block);
|
||||||
void provideNewRange(Core::IEditor *editor, quint64 address);
|
void provideNewRange(quint64 address);
|
||||||
void handleDataChanged(Core::IEditor *editor, quint64 address,
|
void handleDataChanged(quint64 address, const QByteArray &data);
|
||||||
const QByteArray &data);
|
|
||||||
void handleWatchpointRequest(quint64 address, uint size);
|
void handleWatchpointRequest(quint64 address, uint size);
|
||||||
void updateMemoryView(quint64 address, quint64 length);
|
void updateMemoryView(quint64 address, quint64 length);
|
||||||
void engineStateChanged(Debugger::DebuggerState s);
|
void engineStateChanged(Debugger::DebuggerState s);
|
||||||
|
|||||||
@@ -44,11 +44,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body>
|
<string><html><head/><body><p>The debugger is not configured to use the public Microsoft Symbol Server.<br/>This is recommended for retrieval of the symbols of the operating system libraries.</p><p><span style=" font-style:italic;">Note:</span> It is recommended, that if you use the Microsoft Symbol Server, to also use a local symbol cache.<br/>A fast internet connection is required for this to work smoothly,<br/>and a delay might occur when connecting for the first time and caching the symbols.</p><p>What would you like to set up?</p></body></html></string>
|
||||||
<p>The debugger is not configured to use the public Microsoft Symbol Server.<br>This is recommended for retrieval of the symbols of the operating system libraries.</p>
|
|
||||||
<p><span style=" font-style:italic;">Note:</span> It is recommended, that if you use the Microsoft Symbol Server, to also use a local symbol cache.<br>Also, a fast internet connection is required for this to work smoothly,<br>and a delay might occur when connecting for the first time, when caching the symbols for the first time.</p>
|
|
||||||
<p>Would you like to set it up?</p>
|
|
||||||
</body></html></string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
|
|||||||
@@ -37,61 +37,40 @@
|
|||||||
|
|
||||||
using namespace Designer::Internal;
|
using namespace Designer::Internal;
|
||||||
|
|
||||||
static inline QSettings *coreSettings()
|
|
||||||
{
|
|
||||||
if (Core::ICore::instance())
|
|
||||||
return Core::ICore::settings();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SettingsManager::beginGroup(const QString &prefix)
|
void SettingsManager::beginGroup(const QString &prefix)
|
||||||
{
|
{
|
||||||
QSettings *settings = coreSettings();
|
Core::ICore::settings()->beginGroup(addPrefix(prefix));
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
settings->beginGroup(addPrefix(prefix));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsManager::endGroup()
|
void SettingsManager::endGroup()
|
||||||
{
|
{
|
||||||
QSettings *settings = coreSettings();
|
Core::ICore::settings()->endGroup();
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
settings->endGroup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SettingsManager::contains(const QString &key) const
|
bool SettingsManager::contains(const QString &key) const
|
||||||
{
|
{
|
||||||
const QSettings *settings = coreSettings();
|
return Core::ICore::settings()->contains(addPrefix(key));
|
||||||
QTC_ASSERT(settings, return false);
|
|
||||||
return settings->contains(addPrefix(key));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsManager::setValue(const QString &key, const QVariant &value)
|
void SettingsManager::setValue(const QString &key, const QVariant &value)
|
||||||
{
|
{
|
||||||
QSettings *settings = coreSettings();
|
Core::ICore::settings()->setValue(addPrefix(key), value);
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
settings->setValue(addPrefix(key), value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant SettingsManager::value(const QString &key, const QVariant &defaultValue) const
|
QVariant SettingsManager::value(const QString &key, const QVariant &defaultValue) const
|
||||||
{
|
{
|
||||||
const QSettings *settings = coreSettings();
|
return Core::ICore::settings()->value(addPrefix(key), defaultValue);
|
||||||
QTC_ASSERT(settings, return QVariant());
|
|
||||||
return settings->value(addPrefix(key), defaultValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsManager::remove(const QString &key)
|
void SettingsManager::remove(const QString &key)
|
||||||
{
|
{
|
||||||
QSettings *settings = coreSettings();
|
Core::ICore::settings()->remove(addPrefix(key));
|
||||||
QTC_ASSERT(settings, return);
|
|
||||||
settings->remove(addPrefix(key));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SettingsManager::addPrefix(const QString &name) const
|
QString SettingsManager::addPrefix(const QString &name) const
|
||||||
{
|
{
|
||||||
const QSettings *settings = coreSettings();
|
|
||||||
QTC_ASSERT(settings, return name);
|
|
||||||
QString result = name;
|
QString result = name;
|
||||||
if (settings->group().isEmpty())
|
if (Core::ICore::settings()->group().isEmpty())
|
||||||
result.prepend(QLatin1String("Designer"));
|
result.prepend(QLatin1String("Designer"));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -508,12 +508,10 @@ void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
|
|||||||
void SearchResultWindow::readSettings()
|
void SearchResultWindow::readSettings()
|
||||||
{
|
{
|
||||||
QSettings *s = Core::ICore::settings();
|
QSettings *s = Core::ICore::settings();
|
||||||
if (s) {
|
|
||||||
s->beginGroup(QLatin1String(SETTINGSKEYSECTIONNAME));
|
s->beginGroup(QLatin1String(SETTINGSKEYSECTIONNAME));
|
||||||
d->m_expandCollapseAction->setChecked(s->value(QLatin1String(SETTINGSKEYEXPANDRESULTS), d->m_initiallyExpand).toBool());
|
d->m_expandCollapseAction->setChecked(s->value(QLatin1String(SETTINGSKEYEXPANDRESULTS), d->m_initiallyExpand).toBool());
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
@@ -521,12 +519,10 @@ void SearchResultWindow::readSettings()
|
|||||||
void SearchResultWindow::writeSettings()
|
void SearchResultWindow::writeSettings()
|
||||||
{
|
{
|
||||||
QSettings *s = Core::ICore::settings();
|
QSettings *s = Core::ICore::settings();
|
||||||
if (s) {
|
|
||||||
s->beginGroup(QLatin1String(SETTINGSKEYSECTIONNAME));
|
s->beginGroup(QLatin1String(SETTINGSKEYSECTIONNAME));
|
||||||
s->setValue(QLatin1String(SETTINGSKEYEXPANDRESULTS), d->m_expandCollapseAction->isChecked());
|
s->setValue(QLatin1String(SETTINGSKEYEXPANDRESULTS), d->m_expandCollapseAction->isChecked());
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
|
|||||||
@@ -511,21 +511,19 @@ void GerritPlugin::fetch(const QSharedPointer<Gerrit::Internal::GerritChange> &c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifiedRepository && QFile::exists(repository + QLatin1String("/.gitmodules"))) {
|
if (!verifiedRepository) {
|
||||||
QMap<QString,QString> submodules = gitClient->synchronousSubmoduleList(repository);
|
Git::Internal::SubmoduleDataMap submodules = gitClient->submoduleList(repository);
|
||||||
|
foreach (const Git::Internal::SubmoduleData &submoduleData, submodules) {
|
||||||
QMap<QString,QString>::const_iterator i = submodules.constBegin();
|
QString remote = submoduleData.url;
|
||||||
while (i != submodules.constEnd()) {
|
|
||||||
QString remote = i.value();
|
|
||||||
if (remote.endsWith(QLatin1String(".git")))
|
if (remote.endsWith(QLatin1String(".git")))
|
||||||
remote.chop(4);
|
remote.chop(4);
|
||||||
if (remote.contains(m_parameters->host) && remote.endsWith(change->project)
|
if (remote.contains(m_parameters->host) && remote.endsWith(change->project)
|
||||||
&& QFile::exists(repository + QLatin1Char('/') + i.key())) {
|
&& QFile::exists(repository + QLatin1Char('/') + submoduleData.dir)) {
|
||||||
repository = QDir::cleanPath(repository + QLatin1Char('/') + i.key());
|
repository = QDir::cleanPath(repository + QLatin1Char('/')
|
||||||
|
+ submoduleData.dir);
|
||||||
verifiedRepository = true;
|
verifiedRepository = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1962,21 +1962,59 @@ QMap<QString,QString> GitClient::synchronousRemotesList(const QString &workingDi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// function returns submodules in format path=url
|
SubmoduleDataMap GitClient::submoduleList(const QString &workingDirectory)
|
||||||
QMap<QString,QString> GitClient::synchronousSubmoduleList(const QString &workingDirectory)
|
|
||||||
{
|
{
|
||||||
QMap<QString,QString> result;
|
SubmoduleDataMap result;
|
||||||
if (!QFile::exists(workingDirectory + QLatin1String("/.gitmodules")))
|
QString gitmodulesFileName = workingDirectory + QLatin1String("/.gitmodules");
|
||||||
|
if (!QFile::exists(gitmodulesFileName))
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
QSettings gitmodulesFile(workingDirectory + QLatin1String("/.gitmodules"), QSettings::IniFormat);
|
static QMap<QString, SubmoduleDataMap> cachedSubmoduleData;
|
||||||
|
|
||||||
foreach (const QString &submoduleGroup, gitmodulesFile.childGroups()) {
|
if (cachedSubmoduleData.contains(workingDirectory))
|
||||||
gitmodulesFile.beginGroup(submoduleGroup);
|
return cachedSubmoduleData.value(workingDirectory);
|
||||||
result.insertMulti(gitmodulesFile.value(QLatin1String("path")).toString(),
|
QStringList args(QLatin1String("-l"));
|
||||||
gitmodulesFile.value(QLatin1String("url")).toString());
|
|
||||||
|
QStringList allConfigs = readConfig(workingDirectory, args).split(QLatin1Char('\n'));
|
||||||
|
const QString submoduleLineStart = QLatin1String("submodule.");
|
||||||
|
foreach (const QString &configLine, allConfigs) {
|
||||||
|
if (!configLine.startsWith(submoduleLineStart))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
int nameStart = submoduleLineStart.size();
|
||||||
|
int nameEnd = configLine.indexOf(QLatin1Char('.'), nameStart);
|
||||||
|
|
||||||
|
QString submoduleName = configLine.mid(nameStart, nameEnd - nameStart);
|
||||||
|
|
||||||
|
SubmoduleData submoduleData;
|
||||||
|
if (result.contains(submoduleName))
|
||||||
|
submoduleData = result[submoduleName];
|
||||||
|
|
||||||
|
if (configLine.mid(nameEnd, 5) == QLatin1String(".url="))
|
||||||
|
submoduleData.url = configLine.mid(nameEnd + 5);
|
||||||
|
else if (configLine.mid(nameEnd, 8) == QLatin1String(".ignore="))
|
||||||
|
submoduleData.ignore = configLine.mid(nameEnd + 8);
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
|
||||||
|
result.insert(submoduleName, submoduleData);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if config found submodules
|
||||||
|
if (!result.isEmpty()) {
|
||||||
|
QSettings gitmodulesFile(gitmodulesFileName, QSettings::IniFormat);
|
||||||
|
|
||||||
|
foreach (const QString &submoduleName, result.keys()) {
|
||||||
|
gitmodulesFile.beginGroup(QLatin1String("submodule \"") +
|
||||||
|
submoduleName + QLatin1Char('"'));
|
||||||
|
result[submoduleName].dir = gitmodulesFile.value(QLatin1String("path")).toString();
|
||||||
|
QString ignore = gitmodulesFile.value(QLatin1String("ignore")).toString();
|
||||||
|
if (!ignore.isEmpty() && result[submoduleName].ignore.isEmpty())
|
||||||
|
result[submoduleName].ignore = ignore;
|
||||||
gitmodulesFile.endGroup();
|
gitmodulesFile.endGroup();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
cachedSubmoduleData.insert(workingDirectory, result);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -2172,7 +2210,7 @@ void GitClient::submoduleUpdate(const QString &workingDirectory)
|
|||||||
|
|
||||||
void GitClient::promptSubmoduleUpdate(const QString &workingDirectory)
|
void GitClient::promptSubmoduleUpdate(const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
if (!QFile::exists(workingDirectory + QLatin1String("/.gitmodules")))
|
if (submoduleList(workingDirectory).isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (QMessageBox::question(Core::ICore::mainWindow(), tr("Submodules Found"),
|
if (QMessageBox::question(Core::ICore::mainWindow(), tr("Submodules Found"),
|
||||||
|
|||||||
@@ -86,6 +86,16 @@ enum StashFlag {
|
|||||||
NoPrompt = 0x02
|
NoPrompt = 0x02
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SubmoduleData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString dir;
|
||||||
|
QString url;
|
||||||
|
QString ignore;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef QMap<QString, SubmoduleData> SubmoduleDataMap;
|
||||||
|
|
||||||
class GitClient : public QObject
|
class GitClient : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -200,7 +210,7 @@ public:
|
|||||||
|
|
||||||
QMap<QString,QString> synchronousRemotesList(const QString &workingDirectory,
|
QMap<QString,QString> synchronousRemotesList(const QString &workingDirectory,
|
||||||
QString *errorMessage = 0);
|
QString *errorMessage = 0);
|
||||||
QMap<QString,QString> synchronousSubmoduleList(const QString &workingDirectory);
|
SubmoduleDataMap submoduleList(const QString &workingDirectory);
|
||||||
bool synchronousShow(const QString &workingDirectory, const QString &id,
|
bool synchronousShow(const QString &workingDirectory, const QString &id,
|
||||||
QString *output, QString *errorMessage);
|
QString *output, QString *errorMessage);
|
||||||
|
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ ActionCommandPair
|
|||||||
{
|
{
|
||||||
QAction *action = new QAction(text, this);
|
QAction *action = new QAction(text, this);
|
||||||
Core::Command *command = Core::ActionManager::registerAction(action, id, context);
|
Core::Command *command = Core::ActionManager::registerAction(action, id, context);
|
||||||
|
if (ac)
|
||||||
ac->addAction(command);
|
ac->addAction(command);
|
||||||
m_repositoryActions.push_back(action);
|
m_repositoryActions.push_back(action);
|
||||||
if (addToLocator)
|
if (addToLocator)
|
||||||
@@ -439,7 +440,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
globalcontext, false, SLOT(resetRepository()));
|
globalcontext, false, SLOT(resetRepository()));
|
||||||
|
|
||||||
createRepositoryAction(localRepositoryMenu,
|
createRepositoryAction(localRepositoryMenu,
|
||||||
tr("Interactive Rebase..."), Core::Id("Git.Rebase"),
|
tr("Interactive Rebase..."), Core::Id("Git.InteractiveRebase"),
|
||||||
globalcontext, true, SLOT(startRebase()));
|
globalcontext, true, SLOT(startRebase()));
|
||||||
|
|
||||||
createRepositoryAction(localRepositoryMenu,
|
createRepositoryAction(localRepositoryMenu,
|
||||||
@@ -591,6 +592,29 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
|
|
||||||
// --------------
|
// --------------
|
||||||
|
|
||||||
|
/* Actions only in locator */
|
||||||
|
createRepositoryAction(0, tr("Show..."), Core::Id("Git.Show"),
|
||||||
|
globalcontext, true, SLOT(startChangeRelatedAction()));
|
||||||
|
|
||||||
|
createRepositoryAction(0, tr("Revert..."), Core::Id("Git.Revert"),
|
||||||
|
globalcontext, true, SLOT(startChangeRelatedAction()));
|
||||||
|
|
||||||
|
createRepositoryAction(0, tr("Cherry Pick..."), Core::Id("Git.CherryPick"),
|
||||||
|
globalcontext, true, SLOT(startChangeRelatedAction()));
|
||||||
|
|
||||||
|
createRepositoryAction(0, tr("Checkout..."), Core::Id("Git.Checkout"),
|
||||||
|
globalcontext, true, SLOT(startChangeRelatedAction()));
|
||||||
|
|
||||||
|
createRepositoryAction(0, tr("Rebase..."), Core::Id("Git.Rebase"),
|
||||||
|
globalcontext, true, SLOT(branchList()));
|
||||||
|
|
||||||
|
createRepositoryAction(0, tr("Merge..."), Core::Id("Git.Merge"),
|
||||||
|
globalcontext, true, SLOT(branchList()));
|
||||||
|
|
||||||
|
/* \Actions only in locator */
|
||||||
|
|
||||||
|
// --------------
|
||||||
|
|
||||||
/* "Git Tools" menu */
|
/* "Git Tools" menu */
|
||||||
Core::ActionContainer *gitToolsMenu = Core::ActionManager::createMenu(Core::Id("Git.GitToolsMenu"));
|
Core::ActionContainer *gitToolsMenu = Core::ActionManager::createMenu(Core::Id("Git.GitToolsMenu"));
|
||||||
gitToolsMenu->menu()->setTitle(tr("Git &Tools"));
|
gitToolsMenu->menu()->setTitle(tr("Git &Tools"));
|
||||||
@@ -1323,8 +1347,9 @@ void GitPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
|
|||||||
|
|
||||||
foreach (QAction *repositoryAction, m_repositoryActions)
|
foreach (QAction *repositoryAction, m_repositoryActions)
|
||||||
repositoryAction->setEnabled(repositoryEnabled);
|
repositoryAction->setEnabled(repositoryEnabled);
|
||||||
|
|
||||||
m_submoduleUpdateAction->setVisible(repositoryEnabled
|
m_submoduleUpdateAction->setVisible(repositoryEnabled
|
||||||
&& QFile::exists(currentState().topLevel() + QLatin1String("/.gitmodules")));
|
&& !m_gitClient->submoduleList(currentState().topLevel()).isEmpty());
|
||||||
|
|
||||||
updateContinueAndAbortCommands();
|
updateContinueAndAbortCommands();
|
||||||
updateRepositoryBrowserAction();
|
updateRepositoryBrowserAction();
|
||||||
|
|||||||
@@ -1274,7 +1274,6 @@ void ProjectExplorerPlugin::savePersistentSettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QSettings *s = Core::ICore::settings();
|
QSettings *s = Core::ICore::settings();
|
||||||
if (s) {
|
|
||||||
s->setValue(QLatin1String("ProjectExplorer/StartupSession"), d->m_session->activeSession());
|
s->setValue(QLatin1String("ProjectExplorer/StartupSession"), d->m_session->activeSession());
|
||||||
s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files"));
|
s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files"));
|
||||||
|
|
||||||
@@ -1305,7 +1304,6 @@ void ProjectExplorerPlugin::savePersistentSettings()
|
|||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), d->m_projectExplorerSettings.maxAppOutputLines);
|
s->setValue(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), d->m_projectExplorerSettings.maxAppOutputLines);
|
||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/EnvironmentId"), d->m_projectExplorerSettings.environmentId.toByteArray());
|
s->setValue(QLatin1String("ProjectExplorer/Settings/EnvironmentId"), d->m_projectExplorerSettings.environmentId.toByteArray());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ProjectExplorerPlugin::openProjectWelcomePage(const QString &fileName)
|
void ProjectExplorerPlugin::openProjectWelcomePage(const QString &fileName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -319,8 +319,6 @@ QtcPlugin {
|
|||||||
"images/targetleftbutton.png",
|
"images/targetleftbutton.png",
|
||||||
"images/targetpanel_bottom.png",
|
"images/targetpanel_bottom.png",
|
||||||
"images/targetpanel_gradient.png",
|
"images/targetpanel_gradient.png",
|
||||||
"images/targetremovebutton.png",
|
|
||||||
"images/targetremovebuttondark.png",
|
|
||||||
"images/targetrightbutton.png",
|
"images/targetrightbutton.png",
|
||||||
"images/targetrunselected.png",
|
"images/targetrunselected.png",
|
||||||
"images/targetseparatorbackground.png",
|
"images/targetseparatorbackground.png",
|
||||||
|
|||||||
@@ -658,8 +658,10 @@ void Target::updateDefaultRunConfigurations()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do actual changes:
|
// Do actual changes:
|
||||||
foreach (RunConfiguration *rc, toRemove)
|
foreach (RunConfiguration *rc, toRemove) {
|
||||||
removeRunConfiguration(rc);
|
removeRunConfiguration(rc);
|
||||||
|
existingConfigured.removeOne(rc); // make sure to also remove them from existingConfigured!
|
||||||
|
}
|
||||||
|
|
||||||
if (removeExistingUnconfigured) {
|
if (removeExistingUnconfigured) {
|
||||||
foreach (RunConfiguration *rc, existingUnconfigured)
|
foreach (RunConfiguration *rc, existingUnconfigured)
|
||||||
|
|||||||
@@ -45,10 +45,13 @@ public:
|
|||||||
TaskHub();
|
TaskHub();
|
||||||
virtual ~TaskHub();
|
virtual ~TaskHub();
|
||||||
|
|
||||||
|
public slots:
|
||||||
void addCategory(const Core::Id &categoryId, const QString &displayName, bool visible = true);
|
void addCategory(const Core::Id &categoryId, const QString &displayName, bool visible = true);
|
||||||
void addTask(Task task);
|
void addTask(ProjectExplorer::Task task);
|
||||||
void clearTasks(const Core::Id &categoryId = Core::Id());
|
void clearTasks(const Core::Id &categoryId = Core::Id());
|
||||||
void removeTask(const Task &task);
|
void removeTask(const ProjectExplorer::Task &task);
|
||||||
|
|
||||||
|
public:
|
||||||
void updateTaskFileName(unsigned int id, const QString &fileName);
|
void updateTaskFileName(unsigned int id, const QString &fileName);
|
||||||
void updateTaskLineNumber(unsigned int id, int line);
|
void updateTaskLineNumber(unsigned int id, int line);
|
||||||
void taskMarkClicked(unsigned int id);
|
void taskMarkClicked(unsigned int id);
|
||||||
@@ -58,6 +61,7 @@ public:
|
|||||||
void requestPopup();
|
void requestPopup();
|
||||||
|
|
||||||
QIcon taskTypeIcon(ProjectExplorer::Task::TaskType t) const;
|
QIcon taskTypeIcon(ProjectExplorer::Task::TaskType t) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void categoryAdded(const Core::Id &categoryId, const QString &displayName, bool visible);
|
void categoryAdded(const Core::Id &categoryId, const QString &displayName, bool visible);
|
||||||
void taskAdded(const ProjectExplorer::Task &task);
|
void taskAdded(const ProjectExplorer::Task &task);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include(../../qtcreatorplugin.pri)
|
|||||||
DEFINES += \
|
DEFINES += \
|
||||||
PYTHONEDITOR_LIBRARY
|
PYTHONEDITOR_LIBRARY
|
||||||
|
|
||||||
OTHER_FILES += PythonEditor.pluginspec.in \
|
OTHER_FILES += \
|
||||||
pythoneditor.mimetypes.xml
|
pythoneditor.mimetypes.xml
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
|
|||||||
@@ -135,8 +135,6 @@ void QbsBuildStep::run(QFutureInterface<bool> &fi)
|
|||||||
this, SLOT(handleProgress(int)));
|
this, SLOT(handleProgress(int)));
|
||||||
connect(m_job, SIGNAL(reportCommandDescription(QString,QString)),
|
connect(m_job, SIGNAL(reportCommandDescription(QString,QString)),
|
||||||
this, SLOT(handleCommandDescriptionReport(QString,QString)));
|
this, SLOT(handleCommandDescriptionReport(QString,QString)));
|
||||||
connect(m_job, SIGNAL(reportWarning(qbs::Error)),
|
|
||||||
this, SLOT(handleWarningReport(qbs::Error)));
|
|
||||||
connect(m_job, SIGNAL(reportProcessResult(qbs::ProcessResult)),
|
connect(m_job, SIGNAL(reportProcessResult(qbs::ProcessResult)),
|
||||||
this, SLOT(handleProcessResultReport(qbs::ProcessResult)));
|
this, SLOT(handleProcessResultReport(qbs::ProcessResult)));
|
||||||
}
|
}
|
||||||
@@ -248,14 +246,6 @@ void QbsBuildStep::handleProgress(int value)
|
|||||||
m_fi->setProgressValue(m_progressBase + value);
|
m_fi->setProgressValue(m_progressBase + value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsBuildStep::handleWarningReport(const qbs::Error &error)
|
|
||||||
{
|
|
||||||
foreach (const qbs::ErrorData &data, error.entries()) {
|
|
||||||
createTaskAndOutput(ProjectExplorer::Task::Warning, data.description(),
|
|
||||||
data.codeLocation().fileName(), data.codeLocation().line());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QbsBuildStep::handleCommandDescriptionReport(const QString &highlight, const QString &message)
|
void QbsBuildStep::handleCommandDescriptionReport(const QString &highlight, const QString &message)
|
||||||
{
|
{
|
||||||
Q_UNUSED(highlight);
|
Q_UNUSED(highlight);
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ private slots:
|
|||||||
void buildingDone(bool success);
|
void buildingDone(bool success);
|
||||||
void handleTaskStarted(const QString &desciption, int max);
|
void handleTaskStarted(const QString &desciption, int max);
|
||||||
void handleProgress(int value);
|
void handleProgress(int value);
|
||||||
void handleWarningReport(const qbs::Error &error);
|
|
||||||
void handleCommandDescriptionReport(const QString &highlight, const QString &message);
|
void handleCommandDescriptionReport(const QString &highlight, const QString &message);
|
||||||
void handleProcessResultReport(const qbs::ProcessResult &result);
|
void handleProcessResultReport(const qbs::ProcessResult &result);
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,9 @@
|
|||||||
#include <qbs.h>
|
#include <qbs.h>
|
||||||
|
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/taskhub.h>
|
||||||
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
@@ -46,6 +49,9 @@ namespace Internal {
|
|||||||
|
|
||||||
QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent)
|
QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
|
ProjectExplorer::TaskHub *hub = ProjectExplorer::ProjectExplorerPlugin::instance()->taskHub();
|
||||||
|
connect(this, SIGNAL(newTask(ProjectExplorer::Task)),
|
||||||
|
hub, SLOT(addTask(ProjectExplorer::Task)), Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsLogSink::sendMessages()
|
void QbsLogSink::sendMessages()
|
||||||
@@ -62,6 +68,16 @@ void QbsLogSink::sendMessages()
|
|||||||
mm->printToOutputPane(msg, Core::MessageManager::NoModeSwitch);
|
mm->printToOutputPane(msg, Core::MessageManager::NoModeSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QbsLogSink::doPrintWarning(const qbs::Error &warning)
|
||||||
|
{
|
||||||
|
foreach (const qbs::ErrorData &data, warning.entries())
|
||||||
|
emit newTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning,
|
||||||
|
data.description(),
|
||||||
|
Utils::FileName::fromString(data.codeLocation().fileName()),
|
||||||
|
data.codeLocation().line(),
|
||||||
|
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||||
|
}
|
||||||
|
|
||||||
void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag)
|
void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag)
|
||||||
{
|
{
|
||||||
Q_UNUSED(tag);
|
Q_UNUSED(tag);
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
#ifndef QBSLOGSINK_H
|
#ifndef QBSLOGSINK_H
|
||||||
#define QBSLOGSINK_H
|
#define QBSLOGSINK_H
|
||||||
|
|
||||||
|
#include <projectexplorer/task.h>
|
||||||
|
|
||||||
#include <qbs.h>
|
#include <qbs.h>
|
||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
@@ -45,10 +47,14 @@ class QbsLogSink : public QObject, public qbs::ILogSink
|
|||||||
public:
|
public:
|
||||||
QbsLogSink(QObject *parent = 0);
|
QbsLogSink(QObject *parent = 0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void newTask(const ProjectExplorer::Task &task);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void sendMessages();
|
void sendMessages();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void doPrintWarning(const qbs::Error &warning);
|
||||||
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);
|
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);
|
||||||
|
|
||||||
QStringList m_messages;
|
QStringList m_messages;
|
||||||
|
|||||||
@@ -86,6 +86,21 @@ QWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget {
|
||||||
|
layout: HorizontalLayout {
|
||||||
|
Label {
|
||||||
|
text: qsTr("Enabled")
|
||||||
|
toolTip: qsTr("Determines whether the button is enabled or not.")
|
||||||
|
}
|
||||||
|
CheckBox {
|
||||||
|
text: backendValues.enabled.value
|
||||||
|
backendValue: backendValues.enabled
|
||||||
|
baseStateFlag: isBaseState
|
||||||
|
checkable: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QWidget {
|
QWidget {
|
||||||
layout: HorizontalLayout {
|
layout: HorizontalLayout {
|
||||||
Label {
|
Label {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ GroupBox {
|
|||||||
LineEdit {
|
LineEdit {
|
||||||
backendValue: backendValues.text
|
backendValue: backendValues.text
|
||||||
baseStateFlag: isBaseState
|
baseStateFlag: isBaseState
|
||||||
|
translation: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ GroupBox {
|
|||||||
LineEdit {
|
LineEdit {
|
||||||
backendValue: backendValues.text
|
backendValue: backendValues.text
|
||||||
baseStateFlag: isBaseState
|
baseStateFlag: isBaseState
|
||||||
|
translation: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ public:
|
|||||||
bool instanceHasBinding(const PropertyName &name) const;
|
bool instanceHasBinding(const PropertyName &name) const;
|
||||||
bool propertyAffectedByCurrentState(const PropertyName &name) const;
|
bool propertyAffectedByCurrentState(const PropertyName &name) const;
|
||||||
QVariant modelValue(const PropertyName &name) const;
|
QVariant modelValue(const PropertyName &name) const;
|
||||||
|
bool isTranslatableText(const PropertyName &name) const;
|
||||||
|
QString stripedTranslatableText(const PropertyName &name) const;
|
||||||
QString expression(const PropertyName &name) const;
|
QString expression(const PropertyName &name) const;
|
||||||
bool isInBaseState() const;
|
bool isInBaseState() const;
|
||||||
QmlPropertyChanges propertyChangeForCurrentState() const;
|
QmlPropertyChanges propertyChangeForCurrentState() const;
|
||||||
@@ -98,6 +100,8 @@ public:
|
|||||||
|
|
||||||
static QVariant instanceValue(const ModelNode &modelNode, const PropertyName &name);
|
static QVariant instanceValue(const ModelNode &modelNode, const PropertyName &name);
|
||||||
|
|
||||||
|
static QString generateTranslatableText(const QString& text);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
NodeInstance nodeInstance() const;
|
NodeInstance nodeInstance() const;
|
||||||
QmlObjectNode nodeForInstance(const NodeInstance &instance) const;
|
QmlObjectNode nodeForInstance(const NodeInstance &instance) const;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
class RewritingException: public Exception
|
class QMLDESIGNERCORE_EXPORT RewritingException: public Exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RewritingException(int line,
|
RewritingException(int line,
|
||||||
|
|||||||
@@ -156,11 +156,15 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
if (!envImportPath.isEmpty())
|
if (!envImportPath.isEmpty())
|
||||||
applicationPath = envImportPath;
|
applicationPath = envImportPath;
|
||||||
|
|
||||||
QProcessEnvironment enviroment = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) && (defined(Q_OS_MAC) || defined(Q_OS_LINUX))
|
||||||
|
environment.insert(QLatin1String("DESIGNER_DONT_USE_SHARED_MEMORY"), QLatin1String("1"));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (QFileInfo(applicationPath).exists()) {
|
if (QFileInfo(applicationPath).exists()) {
|
||||||
m_qmlPuppetEditorProcess = new QProcess;
|
m_qmlPuppetEditorProcess = new QProcess;
|
||||||
m_qmlPuppetEditorProcess->setProcessEnvironment(enviroment);
|
m_qmlPuppetEditorProcess->setProcessEnvironment(environment);
|
||||||
m_qmlPuppetEditorProcess->setObjectName("EditorProcess");
|
m_qmlPuppetEditorProcess->setObjectName("EditorProcess");
|
||||||
connect(m_qmlPuppetEditorProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
|
connect(m_qmlPuppetEditorProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
|
||||||
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetEditorProcess.data(), SLOT(kill()));
|
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetEditorProcess.data(), SLOT(kill()));
|
||||||
@@ -171,7 +175,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
|
|
||||||
if (runModus == NormalModus) {
|
if (runModus == NormalModus) {
|
||||||
m_qmlPuppetPreviewProcess = new QProcess;
|
m_qmlPuppetPreviewProcess = new QProcess;
|
||||||
m_qmlPuppetPreviewProcess->setProcessEnvironment(enviroment);
|
m_qmlPuppetPreviewProcess->setProcessEnvironment(environment);
|
||||||
m_qmlPuppetPreviewProcess->setObjectName("PreviewProcess");
|
m_qmlPuppetPreviewProcess->setObjectName("PreviewProcess");
|
||||||
connect(m_qmlPuppetPreviewProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
|
connect(m_qmlPuppetPreviewProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
|
||||||
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetPreviewProcess.data(), SLOT(kill()));
|
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetPreviewProcess.data(), SLOT(kill()));
|
||||||
@@ -180,7 +184,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
m_qmlPuppetPreviewProcess->start(applicationPath, QStringList() << socketToken << "previewmode" << "-graphicssystem raster");
|
m_qmlPuppetPreviewProcess->start(applicationPath, QStringList() << socketToken << "previewmode" << "-graphicssystem raster");
|
||||||
|
|
||||||
m_qmlPuppetRenderProcess = new QProcess;
|
m_qmlPuppetRenderProcess = new QProcess;
|
||||||
m_qmlPuppetRenderProcess->setProcessEnvironment(enviroment);
|
m_qmlPuppetRenderProcess->setProcessEnvironment(environment);
|
||||||
m_qmlPuppetRenderProcess->setObjectName("RenderProcess");
|
m_qmlPuppetRenderProcess->setObjectName("RenderProcess");
|
||||||
connect(m_qmlPuppetRenderProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
|
connect(m_qmlPuppetRenderProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
|
||||||
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetRenderProcess.data(), SLOT(kill()));
|
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetRenderProcess.data(), SLOT(kill()));
|
||||||
|
|||||||
@@ -175,6 +175,34 @@ QVariant QmlObjectNode::modelValue(const PropertyName &name) const
|
|||||||
return propertyChanges.modelNode().variantProperty(name).value();
|
return propertyChanges.modelNode().variantProperty(name).value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QmlObjectNode::isTranslatableText(const PropertyName &name) const
|
||||||
|
{
|
||||||
|
if (modelNode().metaInfo().isValid() && modelNode().metaInfo().hasProperty(name))
|
||||||
|
if (modelNode().metaInfo().propertyTypeName(name) == "QString" || modelNode().metaInfo().propertyTypeName(name) == "string") {
|
||||||
|
if (modelNode().hasBindingProperty(name)) {
|
||||||
|
static QRegExp regularExpressionPatter("qsTr\\((\".*\")\\)");
|
||||||
|
return regularExpressionPatter.exactMatch(modelNode().bindingProperty(name).expression());
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QmlObjectNode::stripedTranslatableText(const PropertyName &name) const
|
||||||
|
{
|
||||||
|
if (modelNode().hasBindingProperty(name)) {
|
||||||
|
static QRegExp regularExpressionPatter("qsTr\\(\"(.*)\"\\)");
|
||||||
|
if (regularExpressionPatter.exactMatch(modelNode().bindingProperty(name).expression()))
|
||||||
|
return regularExpressionPatter.cap(1);
|
||||||
|
} else {
|
||||||
|
return modelNode().variantProperty(name).value().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
QString QmlObjectNode::expression(const PropertyName &name) const
|
QString QmlObjectNode::expression(const PropertyName &name) const
|
||||||
{
|
{
|
||||||
if (!isValid())
|
if (!isValid())
|
||||||
@@ -387,6 +415,11 @@ QVariant QmlObjectNode::instanceValue(const ModelNode &modelNode, const Property
|
|||||||
return modelView->instanceForModelNode(modelNode).property(name);
|
return modelView->instanceForModelNode(modelNode).property(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QmlObjectNode::generateTranslatableText(const QString &text)
|
||||||
|
{
|
||||||
|
return QString("qsTr(\"%1\")").arg(text);
|
||||||
|
}
|
||||||
|
|
||||||
TypeName QmlObjectNode::instanceType(const PropertyName &name) const
|
TypeName QmlObjectNode::instanceType(const PropertyName &name) const
|
||||||
{
|
{
|
||||||
return nodeInstance().instanceType(name);
|
return nodeInstance().instanceType(name);
|
||||||
|
|||||||
@@ -196,12 +196,10 @@ void QmlJSCodeStyleSettingsPage::apply()
|
|||||||
TextEditor::SimpleCodeStylePreferences *originalTabPreferences = QmlJSToolsSettings::globalCodeStyle();
|
TextEditor::SimpleCodeStylePreferences *originalTabPreferences = QmlJSToolsSettings::globalCodeStyle();
|
||||||
if (originalTabPreferences->tabSettings() != m_pageTabPreferences->tabSettings()) {
|
if (originalTabPreferences->tabSettings() != m_pageTabPreferences->tabSettings()) {
|
||||||
originalTabPreferences->setTabSettings(m_pageTabPreferences->tabSettings());
|
originalTabPreferences->setTabSettings(m_pageTabPreferences->tabSettings());
|
||||||
if (s)
|
|
||||||
originalTabPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s);
|
originalTabPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s);
|
||||||
}
|
}
|
||||||
if (originalTabPreferences->currentDelegate() != m_pageTabPreferences->currentDelegate()) {
|
if (originalTabPreferences->currentDelegate() != m_pageTabPreferences->currentDelegate()) {
|
||||||
originalTabPreferences->setCurrentDelegate(m_pageTabPreferences->currentDelegate());
|
originalTabPreferences->setCurrentDelegate(m_pageTabPreferences->currentDelegate());
|
||||||
if (s)
|
|
||||||
originalTabPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s);
|
originalTabPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -925,6 +925,7 @@ void ModelManager::updateCppQmlTypes(QFutureInterface<void> &interface,
|
|||||||
|
|
||||||
FindExportedCppTypes finder(snapshot);
|
FindExportedCppTypes finder(snapshot);
|
||||||
|
|
||||||
|
bool hasNewInfo = false;
|
||||||
typedef QPair<CPlusPlus::Document::Ptr, bool> DocScanPair;
|
typedef QPair<CPlusPlus::Document::Ptr, bool> DocScanPair;
|
||||||
foreach (const DocScanPair &pair, documents) {
|
foreach (const DocScanPair &pair, documents) {
|
||||||
if (interface.isCanceled())
|
if (interface.isCanceled())
|
||||||
@@ -934,7 +935,7 @@ void ModelManager::updateCppQmlTypes(QFutureInterface<void> &interface,
|
|||||||
const bool scan = pair.second;
|
const bool scan = pair.second;
|
||||||
const QString fileName = doc->fileName();
|
const QString fileName = doc->fileName();
|
||||||
if (!scan) {
|
if (!scan) {
|
||||||
newData.remove(fileName);
|
hasNewInfo = hasNewInfo || newData.remove(fileName) > 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -943,9 +944,11 @@ void ModelManager::updateCppQmlTypes(QFutureInterface<void> &interface,
|
|||||||
QList<LanguageUtils::FakeMetaObject::ConstPtr> exported = finder.exportedTypes();
|
QList<LanguageUtils::FakeMetaObject::ConstPtr> exported = finder.exportedTypes();
|
||||||
QHash<QString, QString> contextProperties = finder.contextProperties();
|
QHash<QString, QString> contextProperties = finder.contextProperties();
|
||||||
if (exported.isEmpty() && contextProperties.isEmpty()) {
|
if (exported.isEmpty() && contextProperties.isEmpty()) {
|
||||||
newData.remove(fileName);
|
hasNewInfo = hasNewInfo || newData.remove(fileName) > 0;
|
||||||
} else {
|
} else {
|
||||||
CppData &data = newData[fileName];
|
CppData &data = newData[fileName];
|
||||||
|
// currently we have no simple way to compare, so we assume the worse
|
||||||
|
hasNewInfo = true;
|
||||||
data.exportedTypes = exported;
|
data.exportedTypes = exported;
|
||||||
data.contextProperties = contextProperties;
|
data.contextProperties = contextProperties;
|
||||||
}
|
}
|
||||||
@@ -955,6 +958,9 @@ void ModelManager::updateCppQmlTypes(QFutureInterface<void> &interface,
|
|||||||
|
|
||||||
QMutexLocker locker(&qmlModelManager->m_cppDataMutex);
|
QMutexLocker locker(&qmlModelManager->m_cppDataMutex);
|
||||||
qmlModelManager->m_cppDataHash = newData;
|
qmlModelManager->m_cppDataHash = newData;
|
||||||
|
if (hasNewInfo)
|
||||||
|
// one could get away with re-linking the cpp types...
|
||||||
|
QMetaObject::invokeMethod(qmlModelManager, "resetCodeModel");
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelManager::CppDataHash ModelManager::cppData() const
|
ModelManager::CppDataHash ModelManager::cppData() const
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ bool BlackBerryConfiguration::refresh()
|
|||||||
|
|
||||||
void BlackBerryConfiguration::loadCertificates()
|
void BlackBerryConfiguration::loadCertificates()
|
||||||
{
|
{
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
|
|
||||||
settings->beginGroup(SettingsGroup);
|
settings->beginGroup(SettingsGroup);
|
||||||
settings->beginGroup(CertificateGroup);
|
settings->beginGroup(CertificateGroup);
|
||||||
@@ -158,7 +158,7 @@ void BlackBerryConfiguration::loadCertificates()
|
|||||||
|
|
||||||
void BlackBerryConfiguration::loadNdkSettings()
|
void BlackBerryConfiguration::loadNdkSettings()
|
||||||
{
|
{
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
|
|
||||||
settings->beginGroup(SettingsGroup);
|
settings->beginGroup(SettingsGroup);
|
||||||
setNdkPath(settings->value(NDKLocationKey).toString());
|
setNdkPath(settings->value(NDKLocationKey).toString());
|
||||||
@@ -167,7 +167,7 @@ void BlackBerryConfiguration::loadNdkSettings()
|
|||||||
|
|
||||||
void BlackBerryConfiguration::saveCertificates()
|
void BlackBerryConfiguration::saveCertificates()
|
||||||
{
|
{
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
|
|
||||||
settings->beginGroup(SettingsGroup);
|
settings->beginGroup(SettingsGroup);
|
||||||
settings->beginGroup(CertificateGroup);
|
settings->beginGroup(CertificateGroup);
|
||||||
@@ -194,7 +194,7 @@ void BlackBerryConfiguration::saveNdkSettings()
|
|||||||
if (m_config.ndkPath.isEmpty())
|
if (m_config.ndkPath.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
settings->beginGroup(SettingsGroup);
|
settings->beginGroup(SettingsGroup);
|
||||||
settings->setValue(NDKLocationKey, m_config.ndkPath);
|
settings->setValue(NDKLocationKey, m_config.ndkPath);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
@@ -396,7 +396,7 @@ void BlackBerryConfiguration::saveSettings()
|
|||||||
|
|
||||||
void BlackBerryConfiguration::clearNdkSettings()
|
void BlackBerryConfiguration::clearNdkSettings()
|
||||||
{
|
{
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
settings->beginGroup(SettingsGroup);
|
settings->beginGroup(SettingsGroup);
|
||||||
settings->remove(NDKLocationKey);
|
settings->remove(NDKLocationKey);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|||||||
@@ -572,6 +572,7 @@ void SubversionPlugin::svnDiff(const Subversion::Internal::SubversionDiffParamet
|
|||||||
QFileInfo(p.files.front()).fileName() : p.diffName;
|
QFileInfo(p.files.front()).fileName() : p.diffName;
|
||||||
|
|
||||||
QStringList args(QLatin1String("diff"));
|
QStringList args(QLatin1String("diff"));
|
||||||
|
args.append(QLatin1String("--internal-diff"));
|
||||||
args.append(p.arguments);
|
args.append(p.arguments);
|
||||||
args << p.files;
|
args << p.files;
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ QtcPlugin {
|
|||||||
"ifunctionhintproposalmodel.h",
|
"ifunctionhintproposalmodel.h",
|
||||||
"igenericproposalmodel.cpp",
|
"igenericproposalmodel.cpp",
|
||||||
"igenericproposalmodel.h",
|
"igenericproposalmodel.h",
|
||||||
"ikeywords.h",
|
|
||||||
"keywordscompletionassist.cpp",
|
"keywordscompletionassist.cpp",
|
||||||
"keywordscompletionassist.h",
|
"keywordscompletionassist.h",
|
||||||
"quickfixassistprocessor.cpp",
|
"quickfixassistprocessor.cpp",
|
||||||
|
|||||||
Submodule src/shared/qbs updated: 32ae53690c...5df624fa58
@@ -33,14 +33,14 @@ def handleDebuggerWarnings(config, isMsvcBuild=False):
|
|||||||
if isMsvcBuild:
|
if isMsvcBuild:
|
||||||
try:
|
try:
|
||||||
popup = waitForObject("{name='msgLabel' text?='<html><head/><body>*' type='QLabel' visible='1' window=':Dialog_Debugger::Internal::SymbolPathsDialog'}", 10000)
|
popup = waitForObject("{name='msgLabel' text?='<html><head/><body>*' type='QLabel' visible='1' window=':Dialog_Debugger::Internal::SymbolPathsDialog'}", 10000)
|
||||||
symServerNotConfiged = ("<html><head/><body>\n<p>The debugger is not configured to use the public "
|
symServerNotConfiged = ("<html><head/><body><p>The debugger is not configured to use the public "
|
||||||
"Microsoft Symbol Server.<br>"
|
"Microsoft Symbol Server.<br/>"
|
||||||
"This is recommended for retrieval of the symbols of the operating system libraries.</p>\n"
|
"This is recommended for retrieval of the symbols of the operating system libraries.</p>"
|
||||||
"<p><span style=\" font-style:italic;\">Note:</span> It is recommended, that if you use the Microsoft Symbol Server, "
|
"<p><span style=\" font-style:italic;\">Note:</span> It is recommended, that if you use the Microsoft Symbol Server, "
|
||||||
"to also use a local symbol cache.<br>"
|
"to also use a local symbol cache.<br/>"
|
||||||
"Also, a fast internet connection is required for this to work smoothly,<br>"
|
"A fast internet connection is required for this to work smoothly,<br/>"
|
||||||
"and a delay might occur when connecting for the first time, when caching the symbols for the first time.</p>\n"
|
"and a delay might occur when connecting for the first time and caching the symbols.</p>"
|
||||||
"<p>Would you like to set it up?</p>\n</body></html>")
|
"<p>What would you like to set up?</p></body></html>")
|
||||||
if popup.text == symServerNotConfiged:
|
if popup.text == symServerNotConfiged:
|
||||||
test.log("Creator warned about the debugger not being configured to use the public Microsoft Symbol Server.")
|
test.log("Creator warned about the debugger not being configured to use the public Microsoft Symbol Server.")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -50,9 +50,15 @@ def changeFilePermissions(dirPath, readPerm, writePerm, excludeFileNames=None):
|
|||||||
return False
|
return False
|
||||||
filePaths = [os.path.join(dirPath, fileName) for fileName in os.listdir(dirPath)
|
filePaths = [os.path.join(dirPath, fileName) for fileName in os.listdir(dirPath)
|
||||||
if fileName not in excludeFileNames]
|
if fileName not in excludeFileNames]
|
||||||
|
result = True
|
||||||
for filePath in filter(os.path.isfile, filePaths):
|
for filePath in filter(os.path.isfile, filePaths):
|
||||||
|
try:
|
||||||
os.chmod(filePath, permission)
|
os.chmod(filePath, permission)
|
||||||
return True
|
except:
|
||||||
|
t,v = sys.exc_info()[:2]
|
||||||
|
test.log("Error: %s(%s)" % (str(t), str(v)))
|
||||||
|
result = False
|
||||||
|
return result
|
||||||
|
|
||||||
def isWritable(pathToFile):
|
def isWritable(pathToFile):
|
||||||
if os.path.exists(pathToFile):
|
if os.path.exists(pathToFile):
|
||||||
|
|||||||
@@ -647,3 +647,6 @@ def readFile(filename):
|
|||||||
content = f.read()
|
content = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
def simpleFileName(navigatorFileName):
|
||||||
|
return ".".join(navigatorFileName.split(".")[-2:]).replace("\\","")
|
||||||
|
|||||||
@@ -149,9 +149,6 @@ def checkUnsavedChangesContains(model, filePaths):
|
|||||||
test.compare(set(foundItems), set(filePaths),
|
test.compare(set(foundItems), set(filePaths),
|
||||||
"Verifying whether modified (unsaved) files do match expected.")
|
"Verifying whether modified (unsaved) files do match expected.")
|
||||||
|
|
||||||
def simpleFileName(navigatorFileName):
|
|
||||||
return ".".join(navigatorFileName.split(".")[-2:]).replace("\\","")
|
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
global testFolder
|
global testFolder
|
||||||
if testFolder:
|
if testFolder:
|
||||||
|
|||||||
@@ -166,6 +166,3 @@ def revertChanges(files):
|
|||||||
"Maybe it has not been changed at all.")
|
"Maybe it has not been changed at all.")
|
||||||
else:
|
else:
|
||||||
test.fail("Could not open %s for reverting changes" % simpleName)
|
test.fail("Could not open %s for reverting changes" % simpleName)
|
||||||
|
|
||||||
def simpleFileName(navigatorFileName):
|
|
||||||
return ".".join(navigatorFileName.split(".")[-2:]).replace("\\","")
|
|
||||||
|
|||||||
@@ -140,6 +140,3 @@ def compareFileToOriginal(fileName):
|
|||||||
origFile.close()
|
origFile.close()
|
||||||
test.compare(originalContent, currentContent,
|
test.compare(originalContent, currentContent,
|
||||||
"Comparing original to reverted file content for '%s'" % fileName)
|
"Comparing original to reverted file content for '%s'" % fileName)
|
||||||
|
|
||||||
def simpleFileName(navigatorFileName):
|
|
||||||
return ".".join(navigatorFileName.split(".")[-2:]).replace("\\","")
|
|
||||||
|
|||||||
@@ -147,6 +147,3 @@ def verifyOutline(outlinePseudoTree, datasetFileName):
|
|||||||
return
|
return
|
||||||
test.passes("All nodes (%d) inside outline match expected nodes for '%s'."
|
test.passes("All nodes (%d) inside outline match expected nodes for '%s'."
|
||||||
% (len(expected), fileName))
|
% (len(expected), fileName))
|
||||||
|
|
||||||
def simpleFileName(navigatorFileName):
|
|
||||||
return ".".join(navigatorFileName.split(".")[-2:]).replace("\\", "")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user