qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/0000755000015301777760000000000012321547742022123 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/private_headers.pri0000644000015301777760000000055712321547255026012 0ustar pbusernogroup00000000000000# Try to find location of Qt private headers (see README) isEmpty(QT_PRIVATE_HEADERS) { QT_PRIVATE_HEADERS = $$[QT_INSTALL_HEADERS] } else { INCLUDEPATH += \ $${QT_PRIVATE_HEADERS} \ $${QT_PRIVATE_HEADERS}/QtCore \ $${QT_PRIVATE_HEADERS}/QtGui \ $${QT_PRIVATE_HEADERS}/QtScript \ $${QT_PRIVATE_HEADERS}/QtDeclarative } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/qtcreator-plugin-remotelinux.pro0000644000015301777760000000013512321547255030514 0ustar pbusernogroup00000000000000TEMPLATE = subdirs SUBDIRS = src/remotelinux \ src/valgrind \ src/qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/LICENSE.LGPL0000644000015301777760000006350212321547255023672 0ustar pbusernogroup00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/qtcreatorplugin.pri0000644000015301777760000000172512321547255026066 0ustar pbusernogroup00000000000000## Where the Qt Creator headers are located at QTCREATOR_SOURCES = $$(QTC_SOURCE) isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=/usr/src/qtcreator ## Where our plugin will be compiled to IDE_BUILD_TREE = $$(QTC_BUILD) isEmpty(IDE_BUILD_TREE):IDE_BUILD_TREE=../../builddir UBUNTU_LOCAL_BUILD = $$(UBUNTU_QTC_PLUGIN_LOCALBUILD) !isEmpty(UBUNTU_LOCAL_BUILD) { message("!!!!!!!!!!BUILDING LOCAL VERSION OF PLUGIN !!!!!!!!!!!!!!!!!!!") USE_USER_DESTDIR = yes PATHSTR = '\\"$${PWD}/../share/qtcreator\\"' DEFINES += UBUNTU_RESOURCE_PATH_LOCAL=\"$${PATHSTR}\" UBUNTU_BUILD_LOCAL } include($$QTCREATOR_SOURCES/src/qtcreatorplugin.pri) INCLUDEPATH += $$QTCREATOR_SOURCES/src/ ## make sure the QtProject libs are available when building locally !isEmpty(UBUNTU_LOCAL_BUILD) { LIBS += -L$$DESTDIRBASE/QtProject/$$DESTDIRAPPNAME/plugins/$$QTCREATOR_VERSION/QtProject } LIBS += -L$$[QT_INSTALL_LIBS]/qtcreator LIBS += -L$$[QT_INSTALL_LIBS]/qtcreator/plugins/QtProject qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/LGPL_EXCEPTION.txt0000644000015301777760000000224312321547255025040 0ustar pbusernogroup00000000000000Digia Qt LGPL Exception version 1.1 As an additional permission to the GNU Lesser General Public License version 2.1, the object code form of a "work that uses the Library" may incorporate material from a header file that is part of the Library. You may distribute such object code under terms of your choice, provided that: (i) the header files of the Library have not been modified; and (ii) the incorporated material is limited to numerical parameters, data structure layouts, accessors, macros, inline functions and templates; and (iii) you comply with the terms of Section 6 of the GNU Lesser General Public License version 2.1. Moreover, you may apply this exception to a modified version of the Library, provided that such modification does not involve copying material from the Library into the modified Library's header files unless such material is limited to (i) numerical parameters; (ii) data structure layouts; (iii) accessors; and (iv) small macros, templates and inline functions of five lines or less in length. Furthermore, you are not required to apply this additional permission to a modified version of the Library. qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/0000755000015301777760000000000012321547742022712 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/0000755000015301777760000000000012321547742024520 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindrunner.cpp0000644000015301777760000001614312321547255030270 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindrunner.h" #include "valgrindprocess.h" #include #include #include #include #include #include namespace Valgrind { class ValgrindRunner::Private { public: explicit Private(ValgrindRunner *qq) : q(qq), process(0), channelMode(QProcess::SeparateChannels), finished(false), startMode(Analyzer::StartLocal) { } void run(ValgrindProcess *process); ValgrindRunner *q; ValgrindProcess *process; Utils::Environment environment; QProcess::ProcessChannelMode channelMode; bool finished; QString valgrindExecutable; QStringList valgrindArguments; QString debuggeeExecutable; QString debuggeeArguments; QString workingdir; Analyzer::StartMode startMode; QSsh::SshConnectionParameters connParams; }; void ValgrindRunner::Private::run(ValgrindProcess *_process) { if (process && process->isRunning()) { process->close(); process->disconnect(q); process->deleteLater(); } QTC_ASSERT(_process, return); process = _process; if (environment.size() > 0) process->setEnvironment(environment); process->setWorkingDirectory(workingdir); process->setProcessChannelMode(channelMode); // consider appending our options last so they override any interfering user-supplied options // -q as suggested by valgrind manual QStringList valgrindArgs = valgrindArguments; valgrindArgs << QString::fromLatin1("--tool=%1").arg(q->tool()); if (Utils::HostOsInfo::isMacHost()) // May be slower to start but without it we get no filenames for symbols. valgrindArgs << QLatin1String("--dsymutil=yes"); QObject::connect(process, SIGNAL(processOutput(QByteArray,Utils::OutputFormat)), q, SIGNAL(processOutputReceived(QByteArray,Utils::OutputFormat))); QObject::connect(process, SIGNAL(started()), q, SLOT(processStarted())); QObject::connect(process, SIGNAL(finished(int,QProcess::ExitStatus)), q, SLOT(processFinished(int,QProcess::ExitStatus))); QObject::connect(process, SIGNAL(error(QProcess::ProcessError)), q, SLOT(processError(QProcess::ProcessError))); process->run(valgrindExecutable, valgrindArgs, debuggeeExecutable, debuggeeArguments); } ValgrindRunner::ValgrindRunner(QObject *parent) : QObject(parent), d(new Private(this)) { } ValgrindRunner::~ValgrindRunner() { if (d->process && d->process->isRunning()) { // make sure we don't delete the thread while it's still running waitForFinished(); } delete d; d = 0; } void ValgrindRunner::setValgrindExecutable(const QString &executable) { d->valgrindExecutable = executable; } QString ValgrindRunner::valgrindExecutable() const { return d->valgrindExecutable; } void ValgrindRunner::setValgrindArguments(const QStringList &toolArguments) { d->valgrindArguments = toolArguments; } QStringList ValgrindRunner::valgrindArguments() const { return d->valgrindArguments; } QString ValgrindRunner::debuggeeExecutable() const { return d->debuggeeExecutable; } void ValgrindRunner::setDebuggeeExecutable(const QString &executable) { d->debuggeeExecutable = executable; } QString ValgrindRunner::debuggeeArguments() const { return d->debuggeeArguments; } void ValgrindRunner::setDebuggeeArguments(const QString &arguments) { d->debuggeeArguments = arguments; } Analyzer::StartMode ValgrindRunner::startMode() const { return d->startMode; } void ValgrindRunner::setStartMode(Analyzer::StartMode startMode) { d->startMode = startMode; } const QSsh::SshConnectionParameters &ValgrindRunner::connectionParameters() const { return d->connParams; } void ValgrindRunner::setConnectionParameters(const QSsh::SshConnectionParameters &connParams) { d->connParams = connParams; } void ValgrindRunner::setWorkingDirectory(const QString &path) { d->workingdir = path; } QString ValgrindRunner::workingDirectory() const { return d->workingdir; } void ValgrindRunner::setEnvironment(const Utils::Environment &environment) { d->environment = environment; } void ValgrindRunner::setProcessChannelMode(QProcess::ProcessChannelMode mode) { d->channelMode = mode; } void ValgrindRunner::waitForFinished() const { if (d->finished || !d->process) return; QEventLoop loop; connect(this, SIGNAL(finished()), &loop, SLOT(quit())); loop.exec(); } bool ValgrindRunner::start() { d->run(new ValgrindProcess(d->startMode == Analyzer::StartLocal, d->connParams, 0, this)); return true; } void ValgrindRunner::processError(QProcess::ProcessError e) { if (d->finished) return; d->finished = true; // make sure we don't wait for the connection anymore emit processErrorReceived(errorString(), e); emit finished(); } void ValgrindRunner::processFinished(int ret, QProcess::ExitStatus status) { if (d->finished) return; d->finished = true; // make sure we don't wait for the connection anymore emit finished(); if (ret != 0 || status == QProcess::CrashExit) emit processErrorReceived(errorString(), d->process->error()); } void ValgrindRunner::processStarted() { emit started(); } QString ValgrindRunner::errorString() const { if (d->process) return d->process->errorString(); else return QString(); } void ValgrindRunner::stop() { if (d->process) d->process->close(); } ValgrindProcess *ValgrindRunner::valgrindProcess() const { return d->process; } } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindsettings.cpp0000644000015301777760000004516212321547255030622 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindsettings.h" #include "valgrindplugin.h" #include "valgrindconfigwidget.h" #include #include #include #include #include using namespace Analyzer; const char numCallersC[] = "Analyzer.Valgrind.NumCallers"; const char leakCheckOnFinishC[] = "Analyzer.Valgrind.LeakCheckOnFinish"; const char showReachableC[] = "Analyzer.Valgrind.ShowReachable"; const char trackOriginsC[] = "Analyzer.Valgrind.TrackOrigins"; const char selfModifyingCodeDetectionC[] = "Analyzer.Valgrind.SelfModifyingCodeDetection"; const char suppressionFilesC[] = "Analyzer.Valgrind.SupressionFiles"; const char removedSuppressionFilesC[] = "Analyzer.Valgrind.RemovedSuppressionFiles"; const char addedSuppressionFilesC[] = "Analyzer.Valgrind.AddedSuppressionFiles"; const char filterExternalIssuesC[] = "Analyzer.Valgrind.FilterExternalIssues"; const char visibleErrorKindsC[] = "Analyzer.Valgrind.VisibleErrorKinds"; const char lastSuppressionDirectoryC[] = "Analyzer.Valgrind.LastSuppressionDirectory"; const char lastSuppressionHistoryC[] = "Analyzer.Valgrind.LastSuppressionHistory"; const char callgrindEnableCacheSimC[] = "Analyzer.Valgrind.Callgrind.EnableCacheSim"; const char callgrindEnableBranchSimC[] = "Analyzer.Valgrind.Callgrind.EnableBranchSim"; const char callgrindCollectSystimeC[] = "Analyzer.Valgrind.Callgrind.CollectSystime"; const char callgrindCollectBusEventsC[] = "Analyzer.Valgrind.Callgrind.CollectBusEvents"; const char callgrindEnableEventToolTipsC[] = "Analyzer.Valgrind.Callgrind.EnableEventToolTips"; const char callgrindMinimumCostRatioC[] = "Analyzer.Valgrind.Callgrind.MinimumCostRatio"; const char callgrindVisualisationMinimumCostRatioC[] = "Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio"; const char callgrindCycleDetectionC[] = "Analyzer.Valgrind.Callgrind.CycleDetection"; const char callgrindShortenTemplates[] = "Analyzer.Valgrind.Callgrind.ShortenTemplates"; const char callgrindCostFormatC[] = "Analyzer.Valgrind.Callgrind.CostFormat"; const char valgrindExeC[] = "Analyzer.Valgrind.ValgrindExecutable"; namespace Valgrind { namespace Internal { ////////////////////////////////////////////////////////////////// // // ValgrindBaseSettings // ////////////////////////////////////////////////////////////////// /** * Utility function to set @p val if @p key is present in @p map. */ template void setIfPresent(const QVariantMap &map, const QString &key, T *val) { if (map.contains(key)) *val = map.value(key).template value(); } void ValgrindBaseSettings::fromMap(const QVariantMap &map) { // General setIfPresent(map, QLatin1String(valgrindExeC), &m_valgrindExecutable); setIfPresent(map, QLatin1String(selfModifyingCodeDetectionC), (int*) &m_selfModifyingCodeDetection); // Memcheck setIfPresent(map, QLatin1String(numCallersC), &m_numCallers); setIfPresent(map, QLatin1String(leakCheckOnFinishC), (int*) &m_leakCheckOnFinish); setIfPresent(map, QLatin1String(showReachableC), &m_showReachable); setIfPresent(map, QLatin1String(trackOriginsC), &m_trackOrigins); setIfPresent(map, QLatin1String(filterExternalIssuesC), &m_filterExternalIssues); if (map.contains(QLatin1String(visibleErrorKindsC))) { m_visibleErrorKinds.clear(); foreach (const QVariant &val, map.value(QLatin1String(visibleErrorKindsC)).toList()) m_visibleErrorKinds << val.toInt(); } // Callgrind setIfPresent(map, QLatin1String(callgrindEnableCacheSimC), &m_enableCacheSim); setIfPresent(map, QLatin1String(callgrindEnableBranchSimC), &m_enableBranchSim); setIfPresent(map, QLatin1String(callgrindCollectSystimeC), &m_collectSystime); setIfPresent(map, QLatin1String(callgrindCollectBusEventsC), &m_collectBusEvents); setIfPresent(map, QLatin1String(callgrindEnableEventToolTipsC), &m_enableEventToolTips); setIfPresent(map, QLatin1String(callgrindMinimumCostRatioC), &m_minimumInclusiveCostRatio); setIfPresent(map, QLatin1String(callgrindVisualisationMinimumCostRatioC), &m_visualisationMinimumInclusiveCostRatio); emit changed(); } void ValgrindBaseSettings::toMap(QVariantMap &map) const { // General map.insert(QLatin1String(valgrindExeC), m_valgrindExecutable); map.insert(QLatin1String(selfModifyingCodeDetectionC), m_selfModifyingCodeDetection); // Memcheck map.insert(QLatin1String(numCallersC), m_numCallers); map.insert(QLatin1String(leakCheckOnFinishC), m_leakCheckOnFinish); map.insert(QLatin1String(showReachableC), m_showReachable); map.insert(QLatin1String(trackOriginsC), m_trackOrigins); map.insert(QLatin1String(filterExternalIssuesC), m_filterExternalIssues); QVariantList errorKinds; foreach (int i, m_visibleErrorKinds) errorKinds << i; map.insert(QLatin1String(visibleErrorKindsC), errorKinds); // Callgrind map.insert(QLatin1String(callgrindEnableCacheSimC), m_enableCacheSim); map.insert(QLatin1String(callgrindEnableBranchSimC), m_enableBranchSim); map.insert(QLatin1String(callgrindCollectSystimeC), m_collectSystime); map.insert(QLatin1String(callgrindCollectBusEventsC), m_collectBusEvents); map.insert(QLatin1String(callgrindEnableEventToolTipsC), m_enableEventToolTips); map.insert(QLatin1String(callgrindMinimumCostRatioC), m_minimumInclusiveCostRatio); map.insert(QLatin1String(callgrindVisualisationMinimumCostRatioC), m_visualisationMinimumInclusiveCostRatio); } void ValgrindBaseSettings::setValgrindExecutable(const QString &valgrindExecutable) { if (m_valgrindExecutable != valgrindExecutable) { m_valgrindExecutable = valgrindExecutable; emit valgrindExecutableChanged(valgrindExecutable); } } void ValgrindBaseSettings::setSelfModifyingCodeDetection(int smcDetection) { if (m_selfModifyingCodeDetection != smcDetection) { m_selfModifyingCodeDetection = (SelfModifyingCodeDetection) smcDetection; emit selfModifyingCodeDetectionChanged(smcDetection); } } QString ValgrindBaseSettings::valgrindExecutable() const { return m_valgrindExecutable; } ValgrindBaseSettings::SelfModifyingCodeDetection ValgrindBaseSettings::selfModifyingCodeDetection() const { return m_selfModifyingCodeDetection; } void ValgrindBaseSettings::setNumCallers(int numCallers) { if (m_numCallers != numCallers) { m_numCallers = numCallers; emit numCallersChanged(numCallers); } } void ValgrindBaseSettings::setLeakCheckOnFinish(int leakCheckOnFinish) { if (m_leakCheckOnFinish != leakCheckOnFinish) { m_leakCheckOnFinish = (LeakCheckOnFinish) leakCheckOnFinish; emit leakCheckOnFinishChanged(leakCheckOnFinish); } } void ValgrindBaseSettings::setShowReachable(bool showReachable) { if (m_showReachable != showReachable) { m_showReachable = showReachable; emit showReachableChanged(showReachable); } } void ValgrindBaseSettings::setTrackOrigins(bool trackOrigins) { if (m_trackOrigins != trackOrigins) { m_trackOrigins = trackOrigins; emit trackOriginsChanged(trackOrigins); } } void ValgrindBaseSettings::setFilterExternalIssues(bool filterExternalIssues) { if (m_filterExternalIssues != filterExternalIssues) { m_filterExternalIssues = filterExternalIssues; emit filterExternalIssuesChanged(filterExternalIssues); } } void ValgrindBaseSettings::setVisibleErrorKinds(const QList &visibleErrorKinds) { if (m_visibleErrorKinds != visibleErrorKinds) { m_visibleErrorKinds = visibleErrorKinds; emit visibleErrorKindsChanged(visibleErrorKinds); } } void ValgrindBaseSettings::setEnableCacheSim(bool enable) { if (m_enableCacheSim == enable) return; m_enableCacheSim = enable; emit enableCacheSimChanged(enable); } void ValgrindBaseSettings::setEnableBranchSim(bool enable) { if (m_enableBranchSim == enable) return; m_enableBranchSim = enable; emit enableBranchSimChanged(enable); } void ValgrindBaseSettings::setCollectSystime(bool collect) { if (m_collectSystime == collect) return; m_collectSystime = collect; emit collectSystimeChanged(collect); } void ValgrindBaseSettings::setCollectBusEvents(bool collect) { if (m_collectBusEvents == collect) return; m_collectBusEvents = collect; emit collectBusEventsChanged(collect); } void ValgrindBaseSettings::setEnableEventToolTips(bool enable) { if (m_enableEventToolTips == enable) return; m_enableEventToolTips = enable; emit enableEventToolTipsChanged(enable); } void ValgrindBaseSettings::setMinimumInclusiveCostRatio( double minimumInclusiveCostRatio) { if (m_minimumInclusiveCostRatio == minimumInclusiveCostRatio) return; m_minimumInclusiveCostRatio = qBound(0.0, minimumInclusiveCostRatio, 100.0); emit minimumInclusiveCostRatioChanged(minimumInclusiveCostRatio); } void ValgrindBaseSettings::setVisualisationMinimumInclusiveCostRatio( double minimumInclusiveCostRatio) { if (m_visualisationMinimumInclusiveCostRatio == minimumInclusiveCostRatio) return; m_visualisationMinimumInclusiveCostRatio = qBound(0.0, minimumInclusiveCostRatio, 100.0); emit visualisationMinimumInclusiveCostRatioChanged(minimumInclusiveCostRatio); } ////////////////////////////////////////////////////////////////// // // ValgrindGlobalSettings // ////////////////////////////////////////////////////////////////// ValgrindGlobalSettings::ValgrindGlobalSettings() { readSettings(); } QWidget *ValgrindGlobalSettings::createConfigWidget(QWidget *parent) { return new ValgrindConfigWidget(this, parent, true); } void ValgrindGlobalSettings::fromMap(const QVariantMap &map) { ValgrindBaseSettings::fromMap(map); // Memcheck m_suppressionFiles = map.value(QLatin1String(suppressionFilesC)).toStringList(); m_lastSuppressionDirectory = map.value(QLatin1String(lastSuppressionDirectoryC)).toString(); m_lastSuppressionHistory = map.value(QLatin1String(lastSuppressionHistoryC)).toStringList(); // Callgrind // special code as the default one does not cope with the enum properly if (map.contains(QLatin1String(callgrindCostFormatC))) m_costFormat = static_cast(map.value(QLatin1String(callgrindCostFormatC)).toInt()); setIfPresent(map, QLatin1String(callgrindCycleDetectionC), &m_detectCycles); setIfPresent(map, QLatin1String(callgrindShortenTemplates), &m_shortenTemplates); } void ValgrindGlobalSettings::toMap(QVariantMap &map) const { ValgrindBaseSettings::toMap(map); // Memcheck map.insert(QLatin1String(suppressionFilesC), m_suppressionFiles); map.insert(QLatin1String(lastSuppressionDirectoryC), m_lastSuppressionDirectory); map.insert(QLatin1String(lastSuppressionHistoryC), m_lastSuppressionHistory); // Callgrind map.insert(QLatin1String(callgrindCostFormatC), m_costFormat); map.insert(QLatin1String(callgrindCycleDetectionC), m_detectCycles); map.insert(QLatin1String(callgrindShortenTemplates), m_shortenTemplates); } // // Memcheck // QStringList ValgrindGlobalSettings::suppressionFiles() const { return m_suppressionFiles; } void ValgrindGlobalSettings::addSuppressionFiles(const QStringList &suppressions) { foreach (const QString &s, suppressions) if (!m_suppressionFiles.contains(s)) m_suppressionFiles.append(s); } void ValgrindGlobalSettings::removeSuppressionFiles(const QStringList &suppressions) { foreach (const QString &s, suppressions) m_suppressionFiles.removeAll(s); } QString ValgrindGlobalSettings::lastSuppressionDialogDirectory() const { return m_lastSuppressionDirectory; } void ValgrindGlobalSettings::setLastSuppressionDialogDirectory(const QString &directory) { m_lastSuppressionDirectory = directory; } QStringList ValgrindGlobalSettings::lastSuppressionDialogHistory() const { return m_lastSuppressionHistory; } void ValgrindGlobalSettings::setLastSuppressionDialogHistory(const QStringList &history) { m_lastSuppressionHistory = history; } static const char groupC[] = "Analyzer"; void ValgrindGlobalSettings::readSettings() { QVariantMap defaults; // General defaults.insert(QLatin1String(valgrindExeC), QLatin1String("valgrind")); defaults.insert(QLatin1String(selfModifyingCodeDetectionC), DetectSmcStackOnly); // Memcheck defaults.insert(QLatin1String(numCallersC), 25); defaults.insert(QLatin1String(leakCheckOnFinishC), LeakCheckOnFinishSummaryOnly); defaults.insert(QLatin1String(showReachableC), false); defaults.insert(QLatin1String(trackOriginsC), true); defaults.insert(QLatin1String(filterExternalIssuesC), true); QVariantList defaultErrorKinds; for (int i = 0; i < Valgrind::XmlProtocol::MemcheckErrorKindCount; ++i) defaultErrorKinds << i; defaults.insert(QLatin1String(visibleErrorKindsC), defaultErrorKinds); defaults.insert(QLatin1String(suppressionFilesC), QStringList()); defaults.insert(QLatin1String(lastSuppressionDirectoryC), QString()); defaults.insert(QLatin1String(lastSuppressionHistoryC), QStringList()); // Callgrind defaults.insert(QLatin1String(callgrindEnableCacheSimC), false); defaults.insert(QLatin1String(callgrindEnableBranchSimC), false); defaults.insert(QLatin1String(callgrindCollectSystimeC), false); defaults.insert(QLatin1String(callgrindCollectBusEventsC), false); defaults.insert(QLatin1String(callgrindEnableEventToolTipsC), true); defaults.insert(QLatin1String(callgrindMinimumCostRatioC), 0.01); defaults.insert(QLatin1String(callgrindVisualisationMinimumCostRatioC), 10.0); defaults.insert(QLatin1String(callgrindCostFormatC), CostDelegate::FormatRelative); defaults.insert(QLatin1String(callgrindCycleDetectionC), true); defaults.insert(QLatin1String(callgrindShortenTemplates), true); // Read stored values QSettings *settings = Core::ICore::settings(); settings->beginGroup(QLatin1String(groupC)); QVariantMap map = defaults; for (QVariantMap::ConstIterator it = defaults.constBegin(); it != defaults.constEnd(); ++it) map.insert(it.key(), settings->value(it.key(), it.value())); settings->endGroup(); fromMap(map); } void ValgrindGlobalSettings::writeSettings() const { QSettings *settings = Core::ICore::settings(); settings->beginGroup(QLatin1String(groupC)); QVariantMap map; toMap(map); for (QVariantMap::ConstIterator it = map.begin(); it != map.end(); ++it) settings->setValue(it.key(), it.value()); settings->endGroup(); } // // Callgrind // CostDelegate::CostFormat ValgrindGlobalSettings::costFormat() const { return m_costFormat; } void ValgrindGlobalSettings::setCostFormat(CostDelegate::CostFormat format) { m_costFormat = format; writeSettings(); } bool ValgrindGlobalSettings::detectCycles() const { return m_detectCycles; } void ValgrindGlobalSettings::setDetectCycles(bool on) { m_detectCycles = on; writeSettings(); } bool ValgrindGlobalSettings::shortenTemplates() const { return m_shortenTemplates; } void ValgrindGlobalSettings::setShortenTemplates(bool on) { m_shortenTemplates = on; writeSettings(); } ////////////////////////////////////////////////////////////////// // // ValgrindProjectSettings // ////////////////////////////////////////////////////////////////// QWidget *ValgrindProjectSettings::createConfigWidget(QWidget *parent) { return new ValgrindConfigWidget(this, parent, false); } void ValgrindProjectSettings::fromMap(const QVariantMap &map) { ValgrindBaseSettings::fromMap(map); // Memcheck setIfPresent(map, QLatin1String(addedSuppressionFilesC), &m_addedSuppressionFiles); setIfPresent(map, QLatin1String(removedSuppressionFilesC), &m_disabledGlobalSuppressionFiles); } void ValgrindProjectSettings::toMap(QVariantMap &map) const { ValgrindBaseSettings::toMap(map); // Memcheck map.insert(QLatin1String(addedSuppressionFilesC), m_addedSuppressionFiles); map.insert(QLatin1String(removedSuppressionFilesC), m_disabledGlobalSuppressionFiles); } // // Memcheck // void ValgrindProjectSettings::addSuppressionFiles(const QStringList &suppressions) { QStringList globalSuppressions = ValgrindPlugin::globalSettings()->suppressionFiles(); foreach (const QString &s, suppressions) { if (m_addedSuppressionFiles.contains(s)) continue; m_disabledGlobalSuppressionFiles.removeAll(s); if (!globalSuppressions.contains(s)) m_addedSuppressionFiles.append(s); } } void ValgrindProjectSettings::removeSuppressionFiles(const QStringList &suppressions) { QStringList globalSuppressions = ValgrindPlugin::globalSettings()->suppressionFiles(); foreach (const QString &s, suppressions) { m_addedSuppressionFiles.removeAll(s); if (globalSuppressions.contains(s)) m_disabledGlobalSuppressionFiles.append(s); } } QStringList ValgrindProjectSettings::suppressionFiles() const { QStringList ret = ValgrindPlugin::globalSettings()->suppressionFiles(); foreach (const QString &s, m_disabledGlobalSuppressionFiles) ret.removeAll(s); ret.append(m_addedSuppressionFiles); return ret; } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindengine.h0000644000015301777760000000550712321547255030024 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDENGINE_H #define CALLGRINDENGINE_H #include #include #include namespace Valgrind { namespace Internal { class CallgrindRunControl : public ValgrindRunControl { Q_OBJECT public: CallgrindRunControl(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration); bool startEngine(); Valgrind::Callgrind::ParseData *takeParserData(); bool canPause() const { return true; } public slots: /// controller actions void dump(); void reset(); void pause(); void unpause(); /// marks the callgrind process as paused /// calls pause() and unpause() if there's an active run void setPaused(bool paused); void setToggleCollectFunction(const QString &toggleCollectFunction); protected: virtual QStringList toolArguments() const; virtual QString progressTitle() const; virtual Valgrind::ValgrindRunner *runner(); signals: void parserDataReady(CallgrindRunControl *engine); private slots: void slotFinished(); void slotStarted(); void showStatusMessage(const QString &msg); private: Valgrind::Callgrind::CallgrindRunner m_runner; bool m_markAsPaused; QString m_argumentForToggleCollect; }; } // namespace Internal } // namespace Valgrind #endif // CALLGRINDENGINE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindnamedelegate.h0000644000015301777760000000356212321547255031171 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDNAMEDELEGATE_H #define CALLGRINDNAMEDELEGATE_H #include namespace Valgrind { namespace Internal { class NameDelegate : public QStyledItemDelegate { public: explicit NameDelegate(QObject *parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; }; } // namespace Internal } // namespace Valgrind #endif // CALLGRINDNAMEDELEGATE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindsettings.h0000644000015301777760000002123012321547255030255 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ANALYZER_INTERNAL_VALGRINDSETTINGS_H #define ANALYZER_INTERNAL_VALGRINDSETTINGS_H #include "callgrindcostdelegate.h" #include #include #include #include namespace Valgrind { namespace Internal { const char ANALYZER_VALGRIND_SETTINGS[] = "Analyzer.Valgrind.Settings"; /** * Valgrind settings shared for global and per-project. */ class ValgrindBaseSettings : public ProjectExplorer::ISettingsAspect { Q_OBJECT public: enum SelfModifyingCodeDetection { DetectSmcNo, DetectSmcStackOnly, DetectSmcEverywhere, DetectSmcEverywhereButFile }; enum LeakCheckOnFinish { LeakCheckOnFinishNo, LeakCheckOnFinishSummaryOnly, LeakCheckOnFinishYes }; ValgrindBaseSettings() {} void toMap(QVariantMap &map) const; void fromMap(const QVariantMap &map); signals: void changed(); // sent when multiple values have changed simulatenously (e.g. fromMap) /** * Base valgrind settings */ public: QString valgrindExecutable() const; SelfModifyingCodeDetection selfModifyingCodeDetection() const; public slots: void setValgrindExecutable(const QString &); void setSelfModifyingCodeDetection(int); signals: void valgrindExecutableChanged(const QString &); void selfModifyingCodeDetectionChanged(int); private: QString m_valgrindExecutable; SelfModifyingCodeDetection m_selfModifyingCodeDetection; /** * Base memcheck settings */ public: int numCallers() const { return m_numCallers; } LeakCheckOnFinish leakCheckOnFinish() const { return m_leakCheckOnFinish; } bool showReachable() const { return m_showReachable; } bool trackOrigins() const { return m_trackOrigins; } bool filterExternalIssues() const { return m_filterExternalIssues; } QList visibleErrorKinds() const { return m_visibleErrorKinds; } virtual QStringList suppressionFiles() const = 0; virtual void addSuppressionFiles(const QStringList &) = 0; virtual void removeSuppressionFiles(const QStringList &) = 0; public slots: void setNumCallers(int); void setLeakCheckOnFinish(int); void setShowReachable(bool); void setTrackOrigins(bool); void setFilterExternalIssues(bool); void setVisibleErrorKinds(const QList &); signals: void numCallersChanged(int); void leakCheckOnFinishChanged(int); void showReachableChanged(bool); void trackOriginsChanged(bool); void filterExternalIssuesChanged(bool); void visibleErrorKindsChanged(const QList &); void suppressionFilesRemoved(const QStringList &); void suppressionFilesAdded(const QStringList &); protected: int m_numCallers; LeakCheckOnFinish m_leakCheckOnFinish; bool m_showReachable; bool m_trackOrigins; bool m_filterExternalIssues; QList m_visibleErrorKinds; /** * Base callgrind settings */ public: bool enableCacheSim() const { return m_enableCacheSim; } bool enableBranchSim() const { return m_enableBranchSim; } bool collectSystime() const { return m_collectSystime; } bool collectBusEvents() const { return m_collectBusEvents; } bool enableEventToolTips() const { return m_enableEventToolTips; } /// \return Minimum cost ratio, range [0.0..100.0] double minimumInclusiveCostRatio() const { return m_minimumInclusiveCostRatio; } /// \return Minimum cost ratio, range [0.0..100.0] double visualisationMinimumInclusiveCostRatio() const { return m_visualisationMinimumInclusiveCostRatio; } public slots: void setEnableCacheSim(bool enable); void setEnableBranchSim(bool enable); void setCollectSystime(bool collect); void setCollectBusEvents(bool collect); void setEnableEventToolTips(bool enable); /// \param minimumInclusiveCostRatio Minimum inclusive cost ratio, valid values are [0.0..100.0] void setMinimumInclusiveCostRatio(double minimumInclusiveCostRatio); /// \param minimumInclusiveCostRatio Minimum inclusive cost ratio, valid values are [0.0..100.0] void setVisualisationMinimumInclusiveCostRatio(double minimumInclusiveCostRatio); signals: void enableCacheSimChanged(bool); void enableBranchSimChanged(bool); void collectSystimeChanged(bool); void collectBusEventsChanged(bool); void enableEventToolTipsChanged(bool); void minimumInclusiveCostRatioChanged(double); void visualisationMinimumInclusiveCostRatioChanged(double); private: bool m_enableCacheSim; bool m_collectSystime; bool m_collectBusEvents; bool m_enableBranchSim; bool m_enableEventToolTips; double m_minimumInclusiveCostRatio; double m_visualisationMinimumInclusiveCostRatio; }; /** * Global valgrind settings */ class ValgrindGlobalSettings : public ValgrindBaseSettings { Q_OBJECT public: ValgrindGlobalSettings(); QWidget *createConfigWidget(QWidget *parent); void toMap(QVariantMap &map) const; void fromMap(const QVariantMap &map); ISettingsAspect *create() const { return new ValgrindGlobalSettings; } /* * Global memcheck settings */ public: QStringList suppressionFiles() const; // in the global settings we change the internal list directly void addSuppressionFiles(const QStringList &); void removeSuppressionFiles(const QStringList &); // internal settings which don't require any UI void setLastSuppressionDialogDirectory(const QString &directory); QString lastSuppressionDialogDirectory() const; void setLastSuppressionDialogHistory(const QStringList &history); QStringList lastSuppressionDialogHistory() const; void writeSettings() const; void readSettings(); private: QStringList m_suppressionFiles; QString m_lastSuppressionDirectory; QStringList m_lastSuppressionHistory; /** * Global callgrind settings */ public: CostDelegate::CostFormat costFormat() const; bool detectCycles() const; bool shortenTemplates() const; public slots: void setCostFormat(Valgrind::Internal::CostDelegate::CostFormat format); void setDetectCycles(bool on); void setShortenTemplates(bool on); private: CostDelegate::CostFormat m_costFormat; bool m_detectCycles; bool m_shortenTemplates; }; /** * Per-project valgrind settings. */ class ValgrindProjectSettings : public ValgrindBaseSettings { Q_OBJECT public: ValgrindProjectSettings() {} QWidget *createConfigWidget(QWidget *parent); void toMap(QVariantMap &map) const; void fromMap(const QVariantMap &map); ISettingsAspect *create() const { return new ValgrindProjectSettings; } /** * Per-project memcheck settings, saves a diff to the global suppression files list */ public: QStringList suppressionFiles() const; // in the project-specific settings we store a diff to the global list void addSuppressionFiles(const QStringList &suppressions); void removeSuppressionFiles(const QStringList &suppressions); private: QStringList m_disabledGlobalSuppressionFiles; QStringList m_addedSuppressionFiles; /** * Per-project callgrind settings, saves a diff to the global suppression files list */ }; } // namespace Internal } // namespace Valgrind #endif // VALGRIND_INTERNAL_ANALZYZERSETTINGS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindengine.h0000644000015301777760000000551312321547255027670 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRINDENGINE_H #define VALGRINDENGINE_H #include #include #include #include #include #include namespace Valgrind { namespace Internal { class ValgrindRunControl : public Analyzer::AnalyzerRunControl { Q_OBJECT public: ValgrindRunControl(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration); ~ValgrindRunControl(); bool startEngine(); void stopEngine(); QString executable() const; protected: virtual QString progressTitle() const = 0; virtual QStringList toolArguments() const = 0; virtual Valgrind::ValgrindRunner *runner() = 0; ValgrindBaseSettings *m_settings; QFutureInterface *m_progress; QFutureWatcher *m_progressWatcher; private slots: void handleProgressCanceled(); void handleProgressFinished(); void runnerFinished(); void receiveProcessOutput(const QByteArray &output, Utils::OutputFormat format); void receiveProcessError(const QString &message, QProcess::ProcessError error); private: QStringList genericToolArguments() const; private: bool m_isStopping; }; } // namespace Internal } // namespace Valgrind #endif // VALGRINDENGINE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheckerrorview.h0000644000015301777760000000530012321547255030407 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Andreas Hartmetz, KDAB (andreas.hartmetz@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef MEMCHECKERRORVIEW_H #define MEMCHECKERRORVIEW_H #include namespace Valgrind { namespace Internal { class ValgrindBaseSettings; class MemcheckErrorView : public QListView { Q_OBJECT public: MemcheckErrorView(QWidget *parent = 0); ~MemcheckErrorView(); // Reimplemented to connect delegate to connection model after it has // been set by superclass implementation. void setModel(QAbstractItemModel *model); void setDefaultSuppressionFile(const QString &suppFile); QString defaultSuppressionFile() const; ValgrindBaseSettings *settings() const { return m_settings; } void updateGeometries(); public slots: void settingsChanged(ValgrindBaseSettings *settings); void goNext(); void goBack(); signals: void resized(); private slots: void resizeEvent(QResizeEvent *e); void contextMenuEvent(QContextMenuEvent *e); void suppressError(); void setCurrentRow(int row); private: int rowCount() const; int currentRow() const; QAction *m_copyAction; QAction *m_suppressAction; QString m_defaultSuppFile; ValgrindBaseSettings *m_settings; }; } // namespace Internal } // namespace Valgrind #endif // MEMCHECKERRORVIEW_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/workarounds.cpp0000644000015301777760000000412612321547255027604 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "workarounds.h" #include #include QPalette panelPalette(const QPalette &oldPalette, bool lightColored) { QColor color = Utils::StyleHelper::panelTextColor(lightColored); QPalette pal = oldPalette; pal.setBrush(QPalette::All, QPalette::WindowText, color); pal.setBrush(QPalette::All, QPalette::ButtonText, color); pal.setBrush(QPalette::All, QPalette::Foreground, color); color.setAlpha(100); pal.setBrush(QPalette::Disabled, QPalette::WindowText, color); pal.setBrush(QPalette::Disabled, QPalette::ButtonText, color); pal.setBrush(QPalette::Disabled, QPalette::Foreground, color); return pal; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrind.qbs0000644000015301777760000000660112321547255027037 0ustar pbusernogroup00000000000000import qbs.base 1.0 import QtcPlugin QtcPlugin { name: "Valgrind" Depends { name: "Qt"; submodules: ["widgets", "network"] } Depends { name: "Core" } Depends { name: "AnalyzerBase" } Depends { name: "Debugger" } Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } Depends { name: "RemoteLinux" } Depends { name: "CPlusPlus"} Group { name: "General" files: [ "callgrindcostdelegate.cpp", "callgrindcostdelegate.h", "callgrindcostview.cpp", "callgrindcostview.h", "callgrindengine.cpp", "callgrindengine.h", "callgrindhelper.cpp", "callgrindhelper.h", "callgrindnamedelegate.cpp", "callgrindnamedelegate.h", "callgrindtextmark.cpp", "callgrindtextmark.h", "callgrindtool.cpp", "callgrindtool.h", "callgrindvisualisation.cpp", "callgrindvisualisation.h", "memcheckengine.cpp", "memcheckengine.h", "memcheckerrorview.cpp", "memcheckerrorview.h", "memchecktool.cpp", "memchecktool.h", "suppressiondialog.cpp", "suppressiondialog.h", "valgrindconfigwidget.cpp", "valgrindconfigwidget.h", "valgrindconfigwidget.ui", "valgrindengine.cpp", "valgrindengine.h", "valgrindplugin.cpp", "valgrindplugin.h", "valgrindprocess.cpp", "valgrindprocess.h", "valgrindruncontrolfactory.cpp", "valgrindruncontrolfactory.h", "valgrindrunner.cpp", "valgrindrunner.h", "valgrindsettings.cpp", "valgrindsettings.h", "valgrindtool.cpp", "valgrindtool.h", "workarounds.cpp", "workarounds.h", ] } Group { name: "Callgrind" prefix: "callgrind/" files: [ "callgrindabstractmodel.h", "callgrindcallmodel.cpp", "callgrindcallmodel.h", "callgrindcontroller.cpp", "callgrindcontroller.h", "callgrindcostitem.cpp", "callgrindcostitem.h", "callgrindcycledetection.cpp", "callgrindcycledetection.h", "callgrinddatamodel.cpp", "callgrinddatamodel.h", "callgrindfunction.cpp", "callgrindfunction.h", "callgrindfunction_p.h", "callgrindfunctioncall.cpp", "callgrindfunctioncall.h", "callgrindfunctioncycle.cpp", "callgrindfunctioncycle.h", "callgrindparsedata.cpp", "callgrindparsedata.h", "callgrindparser.cpp", "callgrindparser.h", "callgrindproxymodel.cpp", "callgrindproxymodel.h", "callgrindrunner.cpp", "callgrindrunner.h", "callgrindstackbrowser.cpp", "callgrindstackbrowser.h" ] } Group { name: "Memcheck" prefix: "memcheck/" files: [ "memcheckrunner.cpp", "memcheckrunner.h" ] } Group { name: "XML Protocol" prefix: "xmlprotocol/" files: [ "announcethread.cpp", "announcethread.h", "error.cpp", "error.h", "errorlistmodel.cpp", "errorlistmodel.h", "frame.cpp", "frame.h", "modelhelpers.cpp", "modelhelpers.h", "parser.cpp", "parser.h", "stack.cpp", "stack.h", "stackmodel.cpp", "stackmodel.h", "status.cpp", "status.h", "suppression.cpp", "suppression.h", "threadedparser.cpp", "threadedparser.h", ] } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindcostview.cpp0000644000015301777760000000720412321547255030751 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindcostview.h" #include "callgrindnamedelegate.h" #include #include #include #include #include #include #include #include using namespace Valgrind::Callgrind; namespace Valgrind { namespace Internal { CostView::CostView(QWidget *parent) : Utils::BaseTreeView(parent) , m_costDelegate(new CostDelegate(this)) , m_nameDelegate(new NameDelegate(this)) { setSelectionMode(QAbstractItemView::ExtendedSelection); setSelectionBehavior(QAbstractItemView::SelectRows); setUniformRowHeights(true); setAutoScroll(false); setSortingEnabled(true); setRootIsDecorated(false); } CostView::~CostView() { } void CostView::setModel(QAbstractItemModel *model) { QTreeView::setModel(model); forever { QAbstractProxyModel *proxy = qobject_cast(model); if (!proxy) break; model = proxy->sourceModel(); } setItemDelegate(new QStyledItemDelegate(this)); if (qobject_cast(model)) { setItemDelegateForColumn(CallModel::CalleeColumn, m_nameDelegate); setItemDelegateForColumn(CallModel::CallerColumn, m_nameDelegate); setItemDelegateForColumn(CallModel::CostColumn, m_costDelegate); } else if (qobject_cast(model)) { setItemDelegateForColumn(DataModel::InclusiveCostColumn, m_costDelegate); setItemDelegateForColumn(DataModel::NameColumn, m_nameDelegate); setItemDelegateForColumn(DataModel::SelfCostColumn, m_costDelegate); } m_costDelegate->setModel(model); } void CostView::setCostFormat(CostDelegate::CostFormat format) { m_costDelegate->setFormat(format); viewport()->update(); } CostDelegate::CostFormat CostView::costFormat() const { return m_costDelegate->format(); } void CostView::contextMenuEvent(QContextMenuEvent *ev) { QMenu menu; addBaseContextActions(&menu); QAction *act = menu.exec(ev->globalPos()); handleBaseContextAction(act); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindtool.h0000644000015301777760000000431212321547255027525 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDTOOL_H #define CALLGRINDTOOL_H #include "valgrindtool.h" namespace Valgrind { namespace Internal { class CallgrindToolPrivate; class CallgrindTool : public ValgrindTool { Q_OBJECT public: CallgrindTool(QObject *parent); ~CallgrindTool(); ProjectExplorer::RunMode runMode() const; ToolMode toolMode() const; Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration = 0); QWidget *createWidgets(); void startTool(Analyzer::StartMode mode); void loadExternalXmlLogFile(); public slots: void handleShowCostsOfFunction(); private: CallgrindToolPrivate *d; }; } // namespace Internal } // namespace Valgrind #endif // CALLGRINDTOOL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/suppressiondialog.h0000644000015301777760000000474512321547255030454 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ANALYZER_VALGRIND_SUPPRESSIONDIALOG_H #define ANALYZER_VALGRIND_SUPPRESSIONDIALOG_H #include "xmlprotocol/error.h" #include #include QT_BEGIN_NAMESPACE class QPlainTextEdit; class QDialogButtonBox; QT_END_NAMESPACE namespace Valgrind { namespace Internal { class MemcheckErrorView; class ValgrindBaseSettings; class SuppressionDialog : public QDialog { Q_OBJECT public: SuppressionDialog(MemcheckErrorView *view, const QList &errors); static void maybeShow(MemcheckErrorView *view); private slots: void validate(); private: void accept(); void reject(); MemcheckErrorView *m_view; ValgrindBaseSettings *m_settings; bool m_cleanupIfCanceled; QList m_errors; Utils::PathChooser *m_fileChooser; QPlainTextEdit *m_suppressionEdit; QDialogButtonBox *m_buttonBox; }; } // namespace Internal } // namespace Valgrind #endif // ANALYZER_VALGRIND_SUPPRESSIONDIALOG_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheck/0000755000015301777760000000000012321547742026274 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheck/memcheckrunner.h0000644000015301777760000000433612321547255031460 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRIND_PROTOCOL_MEMCHECKRUNNER_H #define VALGRIND_PROTOCOL_MEMCHECKRUNNER_H #include "../valgrindrunner.h" namespace Valgrind { namespace XmlProtocol{ class ThreadedParser; } namespace Memcheck { class MemcheckRunner : public ValgrindRunner { Q_OBJECT public: explicit MemcheckRunner(QObject *parent = 0); ~MemcheckRunner(); void setParser(XmlProtocol::ThreadedParser *parser); bool start(); signals: void logMessageReceived(const QByteArray &); private slots: void xmlSocketConnected(); void logSocketConnected(); void readLogSocket(); private: QString tool() const; class Private; Private *d; }; } // namespace Memcheck } // namespace Valgrind #endif // VALGRIND_PROTOCOL_MEMCHECKRUNNER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheck/memcheckrunner.cpp0000644000015301777760000001710112321547255032005 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "memcheckrunner.h" #include "../xmlprotocol/error.h" #include "../xmlprotocol/status.h" #include "../xmlprotocol/threadedparser.h" #include #include #include #include #include #include #include #include #include #include #include namespace Valgrind { namespace Memcheck { class MemcheckRunner::Private { public: explicit Private() : parser(0), logSocket(0) { } QTcpServer xmlServer; XmlProtocol::ThreadedParser *parser; QTcpServer logServer; QTcpSocket *logSocket; }; MemcheckRunner::MemcheckRunner(QObject *parent) : ValgrindRunner(parent), d(new Private) { } MemcheckRunner::~MemcheckRunner() { if (d->parser->isRunning()) { // make sure we don't delete the thread while it's still running waitForFinished(); } delete d; d = 0; } QString MemcheckRunner::tool() const { return QLatin1String("memcheck"); } void MemcheckRunner::setParser(XmlProtocol::ThreadedParser *parser) { QTC_ASSERT(!d->parser, qt_noop()); d->parser = parser; } bool MemcheckRunner::start() { QTC_ASSERT(d->parser, return false); QString ip; QHostAddress hostAddr; if (startMode() == Analyzer::StartLocal) { ip = QLatin1String("127.0.0.1"); hostAddr = QHostAddress(QHostAddress::LocalHost); } if (startMode() == Analyzer::StartRemote) { QList possibleHostAddresses; //NOTE: ::allAddresses does not seem to work for usb interfaces... foreach (const QNetworkInterface &iface, QNetworkInterface::allInterfaces()) { foreach (const QNetworkAddressEntry &entry, iface.addressEntries()) { const QHostAddress addr = entry.ip(); if (addr.toString() != QLatin1String("127.0.0.1") && addr.toString() != QLatin1String("0:0:0:0:0:0:0:1")) { possibleHostAddresses << addr; break; } } } if (possibleHostAddresses.isEmpty()) { emit processErrorReceived(tr("No network interface found for remote analysis."), QProcess::FailedToStart); return false; } else if (possibleHostAddresses.size() > 1) { QDialog dlg; dlg.setWindowTitle(tr("Select Network Interface")); QVBoxLayout *layout = new QVBoxLayout; QLabel *description = new QLabel; description->setWordWrap(true); description->setText(tr("More than one network interface was found on your machine. Please select the one you want to use for remote analysis.")); layout->addWidget(description); QListWidget *list = new QListWidget; foreach (const QHostAddress &address, possibleHostAddresses) list->addItem(address.toString()); list->setSelectionMode(QAbstractItemView::SingleSelection); list->setCurrentRow(0); layout->addWidget(list); QDialogButtonBox *buttons = new QDialogButtonBox; buttons->addButton(QDialogButtonBox::Ok); buttons->addButton(QDialogButtonBox::Cancel); connect(buttons, SIGNAL(accepted()), &dlg, SLOT(accept())); connect(buttons, SIGNAL(rejected()), &dlg, SLOT(reject())); layout->addWidget(buttons); dlg.setLayout(layout); if (dlg.exec() != QDialog::Accepted) { emit processErrorReceived(tr("No network interface was chosen for remote analysis."), QProcess::FailedToStart); return false; } QTC_ASSERT(list->currentRow() >= 0, return false); QTC_ASSERT(list->currentRow() < possibleHostAddresses.size(), return false); hostAddr = possibleHostAddresses.at(list->currentRow()); } else { hostAddr = possibleHostAddresses.first(); } ip = hostAddr.toString(); QTC_ASSERT(!ip.isEmpty(), return false); hostAddr = QHostAddress(ip); } bool check = d->xmlServer.listen(hostAddr); if (!check) emit processErrorReceived( tr("XmlServer on %1:").arg(ip) + QLatin1Char(' ') + d->xmlServer.errorString(), QProcess::FailedToStart ); QTC_ASSERT(check, return false); d->xmlServer.setMaxPendingConnections(1); const quint16 xmlPortNumber = d->xmlServer.serverPort(); connect(&d->xmlServer, SIGNAL(newConnection()), SLOT(xmlSocketConnected())); check = d->logServer.listen(hostAddr); if (!check) emit processErrorReceived( tr("LogServer on %1:").arg(ip) + QLatin1Char(' ') + d->logServer.errorString(), QProcess::FailedToStart ); QTC_ASSERT(check, return false); d->logServer.setMaxPendingConnections(1); const quint16 logPortNumber = d->logServer.serverPort(); connect(&d->logServer, SIGNAL(newConnection()), SLOT(logSocketConnected())); QStringList memcheckLogArguments; memcheckLogArguments << QLatin1String("--xml=yes") << QString::fromLatin1("--xml-socket=%1:%2").arg(ip).arg(xmlPortNumber) << QLatin1String("--child-silent-after-fork=yes") << QString::fromLatin1("--log-socket=%1:%2").arg(ip).arg(logPortNumber); setValgrindArguments(memcheckLogArguments + valgrindArguments()); return ValgrindRunner::start(); } void MemcheckRunner::xmlSocketConnected() { QTcpSocket *socket = d->xmlServer.nextPendingConnection(); QTC_ASSERT(socket, return); d->xmlServer.close(); d->parser->parse(socket); } void MemcheckRunner::logSocketConnected() { d->logSocket = d->logServer.nextPendingConnection(); QTC_ASSERT(d->logSocket, return); connect(d->logSocket, SIGNAL(readyRead()), this, SLOT(readLogSocket())); d->logServer.close(); } void MemcheckRunner::readLogSocket() { QTC_ASSERT(d->logSocket, return); emit logMessageReceived(d->logSocket->readAll()); } } // namespace Memcheck } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheck/memcheck.pri0000644000015301777760000000014412321547255030562 0ustar pbusernogroup00000000000000QT *= network HEADERS += \ $$PWD/memcheckrunner.h SOURCES += \ $$PWD/memcheckrunner.cpp qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/0000755000015301777760000000000012321547742027102 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/announcethread.h0000644000015301777760000000451512321547255032255 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H #define LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H #include QT_BEGIN_NAMESPACE template class QVector; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class Frame; class AnnounceThread { public: AnnounceThread(); AnnounceThread(const AnnounceThread &other); ~AnnounceThread(); AnnounceThread &operator=(const AnnounceThread &other); void swap(AnnounceThread &other); bool operator==(const AnnounceThread &other) const; qint64 helgrindThreadId() const; void setHelgrindThreadId(qint64 id); QVector stack() const; void setStack(const QVector &stack); private: class Private; QSharedDataPointer d; }; } // namespace XmlProtocol } // namespace Valgrind #endif // LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/status.h0000644000015301777760000000436212321547255030602 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_STATUS_H #define LIBVALGRIND_PROTOCOL_STATUS_H #include #include namespace Valgrind { namespace XmlProtocol { class Status { public: enum State { Running, Finished }; Status(); Status(const Status &other); ~Status(); Status &operator=(const Status &other); void swap(Status &other); bool operator==(const Status &other) const; State state() const; void setState(State state); QString time() const; void setTime(const QString &time); private: class Private; QSharedDataPointer d; }; } // namespace XmlProtocol } // namespace Valgrind Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Status) #endif // LIBVALGRIND_PROTOCOL_STATUS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/threadedparser.h0000644000015301777760000000546012321547255032254 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Andreas Hartmetz, KDAB (andreas.hartmetz@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_THREADEDPARSER_H #define LIBVALGRIND_PROTOCOL_THREADEDPARSER_H #include QT_BEGIN_NAMESPACE class QIODevice; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class Error; class Status; /** * ThreadedParser for the Valgrind Output XmlProtocol 4 */ class ThreadedParser : public QObject { Q_OBJECT public: explicit ThreadedParser(QObject *parent = 0); ~ThreadedParser(); QString errorString() const; /// interface additions relative to Parser because Parser is synchronous and this /// class parses asynchronously in a non-public secondary thread. bool waitForFinished(); bool isRunning() const; public Q_SLOTS: ///@warning will move @p stream to a different thread and take ownership of it void parse(QIODevice *stream); private Q_SLOTS: void slotInternalError(const QString &errorString); Q_SIGNALS: void status(const Valgrind::XmlProtocol::Status &status); void error(const Valgrind::XmlProtocol::Error &error); void internalError(const QString &errorString); void errorCount(qint64 unique, qint64 count); void suppressionCount(const QString &name, qint64 count); void finished(); private: class Private; Private *const d; }; } // XmlProtocol } // Valgrind #endif //LIBVALGRIND_PROTOCOL_THREADEDPARSER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/errorlistmodel.cpp0000644000015301777760000002050412321547255032654 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "errorlistmodel.h" #include "error.h" #include "frame.h" #include "stack.h" #include "modelhelpers.h" #include #include #include namespace Valgrind { namespace XmlProtocol { class ErrorListModel::Private { public: QVector errors; QVariant errorData(int row, int column, int role) const; QSharedPointer relevantFrameFinder; Frame findRelevantFrame(const Error &error) const; QString formatAbsoluteFilePath(const Error &error) const; QString formatLocation(const Error &error) const; }; ErrorListModel::ErrorListModel(QObject *parent) : QAbstractItemModel(parent) , d(new Private) { } ErrorListModel::~ErrorListModel() { delete d; } QSharedPointer ErrorListModel::relevantFrameFinder() const { return d->relevantFrameFinder; } void ErrorListModel::setRelevantFrameFinder(const QSharedPointer &finder) { d->relevantFrameFinder = finder; } Frame ErrorListModel::findRelevantFrame(const Error &error) const { return d->findRelevantFrame(error); } QModelIndex ErrorListModel::index(int row, int column, const QModelIndex &parent) const { if (parent.isValid()) { QTC_ASSERT(parent.model() == this, qt_noop()); return QModelIndex(); } return createIndex(row, column); } QModelIndex ErrorListModel::parent(const QModelIndex &child) const { QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex()); return QModelIndex(); } Frame ErrorListModel::Private::findRelevantFrame(const Error &error) const { if (relevantFrameFinder) return relevantFrameFinder->findRelevant(error); const QVector stacks = error.stacks(); if (stacks.isEmpty()) return Frame(); const Stack &stack = stacks[0]; const QVector frames = stack.frames(); if (!frames.isEmpty()) return frames.first(); return Frame(); } QString ErrorListModel::Private::formatAbsoluteFilePath(const Error &error) const { const Frame f = findRelevantFrame(error); if (!f.directory().isEmpty() && !f.file().isEmpty()) return QString(f.directory() + QDir::separator() + f.file()); return QString(); } QString ErrorListModel::Private::formatLocation(const Error &error) const { const Frame frame = findRelevantFrame(error); const QString file = frame.file(); if (!frame.functionName().isEmpty()) return frame.functionName(); if (!file.isEmpty()) { const qint64 line = frame.line(); if (line > 0) return QString::fromLatin1("%1:%2").arg(file, QString::number(frame.line())); return file; } return frame.object(); } QVariant ErrorListModel::Private::errorData(int row, int column, int role) const { // A dummy entry. if (row == 0 && errors.isEmpty()) { if (role == Qt::DisplayRole) return tr("No errors found"); if (role == ErrorRole) return tr("No errors found"); return QVariant(); } if (row < 0 || row >= errors.size()) return QVariant(); const Error &error = errors.at(row); if (error.stacks().count()) switch (role) { case Qt::DisplayRole: { switch (column) { case WhatColumn: return error.what(); case LocationColumn: return formatLocation(error); case AbsoluteFilePathColumn: return formatAbsoluteFilePath(error); case LineColumn: { const qint64 line = findRelevantFrame(error).line(); return line > 0 ? line : QVariant(); } case UniqueColumn: return error.unique(); case TidColumn: return error.tid(); case KindColumn: return error.kind(); case LeakedBlocksColumn: return error.leakedBlocks(); case LeakedBytesColumn: return error.leakedBytes(); case HelgrindThreadIdColumn: return error.helgrindThreadId(); default: break; } } case Qt::ToolTipRole: return toolTipForFrame(findRelevantFrame(error)); case ErrorRole: return QVariant::fromValue(error); case AbsoluteFilePathRole: return formatAbsoluteFilePath(error); case FileRole: return findRelevantFrame(error).file(); case LineRole: { const qint64 line = findRelevantFrame(error).line(); return line > 0 ? line : QVariant(); } } return QVariant(); } QVariant ErrorListModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); if (!index.parent().isValid()) return d->errorData(index.row(), index.column(), role); return QVariant(); } QVariant ErrorListModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation != Qt::Horizontal || role != Qt::DisplayRole) return QVariant(); switch (section) { case WhatColumn: return tr("What"); case LocationColumn: return tr("Location"); case AbsoluteFilePathColumn: return tr("File"); case LineColumn: return tr("Line"); case UniqueColumn: return tr("Unique"); case TidColumn: return tr("Thread ID"); case KindColumn: return tr("Kind"); case LeakedBlocksColumn: return tr("Leaked Blocks"); case LeakedBytesColumn: return tr("Leaked Bytes"); case HelgrindThreadIdColumn: return tr("Helgrind Thread ID"); } return QVariant(); } int ErrorListModel::rowCount(const QModelIndex &parent) const { if (parent.isValid()) return 0; return qMax(1, d->errors.count()); } int ErrorListModel::columnCount(const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0); return ColumnCount; } bool ErrorListModel::removeRows(int row, int count, const QModelIndex &parent) { QTC_ASSERT(!parent.isValid() || parent.model() == this, return false); if (row < 0 || row + count > d->errors.size() || parent.isValid()) return false; beginRemoveRows(parent, row, row + count); d->errors.remove(row, count); endRemoveRows(); return true; } void ErrorListModel::addError(const Error &error) { beginInsertRows(QModelIndex(), d->errors.size(), d->errors.size()); d->errors.push_back(error); endInsertRows(); } Error ErrorListModel::error(const QModelIndex &index) const { if (!index.isValid()) return Error(); QTC_ASSERT(index.model() == this, return Error()); const int r = index.row(); if (r < 0 || r >= d->errors.size()) return Error(); return d->errors.at(r); } void ErrorListModel::clear() { beginResetModel(); d->errors.clear(); endResetModel(); } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/frame.h0000644000015301777760000000465712321547255030360 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_FRAME_H #define LIBVALGRIND_PROTOCOL_FRAME_H #include namespace Valgrind { namespace XmlProtocol { class Frame { public: Frame(); ~Frame(); Frame(const Frame &other); Frame &operator=(const Frame &other); void swap(Frame &other); bool operator==(const Frame &other) const; bool operator!=(const Frame &other) const; quint64 instructionPointer() const; void setInstructionPointer(quint64); QString object() const; void setObject(const QString &obj); QString functionName() const; void setFunctionName(const QString &functionName); QString file() const; void setFile(const QString &file); QString directory() const; void setDirectory(const QString &directory); int line() const; void setLine(int line); private: class Private; QSharedDataPointer d; }; } // namespace XmlProtocol } // namespace Valgrind #endif qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/stackmodel.h0000644000015301777760000000546112321547255031406 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_STACKMODEL_H #define LIBVALGRIND_PROTOCOL_STACKMODEL_H #include namespace Valgrind { namespace XmlProtocol { class Error; class StackModel : public QAbstractItemModel { Q_OBJECT public: enum Column { NameColumn = 0, FunctionNameColumn, DirectoryColumn, FileColumn, LineColumn, InstructionPointerColumn, ObjectColumn, ColumnCount }; enum Role { ObjectRole = Qt::UserRole, FunctionNameRole, DirectoryRole, FileRole, LineRole }; explicit StackModel(QObject *parent = 0); ~StackModel(); QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &child) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; void clear(); public Q_SLOTS: void setError(const Valgrind::XmlProtocol::Error &error); private: class Private; Private *const d; }; } // namespace XmlProtocol } // namespace Valgrind #endif // LIBVALGRIND_PROTOCOL_STACKMODEL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/modelhelpers.h0000644000015301777760000000352212321547255031737 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_MODELHELPERS_H #define LIBVALGRIND_PROTOCOL_MODELHELPERS_H #include QT_BEGIN_NAMESPACE class QString; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class Frame; QString toolTipForFrame(const Frame &frame); } // namespace XmlProtocol } // namespace Valgrind #endif // LIBVALGRIND_PROTOCOL_MODELHELPERS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/modelhelpers.cpp0000644000015301777760000000646712321547255032305 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "modelhelpers.h" #include "frame.h" #include #include #include #include namespace Valgrind { namespace XmlProtocol { QString toolTipForFrame(const Frame &frame) { QString location; if (!frame.file().isEmpty()) { location = frame.directory() + QDir::separator() + frame.file(); if (frame.line() > 0) location += QLatin1Char(':') + QString::number(frame.line()); } typedef QPair StringPair; QList lines; if (!frame.functionName().isEmpty()) lines << qMakePair(QCoreApplication::translate("Valgrind::XmlProtocol", "Function:"), frame.functionName()); if (!location.isEmpty()) lines << qMakePair(QCoreApplication::translate("Valgrind::XmlProtocol", "Location:"), location); if (frame.instructionPointer()) lines << qMakePair(QCoreApplication::translate("Valgrind::XmlProtocol", "Instruction pointer:"), QString::fromLatin1("0x%1").arg(frame.instructionPointer(), 0, 16)); if (!frame.object().isEmpty()) lines << qMakePair(QCoreApplication::translate("Valgrind::XmlProtocol", "Object:"), frame.object()); QString html = QLatin1String("" "" "\n" "
"); foreach (const StringPair &pair, lines) { html += QLatin1String("
"); html += pair.first; html += QLatin1String("
"); html += pair.second; html += QLatin1String("
\n"); } html += QLatin1String("
"); return html; } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/stackmodel.cpp0000644000015301777760000001526112321547255031740 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "stackmodel.h" #include "error.h" #include "frame.h" #include "stack.h" #include "modelhelpers.h" #include #include #include namespace Valgrind { namespace XmlProtocol { class StackModel::Private { public: Error error; Stack stack(int i) const { if (i < 0 || i >= error.stacks().size()) return Stack(); else return error.stacks().at(i); } }; static QString makeName(const Frame &frame) { const QString d = frame.directory(); const QString f = frame.file(); const QString fn = frame.functionName(); if (!fn.isEmpty()) return fn; if (!d.isEmpty() && !f.isEmpty()) return frame.line() > 0 ? QString::fromLatin1("%1%2%3:%4").arg(d, QDir::separator(), f, QString::number(frame.line())) : QString::fromLatin1("%1%2%3").arg(d, QDir::separator(), f); return frame.object(); } StackModel::StackModel(QObject *parent) : QAbstractItemModel(parent) , d(new Private) { } StackModel::~StackModel() { delete d; } QVariant StackModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); QTC_ASSERT(index.model() == this, return QVariant()); if (!index.parent().isValid()) { const Stack stack = d->stack(index.row()); if (role == Qt::DisplayRole) { switch (index.column()) { case NameColumn: if (!stack.auxWhat().isEmpty()) return stack.auxWhat(); else return d->error.what(); default: return QVariant(); } } } else { const Stack stack = d->stack(index.parent().row()); const QVector frames = stack.frames(); const int fidx = index.row(); if (fidx < 0 || fidx >= frames.size()) return QVariant(); const Frame &frame = frames[fidx]; switch (role) { case Qt::DisplayRole: { switch (index.column()) { case NameColumn: return makeName(frame); case InstructionPointerColumn: return QString::fromLatin1("0x%1").arg(frame.instructionPointer(), 0, 16); case ObjectColumn: return frame.object(); case FunctionNameColumn: return frame.functionName(); case DirectoryColumn: return frame.directory(); case FileColumn: return frame.file(); case LineColumn: if (frame.line() > 0) return frame.line(); else return QVariant(); } break; } case Qt::ToolTipRole: return toolTipForFrame(frame); case ObjectRole: return frame.object(); case FunctionNameRole: return frame.functionName(); case FileRole: return frame.file(); case DirectoryRole: return frame.directory(); case LineRole: if (frame.line() > 0) return frame.line(); else return QVariant(); } } return QVariant(); } QVariant StackModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation != Qt::Horizontal || role != Qt::DisplayRole) return QVariant(); switch (section) { case NameColumn: return tr("Description"); case InstructionPointerColumn: return tr("Instruction Pointer"); case ObjectColumn: return tr("Object"); case FunctionNameColumn: return tr("Function"); case DirectoryColumn: return tr("Directory"); case FileColumn: return tr("File"); case LineColumn: return tr("Line"); } return QVariant(); } QModelIndex StackModel::index(int row, int column, const QModelIndex &parent) const { if (parent.isValid()) { QTC_ASSERT(parent.model() == this, return QModelIndex()); return createIndex(row, column, parent.row()); } return createIndex(row, column, -1); } QModelIndex StackModel::parent(const QModelIndex &child) const { QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex()); if (quintptr(child.internalId()) == quintptr(-1)) return QModelIndex(); return createIndex(child.internalId(), 0, -1); } int StackModel::rowCount(const QModelIndex &parent) const { if (!parent.isValid()) return d->error.stacks().size(); QTC_ASSERT(parent.model() == this, return 0); const QModelIndex gp = parent.parent(); if (!gp.isValid()) return d->stack(parent.row()).frames().size(); return 0; } int StackModel::columnCount(const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0); return ColumnCount; } void StackModel::setError(const Error &error) { if (d->error == error) return; beginResetModel(); d->error = error; endResetModel(); } void StackModel::clear() { beginResetModel(); d->error = Error(); endResetModel(); } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/suppression.h0000644000015301777760000000636212321547255031653 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_SUPPRESSION_H #define LIBVALGRIND_PROTOCOL_SUPPRESSION_H #include QT_BEGIN_NAMESPACE class QString; template class QVector; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class SuppressionFrame { public: SuppressionFrame(); SuppressionFrame(const SuppressionFrame &other); ~SuppressionFrame(); SuppressionFrame &operator=(const SuppressionFrame &other); void swap(SuppressionFrame &other); bool operator==(const SuppressionFrame &other) const; bool operator!=(const SuppressionFrame &other) const { return !operator==(other); } QString object() const; void setObject(const QString &object); QString function() const; void setFunction(const QString &function); QString toString() const; private: class Private; QSharedDataPointer d; }; typedef QVector SuppressionFrames; class Suppression { public: Suppression(); Suppression(const Suppression &other); ~Suppression(); Suppression &operator=(const Suppression &other); void swap(Suppression &other); bool operator==(const Suppression &other) const; bool isNull() const; QString name() const; void setName(const QString &name); QString kind() const; void setKind(const QString &kind); QString auxKind() const; void setAuxKind(const QString &kind); QString rawText() const; void setRawText(const QString &text); SuppressionFrames frames() const; void setFrames(const SuppressionFrames &frames); QString toString() const; private: class Private; QSharedDataPointer d; }; } // namespace XmlProtocol } // namespace Valgrind #endif // LIBVALGRIND_PROTOCOL_SUPPRESSION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/xmlprotocol.pri0000644000015301777760000000112212321547255032173 0ustar pbusernogroup00000000000000QT *= network HEADERS += \ $$PWD/frame.h \ $$PWD/parser.h \ $$PWD/error.h \ $$PWD/status.h \ $$PWD/suppression.h \ $$PWD/threadedparser.h \ $$PWD/announcethread.h \ $$PWD/stack.h \ $$PWD/errorlistmodel.h \ $$PWD/stackmodel.h \ $$PWD/modelhelpers.h SOURCES += \ $$PWD/error.cpp \ $$PWD/frame.cpp \ $$PWD/parser.cpp \ $$PWD/status.cpp \ $$PWD/suppression.cpp \ $$PWD/threadedparser.cpp \ $$PWD/announcethread.cpp \ $$PWD/stack.cpp \ $$PWD/errorlistmodel.cpp \ $$PWD/stackmodel.cpp \ $$PWD/modelhelpers.cpp qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/frame.cpp0000644000015301777760000000655312321547255030710 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "frame.h" #include #include namespace Valgrind { namespace XmlProtocol { class Frame::Private : public QSharedData { public: Private() : ip(0), line(-1) {} bool operator==(const Private &other) const { return ip == other.ip && object == other.object && functionName == other.functionName && file == other.file && directory == other.directory && line == other.line; } quint64 ip; QString object; QString functionName; QString file; QString directory; int line; }; Frame::Frame() : d(new Private) { } Frame::~Frame() { } Frame::Frame(const Frame &other) : d(other.d) { } Frame &Frame::operator=(const Frame &other) { Frame tmp(other); swap(tmp); return *this; } bool Frame::operator==( const Frame &other ) const { return *d == *other.d; } bool Frame::operator!=(const Frame &other) const { return !(*this == other); } void Frame::swap(Frame &other) { qSwap(d, other.d); } quint64 Frame::instructionPointer() const { return d->ip; } void Frame::setInstructionPointer(quint64 ip) { d->ip = ip; } QString Frame::object() const { return d->object; } void Frame::setObject(const QString &obj) { d->object = obj; } QString Frame::functionName() const { return d->functionName; } void Frame::setFunctionName(const QString &functionName) { d->functionName = functionName; } QString Frame::file() const { return d->file; } void Frame::setFile(const QString &file) { d->file = file; } QString Frame::directory() const { return d->directory; } void Frame::setDirectory(const QString &directory) { d->directory = directory; } int Frame::line() const { return d->line; } void Frame::setLine(int line) { d->line = line; } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/error.cpp0000644000015301777760000001365712321547255030752 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "error.h" #include "frame.h" #include "stack.h" #include "suppression.h" #include #include #include #include #include namespace Valgrind { namespace XmlProtocol { class Error::Private : public QSharedData { public: explicit Private() : unique(0), tid(0), kind(0), leakedBytes(0), leakedBlocks(0), hThreadId(-1) {} qint64 unique; qint64 tid; QString what; int kind; QVector stacks; Suppression suppression; quint64 leakedBytes; qint64 leakedBlocks; qint64 hThreadId; bool operator==(const Private &other) const { return unique == other.unique && tid == other.tid && what == other.what && kind == other.kind && stacks == other.stacks && suppression == other.suppression && leakedBytes == other.leakedBytes && leakedBlocks == other.leakedBlocks && hThreadId == other.hThreadId; } }; Error::Error() : d(new Private) { } Error::~Error() { } Error::Error(const Error &other) : d( other.d ) { } void Error::swap(Error &other) { qSwap(d, other.d); } Error &Error::operator=(const Error &other) { Error tmp(other); swap(tmp); return *this; } bool Error::operator ==(const Error &other) const { return *d == *other.d; } bool Error::operator !=(const Error &other) const { return !(*d == *other.d); } Suppression Error::suppression() const { return d->suppression; } void Error::setSuppression(const Suppression &supp) { d->suppression = supp; } qint64 Error::unique() const { return d->unique; } void Error::setUnique(qint64 unique) { d->unique = unique; } qint64 Error::tid() const { return d->tid; } void Error::setTid(qint64 tid) { d->tid = tid; } quint64 Error::leakedBytes() const { return d->leakedBytes; } void Error::setLeakedBytes(quint64 l) { d->leakedBytes = l; } qint64 Error::leakedBlocks() const { return d->leakedBlocks; } void Error::setLeakedBlocks(qint64 b) { d->leakedBlocks = b; } QString Error::what() const { return d->what; } void Error::setWhat(const QString &what) { d->what = what; } int Error::kind() const { return d->kind; } void Error::setKind(int k) { d->kind = k; } QVector Error::stacks() const { return d->stacks; } void Error::setStacks(const QVector &stacks) { d->stacks = stacks; } void Error::setHelgrindThreadId(qint64 id) { d->hThreadId = id; } qint64 Error::helgrindThreadId() const { return d->hThreadId; } QString Error::toXml() const { QString xml; QTextStream stream(&xml); stream << "\n"; stream << " " << d->unique << "\n"; stream << " " << d->tid << "\n"; stream << " " << d->kind << "\n"; if (d->leakedBlocks > 0 && d->leakedBytes > 0) { stream << " \n" << " " << d->what << "\n" << " " << d->leakedBytes << "\n" << " " << d->leakedBlocks << "\n" << " \n"; } else { stream << " " << d->what << "\n"; } foreach (const Stack &stack, d->stacks) { if (!stack.auxWhat().isEmpty()) stream << " " << stack.auxWhat() << "\n"; stream << " \n"; foreach (const Frame &frame, stack.frames()) { stream << " \n"; stream << " 0x" << QString::number(frame.instructionPointer(), 16) << "\n"; if (!frame.object().isEmpty()) stream << " " << frame.object() << "\n"; if (!frame.functionName().isEmpty()) stream << " " << frame.functionName() << "\n"; if (!frame.directory().isEmpty()) stream << " " << frame.directory() << "\n"; if (!frame.file().isEmpty()) stream << " " << frame.file() << "\n"; if (frame.line() != -1) stream << " " << frame.line() << ""; stream << " \n"; } stream << " \n"; } stream << "\n"; return xml; } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/parser.cpp0000644000015301777760000006364512321547255031117 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "parser.h" #include "announcethread.h" #include "error.h" #include "frame.h" #include "stack.h" #include "status.h" #include "suppression.h" #include #include #include #include #include #include #include #include namespace { class ParserException { public: explicit ParserException(const QString &message) : m_message(message) {} ~ParserException() throw() {} QString message() const { return m_message; } private: QString m_message; }; struct XWhat { XWhat() : leakedblocks(0), leakedbytes(0), hthreadid(-1) {} QString text; qint64 leakedblocks; qint64 leakedbytes; qint64 hthreadid; }; struct XauxWhat { XauxWhat() : line(-1), hthreadid(-1) {} void clear() { *this = XauxWhat(); } QString text; QString file; QString dir; qint64 line; qint64 hthreadid; }; } // namespace anon namespace Valgrind { namespace XmlProtocol { class Parser::Private { public: explicit Private(Parser *qq); void parse(QIODevice *device); QString errorString; private: void parseError(); QVector parseStack(); Suppression parseSuppression(); SuppressionFrame parseSuppressionFrame(); Frame parseFrame(); void parseStatus(); void parseErrorCounts(); void parseSuppressionCounts(); void parseAnnounceThread(); void checkProtocolVersion(const QString &versionStr); void checkTool(const QString &tool); XWhat parseXWhat(); XauxWhat parseXauxWhat(); MemcheckErrorKind parseMemcheckErrorKind(const QString &kind); HelgrindErrorKind parseHelgrindErrorKind(const QString &kind); PtrcheckErrorKind parsePtrcheckErrorKind(const QString &kind); int parseErrorKind(const QString &kind); void reportInternalError(const QString &errorString); QXmlStreamReader::TokenType blockingReadNext(); bool notAtEnd() const; QString blockingReadElementText(); Tool tool; QXmlStreamReader reader; QHash errorKindsByName_memcheck; QHash errorKindsByName_helgrind; QHash errorKindsByName_ptrcheck; QHash toolsByName; private: Parser *const q; }; #undef ADD_ENUM #define ADD_ENUM(tool,enumV) { errorKindsByName_##tool.insert(QLatin1String(#enumV), enumV); } Parser::Private::Private(Parser *qq) : q(qq) { tool = Parser::Unknown; toolsByName.insert(QLatin1String("memcheck"), Parser::Memcheck); toolsByName.insert(QLatin1String("ptrcheck"), Parser::Ptrcheck); toolsByName.insert(QLatin1String("exp-ptrcheck"), Parser::Ptrcheck); toolsByName.insert(QLatin1String("helgrind"), Parser::Helgrind); ADD_ENUM(memcheck, ClientCheck) ADD_ENUM(memcheck, InvalidFree) ADD_ENUM(memcheck, InvalidJump) ADD_ENUM(memcheck, InvalidRead) ADD_ENUM(memcheck, InvalidWrite) ADD_ENUM(memcheck, Leak_DefinitelyLost) ADD_ENUM(memcheck, Leak_PossiblyLost) ADD_ENUM(memcheck, Leak_StillReachable) ADD_ENUM(memcheck, Leak_IndirectlyLost) ADD_ENUM(memcheck, MismatchedFree) ADD_ENUM(memcheck, Overlap) ADD_ENUM(memcheck, SyscallParam) ADD_ENUM(memcheck, UninitCondition) ADD_ENUM(memcheck, UninitValue) ADD_ENUM(helgrind, Race) ADD_ENUM(helgrind, UnlockUnlocked) ADD_ENUM(helgrind, UnlockForeign) ADD_ENUM(helgrind, UnlockBogus) ADD_ENUM(helgrind, PthAPIerror) ADD_ENUM(helgrind, LockOrder) ADD_ENUM(helgrind, Misc) ADD_ENUM(ptrcheck, SorG) ADD_ENUM(ptrcheck, Heap) ADD_ENUM(ptrcheck, Arith) ADD_ENUM(ptrcheck, SysParam) } #undef ADD_ENUM static quint64 parseHex(const QString &str, const QString &context) { bool ok; const quint64 v = str.toULongLong(&ok, 16); if (!ok) throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Could not parse hex number from \"%1\" (%2)").arg(str, context)); return v; } static qint64 parseInt64(const QString &str, const QString &context) { bool ok; const quint64 v = str.toLongLong(&ok); if (!ok) throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Could not parse hex number from \"%1\" (%2)").arg(str, context)); return v; } QXmlStreamReader::TokenType Parser::Private::blockingReadNext() { QXmlStreamReader::TokenType token = QXmlStreamReader::Invalid; forever { token = reader.readNext(); if (reader.error() == QXmlStreamReader::PrematureEndOfDocumentError) { if (reader.device()->waitForReadyRead(1000)) { // let's try again continue; } else { // device error, e.g. remote host closed connection, or timeout // ### we have no way to know if waitForReadyRead() timed out or failed with a real // error, and sensible heuristics based on QIODevice fail. // - error strings are translated and in any case not guaranteed to stay the same, // so we can't use them. // - errorString().isEmpty() does not work because errorString() is // "network timeout error" if the waitFor... timed out. // - isSequential() [for socket] && isOpen() doesn't work because isOpen() // returns true if the remote host closed the connection. // ...so we fall back to knowing it might be a QAbstractSocket. QIODevice *dev = reader.device(); QAbstractSocket *sock = qobject_cast(dev); if (!sock || sock->state() != QAbstractSocket::ConnectedState) throw ParserException(dev->errorString()); } } else if (reader.hasError()) { throw ParserException(reader.errorString()); //TODO add line, column? break; } else { // read a valid next token break; } } return token; } bool Parser::Private::notAtEnd() const { return !reader.atEnd() || reader.error() == QXmlStreamReader::PrematureEndOfDocumentError; } QString Parser::Private::blockingReadElementText() { //analogous to QXmlStreamReader::readElementText(), but blocking. readElementText() doesn't recover from PrematureEndOfData, //but always returns a null string if isStartElement() is false (which is the case if it already parts of the text) //affects at least Qt <= 4.7.1. Reported as QTBUG-14661. if (!reader.isStartElement()) throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "trying to read element text although current position is not start of element")); QString result; forever { const QXmlStreamReader::TokenType type = blockingReadNext(); switch (type) { case QXmlStreamReader::Characters: case QXmlStreamReader::EntityReference: result += reader.text(); break; case QXmlStreamReader::EndElement: return result; case QXmlStreamReader::ProcessingInstruction: case QXmlStreamReader::Comment: break; case QXmlStreamReader::StartElement: throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Unexpected child element while reading element text")); default: //TODO handle throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Unexpected token type %1").arg(type)); break; } } return QString(); } void Parser::Private::checkProtocolVersion(const QString &versionStr) { bool ok; const int version = versionStr.toInt(&ok); if (!ok) throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Could not parse protocol version from \"%1\"").arg(versionStr)); if (version != 4) throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "XmlProtocol version %1 not supported (supported version: 4)").arg(version)); } void Parser::Private::checkTool(const QString &reportedStr) { const QHash::ConstIterator reported = toolsByName.find(reportedStr); if (reported == toolsByName.constEnd()) throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Valgrind tool \"%1\" not supported").arg(reportedStr)); tool = reported.value(); } XWhat Parser::Private::parseXWhat() { XWhat what; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; const QStringRef name = reader.name(); if (name == QLatin1String("text")) what.text = blockingReadElementText(); else if (name == QLatin1String("leakedbytes")) what.leakedbytes = parseInt64(blockingReadElementText(), QLatin1String("error/xwhat[memcheck]/leakedbytes")); else if (name == QLatin1String("leakedblocks")) what.leakedblocks = parseInt64(blockingReadElementText(), QLatin1String("error/xwhat[memcheck]/leakedblocks")); else if (name == QLatin1String("hthreadid")) what.hthreadid = parseInt64(blockingReadElementText(), QLatin1String("error/xwhat[memcheck]/hthreadid")); else if (reader.isStartElement()) reader.skipCurrentElement(); } return what; } XauxWhat Parser::Private::parseXauxWhat() { XauxWhat what; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; const QStringRef name = reader.name(); if (name == QLatin1String("text")) what.text = blockingReadElementText(); else if (name == QLatin1String("file")) what.file = blockingReadElementText(); else if (name == QLatin1String("dir")) what.dir = blockingReadElementText(); else if (name == QLatin1String("line")) what.line = parseInt64(blockingReadElementText(), QLatin1String("error/xauxwhat/line")); else if (name == QLatin1String("hthreadid")) what.hthreadid = parseInt64(blockingReadElementText(), QLatin1String("error/xauxwhat/hthreadid")); else if (reader.isStartElement()) reader.skipCurrentElement(); } return what; } MemcheckErrorKind Parser::Private::parseMemcheckErrorKind(const QString &kind) { const QHash::ConstIterator it = errorKindsByName_memcheck.find(kind); if (it != errorKindsByName_memcheck.constEnd()) return *it; else throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Unknown memcheck error kind \"%1\"").arg(kind)); } HelgrindErrorKind Parser::Private::parseHelgrindErrorKind(const QString &kind) { const QHash::ConstIterator it = errorKindsByName_helgrind.find(kind); if (it != errorKindsByName_helgrind.constEnd()) return *it; else throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Unknown helgrind error kind \"%1\"").arg(kind)); } PtrcheckErrorKind Parser::Private::parsePtrcheckErrorKind(const QString &kind) { const QHash::ConstIterator it = errorKindsByName_ptrcheck.find(kind); if (it != errorKindsByName_ptrcheck.constEnd()) return *it; else throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Unknown ptrcheck error kind \"%1\"").arg(kind)); } int Parser::Private::parseErrorKind(const QString &kind) { switch (tool) { case Memcheck: return parseMemcheckErrorKind(kind); case Ptrcheck: return parsePtrcheckErrorKind(kind); case Helgrind: return parseHelgrindErrorKind(kind); case Unknown: default: break; } throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Could not parse error kind, tool not yet set.")); } static Status::State parseState(const QString &state) { if (state == QLatin1String("RUNNING")) return Status::Running; if (state == QLatin1String("FINISHED")) return Status::Finished; throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Unknown state \"%1\"").arg(state)); } void Parser::Private::reportInternalError(const QString &e) { errorString = e; emit q->internalError(e); } static Stack makeStack(const XauxWhat &xauxwhat, const QVector &frames) { Stack s; s.setFrames(frames); s.setFile(xauxwhat.file); s.setDirectory(xauxwhat.dir); s.setLine(xauxwhat.line); s.setHelgrindThreadId(xauxwhat.hthreadid); s.setAuxWhat(xauxwhat.text); return s; } void Parser::Private::parseError() { Error e; QVector > frames; XauxWhat currentAux; QVector auxs; int lastAuxWhat = -1; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) lastAuxWhat++; const QStringRef name = reader.name(); if (name == QLatin1String("unique")) { e.setUnique(parseHex(blockingReadElementText(), QLatin1String("unique"))); } else if (name == QLatin1String("tid")) { e.setTid(parseInt64(blockingReadElementText(), QLatin1String("error/tid"))); } else if (name == QLatin1String("kind")) { //TODO this is memcheck-specific: e.setKind(parseErrorKind(blockingReadElementText())); } else if (name == QLatin1String("suppression")) { e.setSuppression(parseSuppression()); } else if (name == QLatin1String("xwhat")) { const XWhat xw = parseXWhat(); e.setWhat(xw.text); e.setLeakedBlocks(xw.leakedblocks); e.setLeakedBytes(xw.leakedbytes); e.setHelgrindThreadId(xw.hthreadid); } else if (name == QLatin1String("what")) { e.setWhat(blockingReadElementText()); } else if (name == QLatin1String("xauxwhat")) { if (!currentAux.text.isEmpty()) auxs.push_back(currentAux); currentAux = parseXauxWhat(); } else if (name == QLatin1String("auxwhat")) { const QString aux = blockingReadElementText(); //concatenate multiple consecutive tags if (lastAuxWhat > 1) { if (!currentAux.text.isEmpty()) auxs.push_back(currentAux); currentAux.clear(); currentAux.text = aux; } else { if (!currentAux.text.isEmpty()) currentAux.text.append(QLatin1Char(' ')); currentAux.text.append(aux); } lastAuxWhat = 0; } else if (name == QLatin1String("stack")) { frames.push_back(parseStack()); } else if (reader.isStartElement()) { reader.skipCurrentElement(); } } if (!currentAux.text.isEmpty()) auxs.push_back(currentAux); //if we have less xaux/auxwhats than stacks, prepend empty xauxwhats //(the first frame usually has not xauxwhat in helgrind and memcheck) while (auxs.size() < frames.size()) auxs.prepend(XauxWhat()); QVector stacks; for (int i = 0; i < auxs.size(); ++i) stacks.append(makeStack(auxs[i], frames[i])); e.setStacks(stacks); emit q->error(e); } Frame Parser::Private::parseFrame() { Frame frame; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { const QStringRef name = reader.name(); if (name == QLatin1String("ip")) frame.setInstructionPointer(parseHex(blockingReadElementText(), QLatin1String("error/frame/ip"))); else if (name == QLatin1String("obj")) frame.setObject(blockingReadElementText()); else if (name == QLatin1String("fn")) frame.setFunctionName( blockingReadElementText()); else if (name == QLatin1String("dir")) frame.setDirectory(blockingReadElementText()); else if (name == QLatin1String("file")) frame.setFile( blockingReadElementText()); else if (name == QLatin1String("line")) frame.setLine(parseInt64(blockingReadElementText(), QLatin1String("error/frame/line"))); else if (reader.isStartElement()) reader.skipCurrentElement(); } } return frame; } void Parser::Private::parseAnnounceThread() { AnnounceThread at; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { const QStringRef name = reader.name(); if (name == QLatin1String("hthreadid")) at.setHelgrindThreadId(parseInt64(blockingReadElementText(), QLatin1String("announcethread/hthreadid"))); else if (name == QLatin1String("stack")) at.setStack(parseStack()); else if (reader.isStartElement()) reader.skipCurrentElement(); } } emit q->announceThread(at); } void Parser::Private::parseErrorCounts() { while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { if (reader.name() == QLatin1String("pair")) { qint64 unique = 0; qint64 count = 0; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { const QStringRef name = reader.name(); if (name == QLatin1String("unique")) unique = parseHex(blockingReadElementText(), QLatin1String("errorcounts/pair/unique")); else if (name == QLatin1String("count")) count = parseInt64(blockingReadElementText(), QLatin1String("errorcounts/pair/count")); else if (reader.isStartElement()) reader.skipCurrentElement(); } } emit q->errorCount(unique, count); } else if (reader.isStartElement()) reader.skipCurrentElement(); } } } void Parser::Private::parseSuppressionCounts() { while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { if (reader.name() == QLatin1String("pair")) { QString pairName; qint64 count = 0; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { const QStringRef name = reader.name(); if (name == QLatin1String("name")) pairName = blockingReadElementText(); else if (name == QLatin1String("count")) count = parseInt64(blockingReadElementText(), QLatin1String("suppcounts/pair/count")); else if (reader.isStartElement()) reader.skipCurrentElement(); } } emit q->suppressionCount(pairName, count); } else if (reader.isStartElement()) reader.skipCurrentElement(); } } } void Parser::Private::parseStatus() { Status s; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { const QStringRef name = reader.name(); if (name == QLatin1String("state")) s.setState(parseState(blockingReadElementText())); else if (name == QLatin1String("time")) s.setTime(blockingReadElementText()); else if (reader.isStartElement()) reader.skipCurrentElement(); } } emit q->status(s); } QVector Parser::Private::parseStack() { QVector frames; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { if (reader.name() == QLatin1String("frame")) frames.append(parseFrame()); } } return frames; } SuppressionFrame Parser::Private::parseSuppressionFrame() { SuppressionFrame frame; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { const QStringRef name = reader.name(); if (name == QLatin1String("obj")) frame.setObject(blockingReadElementText()); else if (name == QLatin1String("fun")) frame.setFunction( blockingReadElementText()); else if (reader.isStartElement()) reader.skipCurrentElement(); } } return frame; } Suppression Parser::Private::parseSuppression() { Suppression supp; SuppressionFrames frames; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) break; if (reader.isStartElement()) { const QStringRef name = reader.name(); if (name == QLatin1String("sname")) supp.setName(blockingReadElementText()); else if (name == QLatin1String("skind")) supp.setKind(blockingReadElementText()); else if (name == QLatin1String("skaux")) supp.setAuxKind(blockingReadElementText()); else if (name == QLatin1String("rawtext")) supp.setRawText(blockingReadElementText()); else if (name == QLatin1String("sframe")) frames.push_back(parseSuppressionFrame()); } } supp.setFrames(frames); return supp; } void Parser::Private::parse(QIODevice *device) { QTC_ASSERT(device, return); reader.setDevice(device); try { while (notAtEnd()) { blockingReadNext(); QStringRef name = reader.name(); if (name == QLatin1String("error")) parseError(); else if (name == QLatin1String("announcethread")) parseAnnounceThread(); else if (name == QLatin1String("status")) parseStatus(); else if (name == QLatin1String("errorcounts")) parseErrorCounts(); else if (name == QLatin1String("suppcounts")) parseSuppressionCounts(); else if (name == QLatin1String("protocolversion")) checkProtocolVersion(blockingReadElementText()); else if (name == QLatin1String("protocoltool")) checkTool(blockingReadElementText()); } } catch (const ParserException &e) { reportInternalError(e.message()); } catch (...) { reportInternalError(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", "Unexpected exception caught during parsing.")); } emit q->finished(); } Parser::Parser(QObject *parent) : QObject(parent) , d(new Private(this)) { } Parser::~Parser() { delete d; } QString Parser::errorString() const { return d->errorString; } void Parser::parse(QIODevice *device) { d->parse(device); } } // namespace XmlParser } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/error.h0000644000015301777760000000677512321547255030422 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_ERROR_H #define LIBVALGRIND_PROTOCOL_ERROR_H #include #include QT_BEGIN_NAMESPACE class QString; template class QVector; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class Frame; class Stack; class Suppression; /** * Error kinds, specific to memcheck */ enum MemcheckErrorKind { InvalidFree, MismatchedFree, InvalidRead, InvalidWrite, InvalidJump, Overlap, InvalidMemPool, UninitCondition, UninitValue, SyscallParam, ClientCheck, Leak_DefinitelyLost, Leak_PossiblyLost, Leak_StillReachable, Leak_IndirectlyLost, MemcheckErrorKindCount }; enum PtrcheckErrorKind { SorG, Heap, Arith, SysParam }; enum HelgrindErrorKind { Race, UnlockUnlocked, UnlockForeign, UnlockBogus, PthAPIerror, LockOrder, Misc }; class Error { public: Error(); ~Error(); Error(const Error &other); Error &operator=(const Error &other); void swap(Error &other); bool operator==(const Error &other) const; bool operator!=(const Error &other) const; qint64 unique() const; void setUnique(qint64 unique); qint64 tid() const; void setTid(qint64); QString what() const; void setWhat(const QString &what); int kind() const; void setKind(int kind); QVector stacks() const; void setStacks(const QVector &stacks); Suppression suppression() const; void setSuppression(const Suppression &suppression); //memcheck quint64 leakedBytes() const; void setLeakedBytes(quint64); qint64 leakedBlocks() const; void setLeakedBlocks(qint64 blocks); //helgrind qint64 helgrindThreadId() const; void setHelgrindThreadId( qint64 threadId ); QString toXml() const; private: class Private; QSharedDataPointer d; }; } // namespace XmlProtocol } // namespace Valgrind Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Error) #endif // LIBVALGRIND_PROTOCOL_ERROR_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/parser.h0000644000015301777760000000511512321547255030550 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_PARSER_H #define LIBVALGRIND_PROTOCOL_PARSER_H #include QT_BEGIN_NAMESPACE class QIODevice; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class AnnounceThread; class Error; class Status; /** * Parser for the Valgrind Output XML Protocol 4 */ class Parser : public QObject { Q_OBJECT public: enum Tool { Unknown, Memcheck, Ptrcheck, Helgrind }; explicit Parser(QObject *parent=0); ~Parser(); QString errorString() const; public Q_SLOTS: void parse(QIODevice *stream); Q_SIGNALS: void status(const Valgrind::XmlProtocol::Status &status); void error(const Valgrind::XmlProtocol::Error &error); void internalError(const QString &errorString); void errorCount(qint64 unique, qint64 count); void suppressionCount(const QString &name, qint64 count); void announceThread(const Valgrind::XmlProtocol::AnnounceThread &announceThread); void finished(); private: class Private; Private *const d; }; } // XmlProtocol } // Valgrind #endif //LIBVALGRIND_PROTOCOL_PARSER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/errorlistmodel.h0000644000015301777760000000666612321547255032336 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H #define LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H #include #include namespace Valgrind { namespace XmlProtocol { class Error; class Frame; class ErrorListModel : public QAbstractItemModel { Q_OBJECT public: enum Column { WhatColumn = 0, LocationColumn, AbsoluteFilePathColumn, LineColumn, UniqueColumn, TidColumn, KindColumn, LeakedBlocksColumn, LeakedBytesColumn, HelgrindThreadIdColumn, ColumnCount }; enum Role { ErrorRole = Qt::UserRole, AbsoluteFilePathRole, FileRole, LineRole }; class RelevantFrameFinder { public: virtual ~RelevantFrameFinder() {} virtual Frame findRelevant(const Error &error) const = 0; }; explicit ErrorListModel(QObject *parent = 0); ~ErrorListModel(); QSharedPointer relevantFrameFinder() const; void setRelevantFrameFinder(const QSharedPointer &finder); QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &child) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); Error error(const QModelIndex &index) const; Frame findRelevantFrame(const Error &error) const; void clear(); public slots: void addError(const Valgrind::XmlProtocol::Error &error); private: class Private; Private *const d; }; } // namespace XmlProtocol } // namespace Valgrind #endif // LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/status.cpp0000644000015301777760000000466012321547255031136 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "status.h" #include #include namespace Valgrind { namespace XmlProtocol { class Status::Private : public QSharedData { public: Private() : state(Running) { } State state; QString time; }; Status::Status() : d(new Private) { } Status::Status(const Status &other) : d(other.d) { } Status::~Status() { } void Status::swap(Status &other) { qSwap(d, other.d); } Status &Status::operator=(const Status &other) { Status tmp(other); swap(tmp); return *this; } bool Status::operator==(const Status &other) const { return d->state == other.d->state && d->time == other.d->time; } void Status::setState(State state) { d->state = state; } Status::State Status::state() const { return d->state; } void Status::setTime(const QString &time) { d->time = time; } QString Status::time() const { return d->time; } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/stack.cpp0000644000015301777760000000636512321547255030724 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "stack.h" #include "frame.h" #include #include #include namespace Valgrind { namespace XmlProtocol { class Stack::Private : public QSharedData { public: Private() : line(-1) , hthreadid(-1) { } QString auxwhat; QString file; QString dir; qint64 line; qint64 hthreadid; QVector frames; }; Stack::Stack() : d(new Private) { } Stack::Stack(const Stack &other) : d(other.d) { } Stack::~Stack() { } void Stack::swap(Stack &other) { qSwap(d, other.d); } void Stack::operator=(const Stack &other) { Stack tmp(other); swap(tmp); } bool Stack::operator==(const Stack &other) const { return d->frames == other.d->frames && d->auxwhat == other.d->auxwhat && d->file == other.d->file && d->dir == other.d->dir && d->line == other.d->line && d->hthreadid == other.d->hthreadid; } QString Stack::auxWhat() const { return d->auxwhat; } void Stack::setAuxWhat(const QString &auxwhat) { d->auxwhat = auxwhat; } QVector Stack::frames() const { return d->frames; } void Stack::setFrames(const QVector &frames) { d->frames = frames; } QString Stack::file() const { return d->file; } void Stack::setFile(const QString &file) { d->file = file; } QString Stack::directory() const { return d->dir; } void Stack::setDirectory(const QString &directory) { d->dir = directory; } qint64 Stack::line() const { return d->line; } void Stack::setLine(qint64 line) { d->line = line; } qint64 Stack::helgrindThreadId() const { return d->hthreadid; } void Stack::setHelgrindThreadId(qint64 id) { d->hthreadid = id; } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/suppression.cpp0000644000015301777760000001171012321547255032177 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "suppression.h" #include #include #include #include #include using namespace Valgrind; using namespace Valgrind::XmlProtocol; class SuppressionFrame::Private : public QSharedData { public: Private() { } QString obj; QString fun; }; SuppressionFrame::SuppressionFrame() : d(new Private) { } SuppressionFrame::SuppressionFrame(const SuppressionFrame &other) : d(other.d) { } SuppressionFrame::~SuppressionFrame() { } void SuppressionFrame::swap(SuppressionFrame &other) { qSwap(d, other.d); } SuppressionFrame &SuppressionFrame::operator=(const SuppressionFrame &other) { SuppressionFrame tmp(other); swap(tmp); return *this; } bool SuppressionFrame::operator==(const SuppressionFrame &other) const { return d->fun == other.d->fun && d->obj == other.d->obj; } QString SuppressionFrame::function() const { return d->fun; } void SuppressionFrame::setFunction(const QString &fun) { d->fun = fun; } QString SuppressionFrame::object() const { return d->obj; } void SuppressionFrame::setObject(const QString &obj) { d->obj = obj; } QString SuppressionFrame::toString() const { if (!d->fun.isEmpty()) return QLatin1String("fun:") + d->fun; else return QLatin1String("obj:") + d->obj; } class Suppression::Private : public QSharedData { public: Private() : isNull(true) { } bool isNull; QString name; QString kind; QString auxkind; QString rawText; SuppressionFrames frames; }; Suppression::Suppression() : d(new Private) { } Suppression::Suppression(const Suppression &other) : d(other.d) { } Suppression::~Suppression() { } void Suppression::swap(Suppression &other) { qSwap(d, other.d); } Suppression &Suppression::operator=(const Suppression &other) { Suppression tmp(other); swap(tmp); return *this; } bool Suppression::operator==(const Suppression &other) const { return d->isNull == other.d->isNull && d->name == other.d->name && d->kind == other.d->kind && d->auxkind == other.d->auxkind && d->rawText == other.d->rawText && d->frames == other.d->frames; } bool Suppression::isNull() const { return d->isNull; } void Suppression::setName(const QString &name) { d->isNull = false; d->name = name; } QString Suppression::name() const { return d->name; } void Suppression::setKind(const QString &kind) { d->isNull = false; d->kind = kind; } QString Suppression::kind() const { return d->kind; } void Suppression::setAuxKind(const QString &auxkind) { d->isNull = false; d->auxkind = auxkind; } QString Suppression::auxKind() const { return d->auxkind; } void Suppression::setRawText(const QString &text) { d->isNull = false; d->rawText = text; } QString Suppression::rawText() const { return d->rawText; } void Suppression::setFrames(const SuppressionFrames &frames) { d->isNull = false; d->frames = frames; } SuppressionFrames Suppression::frames() const { return d->frames; } QString Suppression::toString() const { QString ret; QTextStream stream(&ret); const QLatin1String indent(" "); stream << "{\n"; stream << indent << d->name << '\n'; stream << indent << d->kind << '\n'; foreach (const SuppressionFrame &frame, d->frames) stream << indent << frame.toString() << '\n'; stream << "}\n"; return ret; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/announcethread.cpp0000644000015301777760000000531312321547255032605 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "announcethread.h" #include "frame.h" #include #include #include namespace Valgrind { namespace XmlProtocol { class AnnounceThread::Private : public QSharedData { public: Private() : hThreadId( -1 ) { } qint64 hThreadId; QVector stack; }; AnnounceThread::AnnounceThread() : d(new Private) { } AnnounceThread::AnnounceThread(const AnnounceThread &other) : d(other.d) { } AnnounceThread::~AnnounceThread() { } void AnnounceThread::swap(AnnounceThread &other) { qSwap(d, other.d); } AnnounceThread &AnnounceThread::operator=(const AnnounceThread &other) { AnnounceThread tmp(other); swap(tmp); return *this; } bool AnnounceThread::operator==(const AnnounceThread &other) const { return d->stack == other.d->stack && d->hThreadId == other.d->hThreadId; } qint64 AnnounceThread::helgrindThreadId() const { return d->hThreadId; } void AnnounceThread::setHelgrindThreadId(qint64 id) { d->hThreadId = id; } QVector AnnounceThread::stack() const { return d->stack; } void AnnounceThread::setStack(const QVector &stack) { d->stack = stack; } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/stack.h0000644000015301777760000000505012321547255030357 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRIND_PROTOCOL_STACK_H #define VALGRIND_PROTOCOL_STACK_H #include QT_BEGIN_NAMESPACE template class QVector; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class Frame; class Stack { public: Stack(); Stack(const Stack &other); ~Stack(); void operator=(const Stack &other); void swap(Stack &other); bool operator==(const Stack &other) const; QString auxWhat() const; void setAuxWhat(const QString &auxwhat); QVector frames() const; void setFrames(const QVector &frames); //memcheck, ptrcheck, helgrind: QString file() const; void setFile(const QString &file); QString directory() const; void setDirectory(const QString &directory); qint64 line() const; void setLine(qint64 line); //helgrind: qint64 helgrindThreadId() const; void setHelgrindThreadId(qint64 threadId ); private: class Private; QSharedDataPointer d; }; } // namespace XmlProtocol } // namespace Stack #endif // VALGRIND_PROTOCOL_STACK_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/xmlprotocol/threadedparser.cpp0000644000015301777760000001041312321547255032601 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Andreas Hartmetz, KDAB (andreas.hartmetz@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "threadedparser.h" #include "parser.h" #include "error.h" #include "frame.h" #include "status.h" #include "suppression.h" #include #include #include #include #include namespace { class Thread : public QThread { public: Thread() : parser(0) , device(0) {} void run() { QTC_ASSERT(QThread::currentThread() == this, return); parser->parse(device); delete parser; parser = 0; delete device; device = 0; } Valgrind::XmlProtocol::Parser *parser; QIODevice *device; }; } // namespace anon namespace Valgrind { namespace XmlProtocol { class ThreadedParser::Private { public: Private() {} QPointer parserThread; QString errorString; }; ThreadedParser::ThreadedParser(QObject *parent) : QObject(parent), d(new Private) { } ThreadedParser::~ThreadedParser() { delete d; } QString ThreadedParser::errorString() const { return d->errorString; } bool ThreadedParser::isRunning() const { return d->parserThread ? d->parserThread.data()->isRunning() : 0; } void ThreadedParser::parse(QIODevice *device) { QTC_ASSERT(!d->parserThread, return); Parser *parser = new Parser; qRegisterMetaType(); qRegisterMetaType(); connect(parser, SIGNAL(status(Valgrind::XmlProtocol::Status)), SIGNAL(status(Valgrind::XmlProtocol::Status)), Qt::QueuedConnection); connect(parser, SIGNAL(error(Valgrind::XmlProtocol::Error)), SIGNAL(error(Valgrind::XmlProtocol::Error)), Qt::QueuedConnection); connect(parser, SIGNAL(internalError(QString)), SLOT(slotInternalError(QString)), Qt::QueuedConnection); connect(parser, SIGNAL(errorCount(qint64,qint64)), SIGNAL(errorCount(qint64,qint64)), Qt::QueuedConnection); connect(parser, SIGNAL(suppressionCount(QString,qint64)), SIGNAL(suppressionCount(QString,qint64)), Qt::QueuedConnection); connect(parser, SIGNAL(finished()), SIGNAL(finished()), Qt::QueuedConnection); Thread *thread = new Thread; d->parserThread = thread; connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); device->setParent(0); device->moveToThread(thread); parser->moveToThread(thread); thread->device = device; thread->parser = parser; thread->start(); } void ThreadedParser::slotInternalError(const QString &errorString) { d->errorString = errorString; emit internalError(errorString); } bool ThreadedParser::waitForFinished() { return d->parserThread ? d->parserThread.data()->wait() : true; } } // namespace XmlProtocol } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindplugin.h0000644000015301777760000000435412321547255027723 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRINDPLUGIN_H #define VALGRINDPLUGIN_H #include #include namespace Valgrind { namespace Internal { class ValgrindGlobalSettings; class MemcheckTool; class CallgrindTool; class ValgrindPlugin : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Valgrind.json") public: ValgrindPlugin() {} ~ValgrindPlugin(); bool initialize(const QStringList &arguments, QString *errorString); void extensionsInitialized(); static ValgrindGlobalSettings *globalSettings(); private: MemcheckTool *m_memcheckTool; CallgrindTool *m_callgrindTool; }; } // namespace Internal } // namespace Valgrind #endif // VALGRINDPLUGIN_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/0000755000015301777760000000000012321547742026457 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcycledetection.h0000644000015301777760000000520712321547255033511 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRINDCYCLEDETECTION_H #define LIBVALGRIND_CALLGRINDCYCLEDETECTION_H #include #include namespace Valgrind { namespace Callgrind { class Function; class ParseData; namespace Internal { /** * Implementation of Tarjan's strongly connected components algorithm, to find function cycles, * as suggested by the GProf paper: * * ``gprof: A Call Graph Execution Profiler'', by S. Graham, P. Kessler, * M. McKusick; Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, * SIGPLAN Notices, Vol. 17, No 6, pp. 120-126, June 1982. */ class CycleDetection { public: explicit CycleDetection(ParseData *data); QVector run(const QVector &input); private: ParseData *m_data; struct Node { int dfs; int lowlink; const Function *function; }; void tarjan(Node *node); void tarjanForChildNode(Node *node, Node *childNode); QHash m_nodes; QStack m_stack; QVector m_ret; int m_depth; int m_cycle; }; } // namespace Internal } // namespace Callgrind } // namespace Valgrind #endif // LIBVALGRIND_CALLGRINDCYCLEDETECTION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindparsedata.cpp0000644000015301777760000002360712321547255033016 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindparsedata.h" #include "callgrindfunction.h" #include "callgrindcycledetection.h" #include "callgrindfunctioncycle.h" #include #include #include #include #include namespace Valgrind { namespace Callgrind { //BEGIN ParseData::Private class ParseData::Private { Q_DECLARE_TR_FUNCTIONS(Valgrind::Callgrind::ParseData) public: Private(ParseData *q) : m_pid(0) , m_lineNumberPositionIndex(-1) , m_part(0) , m_version(0) , m_cycleCacheValid(false) , m_q(q) { } ~Private(); QStringList m_events; QStringList m_positions; QVector m_totalCosts; QVector m_functions; QString m_command; quint64 m_pid; int m_lineNumberPositionIndex; uint m_part; int m_version; bool m_cycleCacheValid; QStringList m_descriptions; QString m_creator; QHash > > functionLookup; typedef QHash NameLookupTable; QString stringForCompression(const NameLookupTable &lookup, qint64 id); void addCompressedString(NameLookupTable &lookup, const QString &string, qint64 &id); NameLookupTable m_objectCompression; NameLookupTable m_fileCompression; NameLookupTable m_functionCompression; void cycleDetection(); void cleanupFunctionCycles(); QVector m_cycleCache; ParseData *m_q; }; ParseData::Private::~Private() { cleanupFunctionCycles(); qDeleteAll(m_functions); } void ParseData::Private::cleanupFunctionCycles() { m_cycleCacheValid = false; foreach (const Function *func, m_cycleCache) { if (dynamic_cast(func)) delete func; } m_cycleCache.clear(); } QString ParseData::Private::stringForCompression(const NameLookupTable &lookup, qint64 id) { if (id == -1) { return QString(); } else { QTC_ASSERT(lookup.contains(id), return QString()); return lookup.value(id); } } void ParseData::Private::addCompressedString(NameLookupTable &lookup, const QString &string, qint64 &id) { QTC_ASSERT(!string.isEmpty(), return); if (id == -1) { // for uncompressed files, use a hash of the string id = qHash(string); if (lookup.contains(id)) { QTC_ASSERT(lookup.value(id) == string, return); return; } } QTC_ASSERT(!lookup.contains(id), return); lookup.insert(id, string); } void ParseData::Private::cycleDetection() { if (m_cycleCacheValid) return; cleanupFunctionCycles(); Internal::CycleDetection algorithm(m_q); m_cycleCache = algorithm.run(m_functions); m_cycleCacheValid = true; } //BEGIN ParseData ParseData::ParseData() : d(new Private(this)) { } ParseData::~ParseData() { delete d; } QString ParseData::prettyStringForEvent(const QString &event) { /* From Callgrind documentation, see: http://valgrind.org/docs/manual/cg-manual.html#cg-manual.overview I cache reads (Ir, which equals the number of instructions executed), I1 cache read misses (I1mr) and LL cache instruction read misses (ILmr). D cache reads (Dr, which equals the number of memory reads), D1 cache read misses (D1mr), and LL cache data read misses (DLmr). D cache writes (Dw, which equals the number of memory writes), D1 cache write misses (D1mw), and LL cache data write misses (DLmw). Conditional branches executed (Bc) and conditional branches mispredicted (Bcm). Indirect branches executed (Bi) and indirect branches mispredicted (Bim) */ QTC_ASSERT(event.size() >= 2, return event); // should not happen const bool isMiss = event.contains(QLatin1Char('m')); // else hit const bool isRead = event.contains(QLatin1Char('r')); // else write QString type; if (event.contains(QLatin1Char('L'))) type = ParseData::Private::tr("Last-level"); // first, "L" overwrites the others else if (event.at(0) == QLatin1Char('I')) type = ParseData::Private::tr("Instruction"); else if (event.at(0) == QLatin1Char('D')) type = ParseData::Private::tr("Cache"); else if (event.leftRef(2) == QLatin1String("Bc")) type = ParseData::Private::tr("Conditional branches"); else if (event.leftRef(2) == QLatin1String("Bi")) type = ParseData::Private::tr("Indirect branches"); QStringList prettyString; prettyString << type; if (event.at(1).isNumber()) prettyString << ParseData::Private::tr("level %1").arg(event.at(1)); prettyString << (isRead ? ParseData::Private::tr("read") : ParseData::Private::tr("write")); if (event.at(0) == QLatin1Char('B')) prettyString << (isMiss ? ParseData::Private::tr("mispredicted") : ParseData::Private::tr("executed")); else prettyString << (isMiss ? ParseData::Private::tr("miss") : ParseData::Private::tr("access")); // add original abbreviation prettyString << QLatin1Char('(') + event + QLatin1Char(')'); return prettyString.join(QString(QLatin1Char(' '))); } QStringList ParseData::events() const { return d->m_events; } void ParseData::setEvents(const QStringList &events) { d->m_events = events; d->m_totalCosts.fill(0, d->m_events.size()); } QString ParseData::prettyStringForPosition(const QString &position) { if (position == QLatin1String("line")) return ParseData::Private::tr("Line:"); // as in: "line number" else if (position == QLatin1String("instr")) return ParseData::Private::tr("Instruction"); // as in: "instruction address" return ParseData::Private::tr("Position:"); // never reached, in theory } QStringList ParseData::positions() const { return d->m_positions; } int ParseData::lineNumberPositionIndex() const { return d->m_lineNumberPositionIndex; } void ParseData::setPositions(const QStringList &positions) { d->m_positions = positions; d->m_lineNumberPositionIndex = -1; for (int i = 0; i < positions.size(); ++i) { if (positions.at(i) == QLatin1String("line")) { d->m_lineNumberPositionIndex = i; break; } } } quint64 ParseData::totalCost(uint event) const { return d->m_totalCosts.at(event); } void ParseData::setTotalCost(uint event, quint64 cost) { d->m_totalCosts[event] = cost; } QVector ParseData::functions(bool detectCycles) const { if (detectCycles) { d->cycleDetection(); return d->m_cycleCache; } return d->m_functions; } void ParseData::addFunction(const Function *function) { d->m_cycleCacheValid = false; d->m_functions.append(function); } QString ParseData::command() const { return d->m_command; } void ParseData::setCommand(const QString &command) { d->m_command = command; } quint64 ParseData::pid() const { return d->m_pid; } void ParseData::setPid(quint64 pid) { d->m_pid = pid; } uint ParseData::part() const { return d->m_part; } void ParseData::setPart(uint part) const { d->m_part = part; } QStringList ParseData::descriptions() const { return d->m_descriptions; } void ParseData::addDescription(const QString &description) { d->m_descriptions.append(description); } void ParseData::setDescriptions(const QStringList &descriptions) { d->m_descriptions = descriptions; } int ParseData::version() const { return d->m_version; } void ParseData::setVersion(int version) { d->m_version = version; } QString ParseData::creator() const { return d->m_creator; } void ParseData::setCreator(const QString &creator) { d->m_creator = creator; } QString ParseData::stringForObjectCompression(qint64 id) const { return d->stringForCompression(d->m_objectCompression, id); } void ParseData::addCompressedObject(const QString &object, qint64 &id) { d->addCompressedString(d->m_objectCompression, object, id); } QString ParseData::stringForFileCompression(qint64 id) const { return d->stringForCompression(d->m_fileCompression, id); } void ParseData::addCompressedFile(const QString &file, qint64 &id) { d->addCompressedString(d->m_fileCompression, file, id); } QString ParseData::stringForFunctionCompression(qint64 id) const { return d->stringForCompression(d->m_functionCompression, id); } void ParseData::addCompressedFunction(const QString &function, qint64 &id) { d->addCompressedString(d->m_functionCompression, function, id); } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunctioncall.h0000644000015301777760000000543612321547255033200 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDFUNCTIONCALL_H #define CALLGRINDFUNCTIONCALL_H #include QT_BEGIN_NAMESPACE template class QVector; QT_END_NAMESPACE namespace Valgrind { namespace Callgrind { class Function; /** * This represents a function call. */ class FunctionCall { public: explicit FunctionCall(); ~FunctionCall(); /// the called function const Function *callee() const; void setCallee(const Function *function); /// the calling function const Function *caller() const; void setCaller(const Function *function); /// how often the function was called quint64 calls() const; void setCalls(quint64 calls); /** * Destination position data for the given position-index @p posIdx * @see ParseData::positions() */ quint64 destination(int posIdx) const; QVector destinations() const; void setDestinations(const QVector &destinations); /** * Inclusive cost of the function call. * @see ParseData::events() */ quint64 cost(int event) const; QVector costs() const; void setCosts(const QVector &costs); private: Q_DISABLE_COPY(FunctionCall); class Private; Private *d; }; } // namespace Callgrind } // namespace Valgrind Q_DECLARE_METATYPE(const Valgrind::Callgrind::FunctionCall *); #endif // CALLGRINDFUNCTIONCALL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindrunner.cpp0000644000015301777760000000743212321547255032361 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindrunner.h" #include "callgrindparser.h" #include #include namespace Valgrind { namespace Callgrind { CallgrindRunner::CallgrindRunner(QObject *parent) : ValgrindRunner(parent) , m_controller(new CallgrindController(this)) , m_parser(new Parser(this)) , m_paused(false) { connect(m_controller, SIGNAL(finished(Valgrind::Callgrind::CallgrindController::Option)), SLOT(controllerFinished(Valgrind::Callgrind::CallgrindController::Option))); connect(m_controller, SIGNAL(localParseDataAvailable(QString)), this, SLOT(localParseDataAvailable(QString))); connect(m_controller, SIGNAL(statusMessage(QString)), this, SIGNAL(statusMessage(QString))); } QString CallgrindRunner::tool() const { return QLatin1String("callgrind"); } Parser *CallgrindRunner::parser() const { return m_parser; } CallgrindController *CallgrindRunner::controller() const { return m_controller; } bool CallgrindRunner::start() { ValgrindRunner::start(); m_controller->setValgrindProcess(valgrindProcess()); return true; } void CallgrindRunner::processFinished(int ret, QProcess::ExitStatus status) { triggerParse(); m_controller->setValgrindProcess(0); ValgrindRunner::processFinished(ret, status); // call base class function } bool CallgrindRunner::isPaused() const { return m_paused; } void CallgrindRunner::triggerParse() { m_controller->getLocalDataFile(); } void CallgrindRunner::localParseDataAvailable(const QString &file) { // parse the callgrind file QTC_ASSERT(!file.isEmpty(), return); QFile outputFile(file); QTC_ASSERT(outputFile.exists(), return); if (outputFile.open(QIODevice::ReadOnly)) { emit statusMessage(tr("Parsing Profile Data...")); m_parser->parse(&outputFile); } else { qWarning() << "Could not open file for parsing:" << outputFile.fileName(); } } void CallgrindRunner::controllerFinished(CallgrindController::Option option) { switch (option) { case CallgrindController::Pause: m_paused = true; break; case CallgrindController::UnPause: m_paused = false; break; case CallgrindController::Dump: triggerParse(); break; default: break; // do nothing } } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunction_p.h0000644000015301777760000000526312321547255032661 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRINDFUNCTION_P_H #define LIBVALGRIND_CALLGRINDFUNCTION_P_H #include "callgrindfunction.h" #include "callgrindparsedata.h" #include "callgrindcostitem.h" #include "callgrindfunctioncall.h" #include #include namespace Valgrind { namespace Callgrind { class Function::Private { public: Private(const ParseData *data); ~Private(); static void accumulateCost(QVector &base, const QVector &add); enum CallType { Incoming, Outgoing }; ///@return accumulated call FunctionCall *accumulateCall(const FunctionCall *call, CallType type); const ParseData *m_data; qint64 m_fileId; qint64 m_objectId; qint64 m_nameId; QVector m_selfCost; QVector m_inclusiveCost; QVector m_costItems; // used to accumulate, hence values not const QHash m_outgoingCallMap; QHash m_incomingCallMap; // used in public api, hence const QVector m_outgoingCalls; QVector m_incomingCalls; quint64 m_called; }; } // namespace Callgrind } // namespace Valgrind #endif // LIBVALGRIND_CALLGRINDFUNCTION_P_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindparser.cpp0000644000015301777760000005107512321547255032346 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindparser.h" #include "callgrindparsedata.h" #include "callgrindfunctioncall.h" #include "callgrindcostitem.h" #include "callgrindfunction.h" #include #include #include #include #include // #define DEBUG_PARSER namespace { static void skipSpace(const char **current, const char *end) { const char *b = *current; while (b < end) { if (*b == ' ' || *b == '\t') b++; else break; } *current = b; } // set *ok to true if at least one digit was parsed; "garbage" after the number is not considered // an error. // *current is moved to one char after the last digit static qint64 parseDecimal(const char **current, const char *end, bool *ok) { const char *b = *current; bool parsedDigit = false; qint64 ret = 0; while (b < end) { const char c = *b; if (c >= '0' && c <= '9') { b++; ret *= 10; ret += c - '0'; parsedDigit = true; } else { break; } } *ok = parsedDigit; *current = b; return ret; } //like parseDecimal, but for 0xabcd-style hex encoding (without the leading 0x) static qint64 parseHex(const char **current, const char *end, bool *ok) { const char *b = *current; bool parsedDigit = false; qint64 ret = 0; while (b < end) { char c = *b; if (c >= '0' && c <= '9') c &= 0x0f; else if (c >= 'a' && c <= 'f') c = c - 'a' + 10; else break; b++; ret <<= 4; ret += c; parsedDigit = true; } *ok = parsedDigit; *current = b; return ret; } static quint64 parseAddr(const char **current, const char *end, bool *ok) { if (**current == '0' && *(*current + 1) == 'x') { *current += 2; return parseHex(current, end, ok); } else { return parseDecimal(current, end, ok); } } // this function expects that *current already points one past the opening parenthesis static int parseNameShorthand(const char **current, const char *end) { bool ok; int ret = parseDecimal(current, end, &ok); if (ok) { if (**current == ')') { (*current)++; return ret; } } return -1; // invalid } } namespace Valgrind { namespace Callgrind { class Parser::Private { Parser *const q; public: explicit Private(Parser *qq) : q(qq), addressValuesCount(0), costValuesCount(0), data(0), currentFunction(0), lastObject(-1), lastFile(-1), currentDifferingFile(-1), isParsingFunctionCall(false), callsCount(0) { } ~Private() { delete data; } void parse(QIODevice *device); void parseHeader(QIODevice *device); typedef QPair NamePair; NamePair parseName(const char *begin, const char *end); void dispatchLine(const QByteArray &line); void parseCostItem(const char *begin, const char *end); void parseFunction(const char *begin, const char *end); void parseSourceFile(const char *begin, const char *end); void parseDifferingSourceFile(const char *begin, const char *end); void parseObjectFile(const char *begin, const char *end); void parseCalls(const char *begin, const char *end); void parseCalledFunction(const char *begin, const char *end); void parseCalledSourceFile(const char *begin, const char *end); void parseCalledObjectFile(const char *begin, const char *end); int addressValuesCount; int costValuesCount; ParseData *data; Function *currentFunction; qint64 lastObject; qint64 lastFile; qint64 currentDifferingFile; bool isParsingFunctionCall; quint64 callsCount; struct CallData { CallData() : calledFunction(-1) , calledObject(-1) , calledFile(-1) , call(0) { } qint64 calledFunction; qint64 calledObject; qint64 calledFile; FunctionCall *call; }; CallData currentCallData; QVector callDestinations; // we can only resolve callees after parsing the whole file so save that data here for now QVector pendingCallees; // id(s) for the ??? file QVector unknownFiles; // functions which call themselves QSet recursiveFunctions; }; void Parser::Private::parse(QIODevice *device) { // be sure to clean up existing data before re-allocating // the callee might not have taken the parse data delete data; data = 0; data = new ParseData; parseHeader(device); while (!device->atEnd()) { QByteArray line = device->readLine(); // empty lines actually have no meaning - only fn= starts a new function if (line.length() > 1) dispatchLine(line); } // build fast lookup of functions by their nameId QHash > functionLookup; foreach (const Function *function, data->functions()) { functionLookup[function->nameId()].append(function); } // functions that need to accumulate their calees QSet pendingFunctions; foreach (const CallData &callData, pendingCallees) { Function *calledFunction = 0; QTC_ASSERT(callData.call, continue); QTC_ASSERT(callData.call->caller(), continue); foreach (const Function *function, functionLookup.value(callData.calledFunction)) { QTC_ASSERT(function->nameId() == callData.calledFunction, continue); if (function->objectId() == callData.calledObject && function->fileId() == callData.calledFile) { calledFunction = const_cast(function); break; } } #ifdef DEBUG_PARSER if (!calledFunction) { qDebug() << unknownFiles; qDebug() << "could not find called function:" << data->stringForFunctionCompression(callData.calledFunction) << callData.calledFunction; qDebug() << "caller is:" << callData.call->caller()->name() << callData.call->caller()->nameId(); qDebug() << "called file:" << callData.calledFile << "object:" << callData.calledObject; qDebug() << data->stringForFileCompression(callData.calledFile) << data->stringForObjectCompression(callData.calledObject); foreach (const Function *function, functionLookup.value(callData.calledFunction)) { qDebug() << "available function file:" << function->fileId() << function->file() << "object:" << function->objectId() << function->object(); } } #endif QTC_ASSERT(calledFunction, continue); callData.call->setCallee(calledFunction); calledFunction->addIncomingCall(callData.call); Function *caller = const_cast(callData.call->caller()); caller->addOutgoingCall(callData.call); pendingFunctions.insert(caller); } pendingCallees.clear(); // lookup done // now accumulate callees foreach (Function *func, pendingFunctions) func->finalize(); q->parserDataReady(); // emit } inline QString getValue(const QByteArray &line, const int prefixLength) { // we are not interested in the trailing newline // TODO: \r\n ? return QString::fromLatin1(line.mid(prefixLength, line.length() - 1 - prefixLength).constData()); } void Parser::Private::parseHeader(QIODevice *device) { QTC_ASSERT(device->isOpen(), return); QTC_ASSERT(device->isReadable(), return); // parse expected headers until we hit the first non-empty line while (!device->atEnd()) { QByteArray line = device->readLine(); // now that we're done checking if we're done (heh) with the header, parse the address // and cost column descriptions. speed is unimportant here. if (line.startsWith("positions: ")) { QString values = getValue(line, 11); data->setPositions(values.split(QLatin1Char(' '), QString::SkipEmptyParts)); addressValuesCount = data->positions().count(); } else if (line.startsWith("events: ")) { QString values = getValue(line, 8); data->setEvents(values.split(QLatin1Char(' '), QString::SkipEmptyParts)); costValuesCount = data->events().count(); } else if (line.startsWith("version: ")) { QString value = getValue(line, 9); data->setVersion(value.toInt()); } else if (line.startsWith("creator: ")) { QString value = getValue(line, 9); data->setCreator(value); } else if (line.startsWith("pid: ")) { QString value = getValue(line, 5); data->setPid(value.toULongLong()); } else if (line.startsWith("cmd: ")) { QString value = getValue(line, 5); data->setCommand(value); } else if (line.startsWith("part: ")) { QString value = getValue(line, 6); data->setPart(value.toUInt()); } else if (line.startsWith("desc: ")) { QString value = getValue(line, 6); data->addDescription(value); } else if (line.startsWith("summary: ")) { QString values = getValue(line, 9); uint i = 0; foreach (const QString &value, values.split(QLatin1Char(' '), QString::SkipEmptyParts)) data->setTotalCost(i++, value.toULongLong()); } else if (!line.trimmed().isEmpty()) { // handle line and exit parseHeader dispatchLine(line); return; } } } Parser::Private::NamePair Parser::Private::parseName(const char *begin, const char *end) { const char *current = begin; qint64 nameShorthand = -1; if (*current == '(') { current++; if ((nameShorthand = parseNameShorthand(¤t, end)) == -1) return qMakePair(qint64(-1), QString()); // error } skipSpace(¤t, end); return qMakePair(nameShorthand, QString::fromUtf8(QByteArray(current, end - current))); } /* * fl means source file * ob means object file * fn means function * fe, fi means different source file * cfi or cfl means called source file * cob means called object file * cfn means called function */ void Parser::Private::dispatchLine(const QByteArray &line) { const char *const begin = line.constData(); const char *const end = begin + line.length() - 1; // we're not interested in the '\n' const char *current = begin; // shortest possible line is "1 1" - a cost item line QTC_ASSERT(end - begin >= 3, return); const char first = *begin; if ((first >= '0' && first <= '9') || first == '+' || first == '*' || first =='-') { parseCostItem(begin, end); if (isParsingFunctionCall) isParsingFunctionCall = false; return; } QTC_ASSERT(!isParsingFunctionCall, return); current++; const char second = *current++; const char third = *current++; // current now points to the fourth char... if (first == 'c') { // information about a callee const char fourth = *current++; // current now points to the fifth char... switch (second) { // comments show the shortest possible line for every case case 'a': { // "calls=1 1", length 9 QTC_ASSERT(end - begin >= 9, return); const char fifth = *current++; const char sixth = *current++; if (third == 'l' && fourth == 'l' && fifth == 's' && sixth == '=') parseCalls(current, end); break; } case 'f': QTC_ASSERT(end - begin >= 5, return); // "cfi=a" / "cfl=a", length 5 // "cfn=a", length 5 if (fourth == '=') { if (third == 'i' || third == 'l') parseCalledSourceFile(current, end); else if (third == 'n') parseCalledFunction(current, end); } break; case 'o': QTC_ASSERT(end - begin >= 5, return); // "cob=a", length 5 if (third == 'b' && fourth == '=') parseCalledObjectFile(current, end); break; default: break; } } else { // information about this function // shortest possible line is always four chars here, of the type "fl=a" QTC_ASSERT(end - begin >= 4, return); if (third == '=') { if (first == 'f') { if (second == 'l') parseSourceFile(current, end); else if (second == 'n') parseFunction(current, end); else if (second == 'i' || second == 'e') parseDifferingSourceFile(current, end); } else if (first == 'o' && second == 'b') { parseObjectFile(current, end); } } } } void Parser::Private::parseCostItem(const char *begin, const char *end) { QTC_ASSERT(currentFunction, return); bool ok; const char *current = begin; CostItem *costItem = new CostItem(data); QTC_ASSERT(currentDifferingFile == -1 || currentDifferingFile != currentFunction->fileId(), return); costItem->setDifferingFile(currentDifferingFile); FunctionCall *call = 0; if (isParsingFunctionCall) { call = new FunctionCall; call->setCaller(currentFunction); currentCallData.call = call; costItem->setCall(call); call->setCalls(callsCount); callsCount = 0; call->setDestinations(callDestinations); callDestinations.clear(); if (currentCallData.calledFile == -1) { currentCallData.calledFile = currentDifferingFile != -1 ? currentDifferingFile : lastFile; //HACK: workaround issue where sometimes fi=??? lines are prepended to function calls if (unknownFiles.contains(currentCallData.calledFile)) currentCallData.calledFile = lastFile; } if (currentCallData.calledObject == -1) currentCallData.calledObject = lastObject; if (currentCallData.calledFunction == currentFunction->nameId() && currentCallData.calledFile == currentFunction->fileId() && currentCallData.calledObject == currentFunction->objectId() ) { // recursive call, recursiveFunctions << currentFunction; } pendingCallees.append(currentCallData); currentCallData = CallData(); } const CostItem *lastCostItem = 0; if (!currentFunction->costItems().isEmpty()) lastCostItem = currentFunction->costItems().last(); // parse positions ("where") for (int i = 0; i < addressValuesCount; ++i) { char c = *current; // TODO overflow checks quint64 position = 0; if (c == '*') { // leave the old value unchanged current++; QTC_ASSERT(lastCostItem, continue); position = lastCostItem->position(i); } else { if (c == '+' || c == '-') current++; quint64 addr = parseAddr(¤t, end, &ok); if (!ok) break; /// TODO: error reporting if (c == '+') { QTC_ASSERT(lastCostItem, continue); position = lastCostItem->position(i) + addr; } else if (c == '-') { QTC_ASSERT(lastCostItem, continue); position = lastCostItem->position(i) - addr; } else position = addr; } costItem->setPosition(i, position); skipSpace(¤t, end); } // parse events ("what") for (int i = 0; i < costValuesCount; ++i) { quint64 parsedCost = parseDecimal(¤t, end, &ok); if (!ok) break; /// TODO: error reporting costItem->setCost(i, parsedCost); skipSpace(¤t, end); } if (call) call->setCosts(costItem->costs()); currentFunction->addCostItem(costItem); } void Parser::Private::parseSourceFile(const char *begin, const char *end) { NamePair name = parseName(begin, end); if (!name.second.isEmpty()) { data->addCompressedFile(name.second, name.first); if (name.second == QLatin1String("???")) unknownFiles << name.first; } lastFile = name.first; currentDifferingFile = -1; } void Parser::Private::parseFunction(const char *begin, const char *end) { currentFunction = new Function(data); currentFunction->setFile(lastFile); currentFunction->setObject(lastObject); data->addFunction(currentFunction); NamePair name = parseName(begin, end); if (!name.second.isEmpty()) data->addCompressedFunction(name.second, name.first); currentFunction->setName(name.first); } void Parser::Private::parseDifferingSourceFile(const char *begin, const char *end) { NamePair name = parseName(begin, end); if (!name.second.isEmpty()) { data->addCompressedFile(name.second, name.first); if (name.second == QLatin1String("???")) unknownFiles << name.first; } if (name.first == currentFunction->fileId()) currentDifferingFile = -1; else currentDifferingFile = name.first; } void Parser::Private::parseObjectFile(const char *begin, const char *end) { NamePair name = parseName(begin, end); if (!name.second.isEmpty()) data->addCompressedObject(name.second, name.first); lastObject = name.first; } void Parser::Private::parseCalls(const char *begin, const char *end) { const char *current = begin; bool ok; callsCount = parseDecimal(¤t, end, &ok); skipSpace(¤t, end); callDestinations.fill(0, addressValuesCount); for (int i = 0; i < addressValuesCount; ++i) { callDestinations[i] = parseAddr(¤t, end, &ok); if (!ok) break; // TODO error handling? skipSpace(¤t, end); } isParsingFunctionCall = true; } void Parser::Private::parseCalledFunction(const char *begin, const char *end) { NamePair name = parseName(begin, end); if (!name.second.isEmpty()) data->addCompressedFunction(name.second, name.first); currentCallData.calledFunction = name.first; } void Parser::Private::parseCalledSourceFile(const char *begin, const char *end) { NamePair name = parseName(begin, end); if (!name.second.isEmpty()) { data->addCompressedFile(name.second, name.first); if (name.second == QLatin1String("???")) unknownFiles << name.first; } currentCallData.calledFile = name.first; } void Parser::Private::parseCalledObjectFile(const char *begin, const char *end) { NamePair name = parseName(begin, end); if (!name.second.isEmpty()) data->addCompressedObject(name.second, name.first); currentCallData.calledObject = name.first; } //BEGIN Parser void Parser::parse(QIODevice *device) { d->parse(device); } Parser::Parser(QObject *parent) : QObject(parent), d(new Private(this)) { } Parser::~Parser() { delete d; } ParseData *Parser::takeData() { ParseData *data = d->data; d->data = 0; return data; } } //Callgrind } //Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunctioncall.cpp0000644000015301777760000000627612321547255033536 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindfunctioncall.h" #include "callgrindfunction.h" #include #include namespace Valgrind { namespace Callgrind { //BEGIN FunctionCall::Private class FunctionCall::Private { public: explicit Private(); const Function *m_callee; const Function *m_caller; quint64 m_calls; quint64 m_totalInclusiveCost; QVector m_destinations; QVector m_costs; }; FunctionCall::Private::Private() : m_callee(0) , m_caller(0) , m_calls(0) , m_totalInclusiveCost(0) { } //BEGIN FunctionCall FunctionCall::FunctionCall() : d(new Private) { } FunctionCall::~FunctionCall() { delete d; } const Function *FunctionCall::callee() const { return d->m_callee; } void FunctionCall::setCallee(const Function *function) { d->m_callee = function; } const Function *FunctionCall::caller() const { return d->m_caller; } void FunctionCall::setCaller(const Function *function) { d->m_caller = function; } quint64 FunctionCall::calls() const { return d->m_calls; } void FunctionCall::setCalls(quint64 calls) { d->m_calls = calls; } quint64 FunctionCall::destination(int posIdx) const { return d->m_destinations.at(posIdx); } QVector FunctionCall::destinations() const { return d->m_destinations; } void FunctionCall::setDestinations(const QVector &destinations) { d->m_destinations = destinations; } quint64 FunctionCall::cost(int event) const { QTC_ASSERT(event >= 0 && event < d->m_costs.size(), return 0); return d->m_costs.at(event); } QVector FunctionCall::costs() const { return d->m_costs; } void FunctionCall::setCosts(const QVector &costs) { d->m_costs = costs; } } // namespace Callgrind } // namespace Valgrind ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcycledetection.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcycledetection.c0000644000015301777760000000741012321547255033502 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindcycledetection.h" #include "callgrindfunction.h" #include "callgrindfunctioncall.h" #include "callgrindparsedata.h" #include "callgrindfunctioncycle.h" #include #include namespace Valgrind { namespace Callgrind { namespace Internal { CycleDetection::CycleDetection(ParseData *data) : m_data(data) , m_depth(0) , m_cycle(0) { } QVector CycleDetection::run(const QVector &input) { foreach (const Function *function, input) { Node *node = new Node; node->function = function; node->dfs = -1; node->lowlink = -1; m_nodes.insert(function, node); } foreach (Node *node, m_nodes) { if (node->dfs == -1) tarjan(node); } qDeleteAll(m_nodes); return m_ret; } void CycleDetection::tarjan(Node *node) { QTC_ASSERT(node->dfs == -1, return); node->dfs = m_depth; node->lowlink = m_depth; m_depth++; m_stack.push(node); foreach (const FunctionCall *call, node->function->outgoingCalls()) tarjanForChildNode(node, m_nodes.value(call->callee())); if (node->dfs == node->lowlink) { QVector functions; Node *n; do { n = m_stack.pop(); functions << n->function; } while (n != node); if (functions.size() == 1) { // not a real cycle m_ret.append(node->function); } else { // actual cycle FunctionCycle *cycle = new FunctionCycle(m_data); cycle->setFile(node->function->fileId()); m_cycle++; qint64 id = -1; m_data->addCompressedFunction(QString::fromLatin1("cycle %1").arg(m_cycle), id); cycle->setName(id); cycle->setObject(node->function->objectId()); cycle->setFunctions(functions); m_ret.append(cycle); } } } void CycleDetection::tarjanForChildNode(Node *node, Node *childNode) { if (childNode->dfs == -1) { tarjan(childNode); if (childNode->lowlink < node->lowlink) node->lowlink = childNode->lowlink; } else if (childNode->dfs < node->lowlink && m_stack.contains(childNode)) { node->lowlink = childNode->dfs; } } } // namespace Internal } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcontroller.h0000644000015301777760000000655412321547255032704 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDCONTROLLER_H #define CALLGRINDCONTROLLER_H #include #include #include #include #include namespace Valgrind { class ValgrindProcess; namespace Callgrind { class CallgrindController : public QObject { Q_OBJECT Q_ENUMS(Option) public: enum Option { Unknown, Dump, ResetEventCounters, Pause, UnPause }; explicit CallgrindController(QObject *parent = 0); virtual ~CallgrindController(); void run(Valgrind::Callgrind::CallgrindController::Option option); void setValgrindProcess(ValgrindProcess *process); ValgrindProcess *valgrindProcess() { return m_valgrindProc; } /** * Make data file available locally, triggers @c localParseDataAvailable. * * If the valgrind process was run remotely, this transparently * downloads the data file first and returns a local path. */ void getLocalDataFile(); Q_SIGNALS: void finished(Valgrind::Callgrind::CallgrindController::Option option); void localParseDataAvailable(const QString &file); void statusMessage(const QString &msg); private Q_SLOTS: void processError(QProcess::ProcessError); void processFinished(int, QProcess::ExitStatus); void foundRemoteFile(); void sftpInitialized(); void sftpJobFinished(QSsh::SftpJobId job, const QString &error); private: void cleanupTempFile(); // callgrind_control process Valgrind::ValgrindProcess *m_process; // valgrind process Valgrind::ValgrindProcess *m_valgrindProc; Option m_lastOption; // remote callgrind support QSsh::SshConnection *m_ssh; QString m_tempDataFile; QSsh::SshRemoteProcess::Ptr m_findRemoteFile; QSsh::SftpChannel::Ptr m_sftp; QSsh::SftpJobId m_downloadJob; QByteArray m_remoteFile; }; } // namespace Callgrind } // namespace Valgrind #endif // CALLGRINDCONTROLLER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrind.pri0000644000015301777760000000176412321547255031141 0ustar pbusernogroup00000000000000QT *= network HEADERS += \ $$PWD/callgrindparser.h \ $$PWD/callgrindparsedata.h \ $$PWD/callgrindfunction.h \ $$PWD/callgrindfunction_p.h \ $$PWD/callgrindfunctioncycle.h \ $$PWD/callgrindfunctioncall.h \ $$PWD/callgrindcostitem.h \ $$PWD/callgrinddatamodel.h \ $$PWD/callgrindabstractmodel.h \ $$PWD/callgrindcallmodel.h \ $$PWD/callgrindcontroller.h \ $$PWD/callgrindcycledetection.h \ $$PWD/callgrindproxymodel.h \ $$PWD/callgrindstackbrowser.h \ $$PWD/callgrindrunner.h SOURCES += \ $$PWD/callgrindparser.cpp \ $$PWD/callgrindparsedata.cpp \ $$PWD/callgrindfunction.cpp \ $$PWD/callgrindfunctioncycle.cpp \ $$PWD/callgrindfunctioncall.cpp \ $$PWD/callgrindcostitem.cpp \ $$PWD/callgrinddatamodel.cpp \ $$PWD/callgrindcallmodel.cpp \ $$PWD/callgrindcontroller.cpp \ $$PWD/callgrindcycledetection.cpp \ $$PWD/callgrindproxymodel.cpp \ $$PWD/callgrindrunner.cpp \ $$PWD/callgrindstackbrowser.cpp qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindstackbrowser.h0000644000015301777760000000424112321547255033221 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDSTACKBROWSER_H #define CALLGRINDSTACKBROWSER_H #include #include namespace Valgrind { namespace Callgrind { class Function; class StackBrowser : public QObject { Q_OBJECT public: explicit StackBrowser(QObject *parent = 0); void select(const Function *item); const Function *current() const; void clear(); bool hasPrevious() const { return !m_stack.isEmpty(); } bool hasNext() const { return !m_redoStack.isEmpty(); } public slots: void goBack(); void goNext(); signals: void currentChanged(); private: QStack m_stack; QStack m_redoStack; }; } // namespace Callgrind } // namespace Valgrind #endif // CALLGRINDSTACKBROWSER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcallmodel.h0000644000015301777760000000631412321547255032447 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H #define VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H #include #include "callgrindabstractmodel.h" namespace Valgrind { namespace Callgrind { class FunctionCall; class Function; /** * Model to display list of function calls. */ class CallModel : public QAbstractItemModel { Q_OBJECT public: explicit CallModel(QObject *parent); virtual ~CallModel(); void clear(); /// Only one cost event column will be shown, this decides which one it is. /// By default it is the first event in the @c ParseData, i.e. 0. virtual int costEvent() const; virtual void setCostEvent(int event); virtual void setParseData(const ParseData *data); virtual const ParseData *parseData() const; void setCalls(const QVector &calls, const Function *function); QVector calls() const; const Function *function() const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex parent(const QModelIndex &child) const; virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; enum Columns { CallerColumn, CalleeColumn, CallsColumn, CostColumn, ColumnCount }; enum Roles { FunctionCallRole = NextCustomRole }; private: class Private; Private *d; }; } // namespace Callgrind } // namespace Valgrind #endif // VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindstackbrowser.cpp0000644000015301777760000000445112321547255033557 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindstackbrowser.h" namespace Valgrind { namespace Callgrind { StackBrowser::StackBrowser(QObject *parent) : QObject(parent) { } void StackBrowser::clear() { m_stack.clear(); m_redoStack.clear(); emit currentChanged(); } void StackBrowser::select(const Function *item) { if (!m_stack.isEmpty() && m_stack.top() == item) return; m_stack.push(item); m_redoStack.clear(); emit currentChanged(); } const Function *StackBrowser::current() const { return m_stack.isEmpty() ? 0 : m_stack.top(); } void StackBrowser::goBack() { if (m_stack.isEmpty()) return; m_redoStack.push(m_stack.pop()); emit currentChanged(); } void StackBrowser::goNext() { if (m_redoStack.isEmpty()) return; m_stack.push(m_redoStack.pop()); emit currentChanged(); } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrinddatamodel.h0000644000015301777760000000700112321547255032437 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H #define VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H #include "callgrindabstractmodel.h" #include namespace Valgrind { namespace Callgrind { class Function; class ParseData; class DataModel : public QAbstractItemModel { Q_OBJECT public: explicit DataModel(QObject *parent); virtual ~DataModel(); virtual void setParseData(const ParseData *data); virtual const ParseData *parseData() const; void setVerboseToolTipsEnabled(bool enabled); bool verboseToolTipsEnabled() const; /// Only one cost event column will be shown, this decides which one it is. /// By default it is the first event in the @c ParseData, i.e. 0. virtual int costEvent() const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex parent(const QModelIndex &child) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QModelIndex indexForObject(const Function *function) const; enum Columns { NameColumn, LocationColumn, CalledColumn, SelfCostColumn, InclusiveCostColumn, ColumnCount }; enum Roles { FunctionRole = NextCustomRole, LineNumberRole, FileNameRole }; public slots: /// enable/disable cycle detection void enableCycleDetection(bool enabled); void setShortenTemplates(bool enabled); /// Only one cost event column will be shown, this decides which one it is. /// By default it is the first event in the @c ParseData, i.e. 0. virtual void setCostEvent(int event); private: class Private; Private *d; }; } // namespace Callgrind } // namespace Valgrind #endif // VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrinddatamodel.cpp0000644000015301777760000002741512321547255033005 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrinddatamodel.h" #include "callgrindparsedata.h" #include "callgrindfunction.h" #include "callgrindcostitem.h" #include #include #include #include #include #include namespace Valgrind { namespace Callgrind { //BEGIN DataModel::Private class DataModel::Private { public: Private() : m_data(0) , m_event(0) , m_verboseToolTips(true) , m_cycleDetection(false) , m_shortenTemplates(false) { } void updateFunctions(); const ParseData *m_data; int m_event; bool m_verboseToolTips; bool m_cycleDetection; bool m_shortenTemplates; QVector m_functions; }; struct SortFunctions { SortFunctions(int event) : m_event(event) { } bool operator()(const Function *left, const Function *right) { return left->inclusiveCost(m_event) > right->inclusiveCost(m_event); } int m_event; }; void DataModel::Private::updateFunctions() { if (m_data) { m_functions = m_data->functions(m_cycleDetection); qSort(m_functions.begin(), m_functions.end(), SortFunctions(m_event)); } else { m_functions.clear(); } } //BEGIN DataModel DataModel::DataModel(QObject *parent) : QAbstractItemModel(parent), d(new Private) { } DataModel::~DataModel() { delete d; } void DataModel::setParseData(const ParseData *data) { if (d->m_data == data) return; beginResetModel(); d->m_data = data; d->m_event = 0; d->updateFunctions(); endResetModel(); } void DataModel::setVerboseToolTipsEnabled(bool enabled) { d->m_verboseToolTips = enabled; } bool DataModel::verboseToolTipsEnabled() const { return d->m_verboseToolTips; } const ParseData *DataModel::parseData() const { return d->m_data; } void DataModel::setCostEvent(int event) { if (!d->m_data) return; QTC_ASSERT(event >= 0 && d->m_data->events().size() > event, return); beginResetModel(); d->m_event = event; d->updateFunctions(); endResetModel(); emit dataChanged(index(0, SelfCostColumn), index(qMax(0, rowCount() - 1), InclusiveCostColumn)); } int DataModel::costEvent() const { return d->m_event; } int DataModel::rowCount(const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0); if (!d->m_data || parent.isValid()) return 0; return d->m_functions.size(); } int DataModel::columnCount(const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0); if (parent.isValid()) return 0; return ColumnCount; } QModelIndex DataModel::index(int row, int column, const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return QModelIndex()); if (row == 0 && rowCount(parent) == 0) // happens with empty models return QModelIndex(); QTC_ASSERT(row >= 0 && row < rowCount(parent), return QModelIndex()); return createIndex(row, column); } QModelIndex DataModel::parent(const QModelIndex &child) const { QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex()); return QModelIndex(); } QModelIndex DataModel::indexForObject(const Function *function) const { if (!function) return QModelIndex(); const int row = d->m_functions.indexOf(function); if (row < 0) return QModelIndex(); return createIndex(row, 0); } /** * Evil workaround for https://bugreports.qt-project.org/browse/QTBUG-1135 * Just replace the bad hyphens by a 'NON-BREAKING HYPHEN' unicode char */ static QString noWrap(const QString &str) { QString escapedStr = str; return escapedStr.replace(QLatin1Char('-'), QLatin1String("‑")); } static QString shortenTemplate(QString str) { int depth = 0; int j = 0; for (int i = 0, n = str.size(); i != n; ++i) { int c = str.at(i).unicode(); if (c == '>') --depth; if (depth == 0) str[j++] = str.at(i); if (c == '<') ++depth; } str.truncate(j); return str; } QVariant DataModel::data(const QModelIndex &index, int role) const { //QTC_ASSERT(index.isValid() && index.model() == this, return QVariant()); //QTC_ASSERT(index.column() >= 0 && index.column() < columnCount(index.parent()), return QVariant()); //QTC_ASSERT(index.row() >= 0 && index.row() < rowCount(index.parent()), return QVariant()); const Function *func = d->m_functions.at(index.row()); if (role == Qt::DisplayRole) { if (index.column() == NameColumn) return d->m_shortenTemplates ? shortenTemplate(func->name()) : func->name(); if (index.column() == LocationColumn) return func->location(); if (index.column() == CalledColumn) return func->called(); if (index.column() == SelfCostColumn) return func->selfCost(d->m_event); if (index.column() == InclusiveCostColumn) return func->inclusiveCost(d->m_event); return QVariant(); } if (role == Qt::ToolTipRole) { if (!d->m_verboseToolTips) return data(index, Qt::DisplayRole); QString ret = QLatin1String("\n
"); QString entry = QLatin1String("
%1
%2
\n"); // body, function info first ret += entry.arg(tr("Function:")).arg(Qt::escape(func->name())); ret += entry.arg(tr("File:")).arg(func->file()); if (!func->costItems().isEmpty()) { const CostItem *firstItem = func->costItems().first(); for (int i = 0; i < d->m_data->positions().size(); ++i) { ret += entry.arg(ParseData::prettyStringForPosition(d->m_data->positions().at(i))) .arg(firstItem->position(i)); } } ret += entry.arg(tr("Object:")).arg(func->object()); ret += entry.arg(tr("Called:")).arg(tr("%n time(s)", 0, func->called())); ret += QLatin1String("

"); // self/inclusive costs entry = QLatin1String("%1%2"); ret += QLatin1String(""); ret += QLatin1String(""); ret += QLatin1String(""); ret += entry.arg(tr("Self costs")).arg(tr("(%)")); ret += entry.arg(tr("Incl. costs")).arg(tr("(%)")); ret += QLatin1String(""); ret += QLatin1String(""); for (int i = 0; i < d->m_data->events().size(); ++i) { quint64 selfCost = func->selfCost(i); quint64 inclCost = func->inclusiveCost(i); quint64 totalCost = d->m_data->totalCost(i); // 0.00% format const float relSelfCost = (float)qRound((float)selfCost / totalCost * 10000) / 100; const float relInclCost = (float)qRound((float)inclCost / totalCost * 10000) / 100; ret += QLatin1String(""); ret += QLatin1String(""); ret += entry.arg(selfCost).arg(tr("(%1%)").arg(relSelfCost)); ret += entry.arg(inclCost).arg(tr("(%1%)").arg(relInclCost)); ret += QLatin1String(""); } ret += QLatin1String("
") + tr("Events") + QLatin1String("
") + noWrap(ParseData::prettyStringForEvent(d->m_data->events().at(i))) + QLatin1String("
"); ret += QLatin1String(""); return ret; } if (role == FunctionRole) return QVariant::fromValue(func); if (role == ParentCostRole) { const quint64 totalCost = d->m_data->totalCost(d->m_event); return totalCost; } // the data model does not know about parent<->child relationship if (role == RelativeParentCostRole || role == RelativeTotalCostRole) { const quint64 totalCost = d->m_data->totalCost(d->m_event); if (index.column() == SelfCostColumn) return double(func->selfCost(d->m_event)) / totalCost; if (index.column() == InclusiveCostColumn) return double(func->inclusiveCost(d->m_event)) / totalCost; } if (role == LineNumberRole) return func->lineNumber(); if (role == FileNameRole) return func->file(); if (role == Qt::TextAlignmentRole) { if (index.column() == CalledColumn) return Qt::AlignRight; } return QVariant(); } QVariant DataModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Vertical || (role != Qt::DisplayRole && role != Qt::ToolTipRole)) return QVariant(); QTC_ASSERT(section >= 0 && section < columnCount(), return QVariant()); if (role == Qt::ToolTipRole) { if (!d->m_data) return QVariant(); const QString prettyCostStr = ParseData::prettyStringForEvent(d->m_data->events().at(d->m_event)); if (section == SelfCostColumn) return tr("%1 cost spent in a given function excluding costs from called functions.").arg(prettyCostStr); if (section == InclusiveCostColumn) return tr("%1 cost spent in a given function including costs from called functions.").arg(prettyCostStr); return QVariant(); } if (section == NameColumn) return tr("Function"); if (section == LocationColumn) return tr("Location"); if (section == CalledColumn) return tr("Called"); if (section == SelfCostColumn) return tr("Self Cost: %1").arg(d->m_data ? d->m_data->events().value(d->m_event) : QString()); if (section == InclusiveCostColumn) return tr("Incl. Cost: %1").arg(d->m_data ? d->m_data->events().value(d->m_event) : QString()); return QVariant(); } void DataModel::enableCycleDetection(bool enabled) { beginResetModel(); d->m_cycleDetection = enabled; d->updateFunctions(); endResetModel(); } void DataModel::setShortenTemplates(bool enabled) { beginResetModel(); d->m_shortenTemplates = enabled; d->updateFunctions(); endResetModel(); } } // namespace Valgrind } // namespace Callgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcontroller.cpp0000644000015301777760000002204412321547255033227 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindcontroller.h" #include "../valgrindprocess.h" #include #include #include #include #include #include #define CALLGRIND_CONTROL_DEBUG 0 const QLatin1String CALLGRIND_CONTROL_BINARY("callgrind_control"); namespace Valgrind { namespace Callgrind { CallgrindController::CallgrindController(QObject *parent) : QObject(parent) , m_process(0) , m_valgrindProc(0) , m_lastOption(Unknown) { } CallgrindController::~CallgrindController() { cleanupTempFile(); } QString toOptionString(CallgrindController::Option option) { /* Callgrind help from v3.6.0 Options: -h --help Show this help text --version Show version -l --long Show more information -s --stat Show statistics -b --back Show stack/back trace -e [,...] Show event counters for ,... (default: all) --dump[=] Request a dump optionally using as description -z --zero Zero all event counters -k --kill Kill --instr= Switch instrumentation state on/off -w=

Specify the startup directory of an active Callgrind run */ switch (option) { case CallgrindController::Dump: return QLatin1String("--dump"); case CallgrindController::ResetEventCounters: return QLatin1String("--zero"); case CallgrindController::Pause: return QLatin1String("--instr=off"); case CallgrindController::UnPause: return QLatin1String("--instr=on"); default: return QString(); // never reached } } void CallgrindController::run(Option option) { if (m_process) { emit statusMessage(tr("Previous command has not yet finished.")); return; } QTC_ASSERT(m_valgrindProc, return); QSsh::SshConnection *connection = m_valgrindProc->connection(); m_process = new ValgrindProcess(m_valgrindProc->isLocal(), connection ? connection->connectionParameters() : QSsh::SshConnectionParameters(), connection, this); connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(processFinished(int,QProcess::ExitStatus))); connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError))); // save back current running operation m_lastOption = option; const QString optionString = toOptionString(option); switch (option) { case CallgrindController::Dump: emit statusMessage(tr("Dumping profile data...")); break; case CallgrindController::ResetEventCounters: emit statusMessage(tr("Resetting event counters...")); break; case CallgrindController::Pause: emit statusMessage(tr("Pausing instrumentation...")); break; case CallgrindController::UnPause: emit statusMessage(tr("Unpausing instrumentation...")); break; default: break; } #if CALLGRIND_CONTROL_DEBUG m_process->setProcessChannelMode(QProcess::ForwardedChannels); #endif const int pid = Utils::HostOsInfo::isWindowsHost() ? 0 : m_valgrindProc->pid(); m_process->run(CALLGRIND_CONTROL_BINARY, QStringList() << optionString << QString::number(pid), QString(), QString()); } void CallgrindController::processError(QProcess::ProcessError) { QTC_ASSERT(m_process, return); const QString error = m_process->errorString(); emit statusMessage(tr("An error occurred while trying to run %1: %2").arg(CALLGRIND_CONTROL_BINARY).arg(error)); m_process->deleteLater(); m_process = 0; } void CallgrindController::processFinished(int rc, QProcess::ExitStatus status) { QTC_ASSERT(m_process, return); const QString error = m_process->errorString(); delete m_process; m_process = 0; if (rc != 0 || status != QProcess::NormalExit) { qWarning() << "Controller exited abnormally:" << error; return; } // this call went fine, we might run another task after this switch (m_lastOption) { case ResetEventCounters: // lets dump the new reset profiling info run(Dump); return; case Pause: // on pause, reset profiling info (for now) run(ResetEventCounters); return; case Dump: emit statusMessage(tr("Callgrind dumped profiling info")); break; case UnPause: emit statusMessage(tr("Callgrind unpaused.")); break; default: break; } emit finished(m_lastOption); m_lastOption = Unknown; } void CallgrindController::setValgrindProcess(ValgrindProcess *proc) { m_valgrindProc = proc; } void CallgrindController::getLocalDataFile() { QTC_ASSERT(m_valgrindProc, return); // we look for callgrind.out.PID, but there may be updated ones called ~.PID.NUM QString baseFileName = QString::fromLatin1("callgrind.out.%1"). arg(m_valgrindProc->pid()); const QString workingDir = m_valgrindProc->workingDirectory(); // first, set the to-be-parsed file to callgrind.out.PID QString fileName = workingDir.isEmpty() ? baseFileName : (workingDir + QDir::separator() + baseFileName); if (!m_valgrindProc->isLocal()) { ///TODO: error handling emit statusMessage(tr("Downloading remote profile data...")); m_ssh = m_valgrindProc->connection(); // if there are files like callgrind.out.PID.NUM, set it to the most recent one of those QString cmd = QString::fromLatin1("ls -t %1* | head -n 1").arg(fileName); m_findRemoteFile = m_ssh->createRemoteProcess(cmd.toUtf8()); connect(m_findRemoteFile.data(), SIGNAL(readyReadStandardOutput()), this, SLOT(foundRemoteFile())); m_findRemoteFile->start(); } else { QDir dir(workingDir, QString::fromLatin1("%1.*").arg(baseFileName), QDir::Time); QStringList outputFiles = dir.entryList(); // if there are files like callgrind.out.PID.NUM, set it to the most recent one of those if (!outputFiles.isEmpty()) fileName = workingDir + QDir::separator() + dir.entryList().first(); emit localParseDataAvailable(fileName); } } void CallgrindController::foundRemoteFile() { m_remoteFile = m_findRemoteFile->readAllStandardOutput().trimmed(); m_sftp = m_ssh->createSftpChannel(); connect(m_sftp.data(), SIGNAL(finished(QSsh::SftpJobId,QString)), this, SLOT(sftpJobFinished(QSsh::SftpJobId,QString))); connect(m_sftp.data(), SIGNAL(initialized()), this, SLOT(sftpInitialized())); m_sftp->initialize(); } void CallgrindController::sftpInitialized() { cleanupTempFile(); QTemporaryFile dataFile(QDir::tempPath() + QDir::separator() + QLatin1String("callgrind.out.")); QTC_ASSERT(dataFile.open(), return); m_tempDataFile = dataFile.fileName(); dataFile.setAutoRemove(false); dataFile.close(); m_downloadJob = m_sftp->downloadFile(QString::fromLocal8Bit(m_remoteFile), m_tempDataFile, QSsh::SftpOverwriteExisting); } void CallgrindController::sftpJobFinished(QSsh::SftpJobId job, const QString &error) { QTC_ASSERT(job == m_downloadJob, return); m_sftp->closeChannel(); if (error.isEmpty()) emit localParseDataAvailable(m_tempDataFile); } void CallgrindController::cleanupTempFile() { if (!m_tempDataFile.isEmpty() && QFile::exists(m_tempDataFile)) QFile::remove(m_tempDataFile); m_tempDataFile.clear(); } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcallmodel.cpp0000644000015301777760000001445412321547255033006 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindcallmodel.h" #include "callgrindfunctioncall.h" #include "callgrindfunction.h" #include "callgrindparsedata.h" #include #include namespace Valgrind { namespace Callgrind { //BEGIN CallModel::Private class CallModel::Private { public: Private(); const ParseData *m_data; QVector m_calls; int m_event; const Function *m_function; }; CallModel::Private::Private() : m_data(0) , m_event(0) , m_function(0) { } //END CallModel::Private //BEGIN CallModel CallModel::CallModel(QObject *parent) : QAbstractItemModel(parent), d(new Private) { } CallModel::~CallModel() { delete d; } void CallModel::clear() { beginResetModel(); d->m_function = 0; d->m_calls.clear(); endResetModel(); } void CallModel::setCalls(const QVector &calls, const Function *function) { beginResetModel(); d->m_function = function; d->m_calls = calls; endResetModel(); } QVector CallModel::calls() const { return d->m_calls; } const Function *CallModel::function() const { return d->m_function; } void CallModel::setCostEvent(int event) { d->m_event = event; } int CallModel::costEvent() const { return d->m_event; } void CallModel::setParseData(const ParseData *data) { if (d->m_data == data) return; if (!data) clear(); d->m_data = data; } const ParseData *CallModel::parseData() const { return d->m_data; } int CallModel::rowCount(const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0); if (parent.isValid()) return 0; return d->m_calls.count(); } int CallModel::columnCount(const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0); if (parent.isValid()) return 0; return ColumnCount; } QModelIndex CallModel::parent(const QModelIndex &child) const { QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex()); return QModelIndex(); } QModelIndex CallModel::index(int row, int column, const QModelIndex &parent) const { QTC_ASSERT(!parent.isValid() || parent.model() == this, return QModelIndex()); if (row == 0 && rowCount(parent) == 0) // happens with empty models return QModelIndex(); QTC_ASSERT(row >= 0 && row < rowCount(parent), return QModelIndex()); return createIndex(row, column); } QVariant CallModel::data(const QModelIndex &index, int role) const { //QTC_ASSERT(index.isValid() && index.model() == this, return QVariant()); //QTC_ASSERT(index.column() >= 0 && index.column() < columnCount(index.parent()), return QVariant()); //QTC_ASSERT(index.row() >= 0 && index.row() < rowCount(index.parent()), return QVariant()); const FunctionCall *call = d->m_calls.at(index.row()); if (role == Qt::DisplayRole || role == Qt::ToolTipRole) { if (index.column() == CalleeColumn) return call->callee()->name(); if (index.column() == CallerColumn) return call->caller()->name(); if (index.column() == CostColumn && role != Qt::ToolTipRole) return call->cost(d->m_event); if (index.column() == CallsColumn && role != Qt::ToolTipRole) return call->calls(); return QVariant(); } if (role == ParentCostRole) { const quint64 parentCost = d->m_function->inclusiveCost(d->m_event); return parentCost; } if (role == FunctionCallRole) return QVariant::fromValue(call); if (role == RelativeTotalCostRole) { const quint64 totalCost = d->m_data->totalCost(d->m_event); const quint64 callCost = call->cost(d->m_event); return double(callCost) / totalCost; } if (role == RelativeParentCostRole) { const quint64 parentCost = d->m_function->inclusiveCost(d->m_event); const quint64 callCost = call->cost(d->m_event); return double(callCost) / parentCost; } return QVariant(); } QVariant CallModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Vertical || (role != Qt::DisplayRole && role != Qt::ToolTipRole)) return QVariant(); QTC_ASSERT(section >= 0 && section < columnCount(), return QVariant()); if (role == Qt::ToolTipRole) { if (section == CostColumn) { if (!d->m_data) return QVariant(); return ParseData::prettyStringForEvent(d->m_data->events().at(d->m_event)); } return QVariant(); } if (section == CalleeColumn) return tr("Callee"); else if (section == CallerColumn) return tr("Caller"); else if (section == CostColumn) return tr("Cost"); else if (section == CallsColumn) return tr("Calls"); return QVariant(); } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindparser.h0000644000015301777760000000477412321547255032017 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRIND_PARSER_H #define LIBVALGRIND_CALLGRIND_PARSER_H #include QT_BEGIN_NAMESPACE class QIODevice; QT_END_NAMESPACE namespace Valgrind { namespace Callgrind { class ParseData; /** * Parser for Valgrind --tool=callgrind output * most of the format is documented at http://kcachegrind.sourceforge.net/html/CallgrindFormat.html * * FIXME: most length asserts are not correct, see documentation 1.2: * "If a cost line specifies less event counts than given in the "events" line, * the rest is assumed to be zero." * */ class Parser : public QObject { Q_OBJECT public: explicit Parser(QObject *parent = 0); ~Parser(); // get and take ownership of the parsing results. If this function is not called the repository // will be destroyed when the parser is destroyed. Subsequent calls return null. ParseData *takeData(); signals: void parserDataReady(); public Q_SLOTS: void parse(QIODevice *stream); private: class Private; Private *const d; }; } // Callgrind } // Valgrind #endif // LIBVALGRIND_CALLGRIND_PARSER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunction.h0000644000015301777760000001116012321547255032333 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRIND_FUNCTION_H #define LIBVALGRIND_CALLGRIND_FUNCTION_H #include #include namespace Valgrind { namespace Callgrind { class FunctionCall; class CostItem; class ParseData; class Function { public: /// @p data the ParseData for the file this function was part of /// required for the decompression of string data like function name etc. explicit Function(const ParseData *data); virtual ~Function(); /// @return the compressed function name id qint64 nameId() const; /// @return the function name. QString name() const; /** * Set function name to internal string id @p id. * @see ParseData::stringForFunction() */ void setName(qint64 id); /// @return the compressed file id qint64 fileId() const; /// @return the file path where this function was defined QString file() const; /** * Set function name to internal string id @p id. * @see ParseData::stringForFunction() */ void setFile(qint64 id); /// @return the compressed object id qint64 objectId() const; /// @return the object where this function was defined QString object() const; /** * Set function name to internal string id @p id. * @see ParseData::stringForFunction() */ void setObject(qint64 id); /** * @return a string representing the location of this function * It is a combination of file, object and line of the first CostItem. */ QString location() const; /** * @return the line number of the function or -1 if not known */ int lineNumber() const; /** * total accumulated self cost of @p event * @see ParseData::events() */ quint64 selfCost(int event) const; QVector selfCosts() const; /** * total accumulated inclusive cost of @p event * @see ParseData::events() */ quint64 inclusiveCost(int event) const; /// calls from other functions to this function QVector incomingCalls() const; void addIncomingCall(const FunctionCall *call); /// @return how often this function was called in total quint64 called() const; /** * The detailed list of cost items, which could e.g. be used for * a detailed view of the function's source code annotated with * cost per line. */ QVector costItems() const; /** * Add parsed @c CostItem @p item to this function. * * NOTE: The @c Function will take ownership. */ void addCostItem(const CostItem *item); /** * Function calls from this function to others. */ QVector outgoingCalls() const; void addOutgoingCall(const FunctionCall *call); /** * Gets called after all functions where looked up, required * to properly calculate inclusive cost of recursive functions * for example */ void finalize(); protected: class Private; Private *d; explicit Function(Private *d); private: Q_DISABLE_COPY(Function) }; } // namespace Callgrind } // namespace Valgrind Q_DECLARE_METATYPE(const Valgrind::Callgrind::Function *); #endif // LIBVALGRIND_CALLGRIND_FUNCTION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunction.cpp0000644000015301777760000002124412321547255032672 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindfunction.h" #include "callgrindfunction_p.h" #include "callgrindfunctioncall.h" #include "callgrindcostitem.h" #include "callgrindparsedata.h" #include #include #include #include #include #include namespace Valgrind { namespace Callgrind { //BEGIN Function::Private Function::Private::Private(const ParseData *data) : m_data(data) , m_fileId(-1) , m_objectId(-1) , m_nameId(-1) , m_selfCost(data->events().size(), 0) , m_inclusiveCost(data->events().size(), 0) , m_called(0) { } Function::Private::~Private() { // we don't own m_callers // we own the costitem which in turn owns the callees, // so only delete the former qDeleteAll(m_costItems); qDeleteAll(m_outgoingCalls); } void Function::Private::accumulateCost(QVector &base, const QVector &add) { if (base.isEmpty()) { base = add; } else { ///TODO: see whether .data() is noticably faster (less detaching) int i = 0; foreach (quint64 cost, add) base[i++] += cost; } } FunctionCall *Function::Private::accumulateCall(const FunctionCall *call, CallType type) { const Function *key = (type == Incoming) ? call->caller() : call->callee(); QHash &callMap = (type == Incoming) ? m_incomingCallMap : m_outgoingCallMap; FunctionCall *accumulatedCall = callMap.value(key, 0); if (!accumulatedCall) { accumulatedCall = new FunctionCall; if (type == Incoming) m_incomingCalls << accumulatedCall; else m_outgoingCalls << accumulatedCall; accumulatedCall->setCallee(call->callee()); accumulatedCall->setCaller(call->caller()); ///TODO: could the destinations differ from call to call? they should not, or? accumulatedCall->setDestinations(call->destinations()); callMap.insert(key, accumulatedCall); accumulatedCall->setCosts(call->costs()); } else { QVector costs = accumulatedCall->costs(); accumulateCost(costs, call->costs()); accumulatedCall->setCosts(costs); } accumulatedCall->setCalls(accumulatedCall->calls() + call->calls()); return accumulatedCall; } //BEGIN Function Function::Function(const ParseData *data) : d(new Private(data)) { } Function::Function(Function::Private *d) : d(d) { } Function::~Function() { delete d; } qint64 Function::nameId() const { return d->m_nameId; } QString Function::name() const { if (d->m_nameId != -1) return d->m_data->stringForFunctionCompression(d->m_nameId); else return QString(); } void Function::setName(qint64 id) { d->m_nameId = id; } qint64 Function::fileId() const { return d->m_fileId; } QString Function::file() const { if (d->m_fileId != -1) return d->m_data->stringForFileCompression(d->m_fileId); else return QString(); } void Function::setFile(qint64 id) { d->m_fileId = id; } qint64 Function::objectId() const { return d->m_objectId; } QString Function::object() const { if (d->m_objectId != -1) return d->m_data->stringForObjectCompression(d->m_objectId); else return QString(); } void Function::setObject(qint64 id) { d->m_objectId = id; } QString Function::location() const { QString pos; foreach (const CostItem *costItem, d->m_costItems) { if (costItem->differingFileId() != -1) { QTextStream stream(&pos); stream << '('; for (int i = 0, c = costItem->positions().count(); i < c; ++i) { ///TODO: remember what was hex formatted stream << costItem->position(i); if (i != c - 1) stream << ", "; } stream << ')'; break; } } QString f = file(); if (!f.isEmpty()) { QFileInfo info(f); if (info.exists()) f = info.canonicalFilePath(); } QString o = object(); if (o.isEmpty()) return QString(); if (f.isEmpty() || f == QLatin1String("???")) return o; if (pos.isEmpty()) return QCoreApplication::translate("Valgrind::Callgrind::Function", "%1 in %2").arg(f, o); return QCoreApplication::translate("Valgrind::Callgrind::Function", "%1:%2 in %3").arg(f, pos, o); } int Function::lineNumber() const { const int lineIdx = d->m_data->lineNumberPositionIndex(); if (lineIdx == -1) return -1; foreach (const CostItem *costItem, d->m_costItems) { if (costItem->differingFileId() == -1) return costItem->position(lineIdx); } return -1; } quint64 Function::selfCost(int event) const { return d->m_selfCost.at(event); } QVector< quint64 > Function::selfCosts() const { return d->m_selfCost; } quint64 Function::inclusiveCost(int event) const { return d->m_inclusiveCost.at(event) + d->m_selfCost.at(event); } QVector Function::outgoingCalls() const { return d->m_outgoingCalls; } void Function::addOutgoingCall(const FunctionCall *call) { QTC_ASSERT(call->caller() == this, return); d->accumulateCall(call, Private::Outgoing); } QVector Function::incomingCalls() const { return d->m_incomingCalls; } void Function::addIncomingCall(const FunctionCall *call) { QTC_ASSERT(call->callee() == this, return); d->m_called += call->calls(); d->accumulateCall(call, Private::Incoming); } quint64 Function::called() const { return d->m_called; } QVector Function::costItems() const { return d->m_costItems; } void Function::addCostItem(const CostItem *item) { QTC_ASSERT(!d->m_costItems.contains(item), return); d->m_costItems.append(item); // accumulate costs if (item->call()) d->accumulateCost(d->m_inclusiveCost, item->costs()); else d->accumulateCost(d->m_selfCost, item->costs()); } void Function::finalize() { bool recursive = false; foreach (const FunctionCall *call, d->m_incomingCalls) { if (call->caller() == this) { recursive = true; break; } } if (recursive) { // now handle recursive calls by setting the incl cost to the sum of all (external) calls // to this function // e.g.: A -> B -> B ..., C -> B -> B ... // cost of B = cost of call to B in A + cost of call to B in C + ... d->m_inclusiveCost.fill(0); foreach (const FunctionCall *call, d->m_incomingCalls) { if (call->caller() != this) { foreach (const CostItem *costItem, call->caller()->costItems()) { if (costItem->call() && costItem->call()->callee() == this) d->accumulateCost(d->m_inclusiveCost, costItem->costs()); } } } // now subtract self cost (see @c inclusiveCost() implementation) for (int i = 0, c = d->m_inclusiveCost.size(); i < c; ++i) { if (d->m_inclusiveCost.at(i) < d->m_selfCost.at(i)) d->m_inclusiveCost[i] = 0; else d->m_inclusiveCost[i] -= d->m_selfCost.at(i); } } } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindabstractmodel.h0000644000015301777760000000347512321547255033344 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRINDABSTRACTMODEL_H #define LIBVALGRIND_CALLGRINDABSTRACTMODEL_H #include namespace Valgrind { namespace Callgrind { class ParseData; enum AbstractModelRoles { ParentCostRole = Qt::UserRole, RelativeTotalCostRole, RelativeParentCostRole, NextCustomRole }; } // Callgrind } // Valgrind #endif // LIBVALGRIND_CALLGRINDABSTRACTMODEL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindproxymodel.cpp0000644000015301777760000001206112321547255033244 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindproxymodel.h" #include "callgrinddatamodel.h" #include "callgrindfunction.h" #include "callgrindfunctioncall.h" #include "callgrindparsedata.h" #include #include namespace Valgrind { namespace Callgrind { DataProxyModel::DataProxyModel(QObject *parent) : QSortFilterProxyModel(parent) , m_function(0) , m_maxRows(0) , m_minimumInclusiveCostRatio(0.0) { setDynamicSortFilter(true); } const Function *DataProxyModel::filterFunction() const { return m_function; } void DataProxyModel::setFilterBaseDir ( const QString &baseDir ) { if (m_baseDir == baseDir) return; m_baseDir = baseDir; invalidateFilter(); } void DataProxyModel::setFilterFunction(const Function *function) { if (m_function == function) return; const Function *previousFunction = m_function; m_function = function; invalidateFilter(); emit filterFunctionChanged(previousFunction, function); } void DataProxyModel::setFilterMaximumRows(int rows) { if (m_maxRows == rows) return; m_maxRows = rows; invalidateFilter(); emit filterMaximumRowsChanged(rows); } void DataProxyModel::setMinimumInclusiveCostRatio(double minimumInclusiveCost) { if (m_minimumInclusiveCostRatio == minimumInclusiveCost) return; m_minimumInclusiveCostRatio = minimumInclusiveCost; invalidateFilter(); } void DataProxyModel::setSourceModel(QAbstractItemModel *sourceModel) { if (!qobject_cast(sourceModel)) { qWarning() << Q_FUNC_INFO << "accepts DataModel instances only"; return; } QSortFilterProxyModel::setSourceModel(sourceModel); } DataModel *DataProxyModel::dataModel() const { return qobject_cast(sourceModel()); } bool DataProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { const QModelIndex source_index = sourceModel()->index( source_row, 0, source_parent ); if (!source_index.isValid()) return false; // if the filter regexp is a non-empty string, ignore our filters if (!filterRegExp().isEmpty()) return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); // check max rows if (m_maxRows > 0 && source_row > m_maxRows) return false; const Function *func = source_index.data(DataModel::FunctionRole).value(); // check if func is located in the specific base directory, if any if (func && !m_baseDir.isEmpty()) { if (!func->location().startsWith(m_baseDir)) return false; } // check if the function from this index is a child of (called by) the filter function if (func && m_function) { bool isValid = false; foreach (const FunctionCall *call, func->incomingCalls()) { if (call->caller() == m_function) { isValid = true; break; } } if (!isValid) return false; } // check minimum inclusive costs DataModel *model = dataModel(); QTC_ASSERT(model, return false); // as always: this should never happen const ParseData *data = model->parseData(); QTC_ASSERT(data, return false); if (m_minimumInclusiveCostRatio != 0.0) { const quint64 totalCost = data->totalCost(0); const quint64 inclusiveCost = func->inclusiveCost(0); const float inclusiveCostRatio = (float)inclusiveCost / totalCost; if (inclusiveCostRatio < m_minimumInclusiveCostRatio) return false; } return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcostitem.cpp0000644000015301777760000000644012321547255032675 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindcostitem.h" #include #include #include #include "callgrindparsedata.h" #include "callgrindfunctioncall.h" namespace Valgrind { namespace Callgrind { //BEGIN CostItem::Private class CostItem::Private { public: Private(ParseData *data); ~Private(); QVector m_positions; QVector m_events; const FunctionCall *m_call; const ParseData *m_data; qint64 m_differingFileId; }; CostItem::Private::Private(ParseData *data) : m_positions(data->positions().size(), 0) , m_events(data->events().size(), 0) , m_call(0) , m_data(data) , m_differingFileId(-1) { } CostItem::Private::~Private() { delete m_call; } //BEGIN CostItem CostItem::CostItem(ParseData *data) : d(new Private(data)) { } CostItem::~CostItem() { delete d; } quint64 CostItem::position(int posIdx) const { return d->m_positions.at(posIdx); } void CostItem::setPosition(int posIdx, quint64 position) { d->m_positions[posIdx] = position; } QVector< quint64 > CostItem::positions() const { return d->m_positions; } quint64 CostItem::cost(int event) const { return d->m_events.at(event); } void CostItem::setCost(int event, quint64 cost) { d->m_events[event] = cost; } QVector< quint64 > CostItem::costs() const { return d->m_events; } const FunctionCall *CostItem::call() const { return d->m_call; } void CostItem::setCall(const FunctionCall *call) { d->m_call = call; } QString CostItem::differingFile() const { if (d->m_differingFileId != -1) return d->m_data->stringForFileCompression(d->m_differingFileId); else return QString(); } qint64 CostItem::differingFileId() const { return d->m_differingFileId; } void CostItem::setDifferingFile(qint64 fileId) { d->m_differingFileId = fileId; } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindproxymodel.h0000644000015301777760000000616212321547255032716 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H #define VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H #include namespace Valgrind { namespace Callgrind { class DataModel; class Function; class DataProxyModel : public QSortFilterProxyModel { Q_OBJECT public: explicit DataProxyModel(QObject *parent = 0); virtual void setSourceModel(QAbstractItemModel *sourceModel); QString filterBaseDir() const { return m_baseDir; } const Function *filterFunction() const; int filterMaximumRows() const { return m_maxRows; } /// Only functions with an inclusive cost ratio above this minimum will be shown in the model double minimumInclusiveCostRatio() const { return m_minimumInclusiveCostRatio; } public Q_SLOTS: /// This will filter out all entries that are not located within \param baseDir void setFilterBaseDir(const QString& baseDir); void setFilterFunction(const Function *call); void setFilterMaximumRows(int rows); /// Only rows with a inclusive cost ratio above @p minimumInclusiveCost will be shown /// by this model. If @c 0 is passed as argument, all rows will be shown. void setMinimumInclusiveCostRatio(double minimumInclusiveCost); Q_SIGNALS: void filterFunctionChanged(const Function *previous, const Function *current); void filterMaximumRowsChanged(int rows); protected: virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; private: DataModel *dataModel() const; QString m_baseDir; const Function *m_function; int m_maxRows; double m_minimumInclusiveCostRatio; }; } // namespace Callgrind } // namespace Valgrind #endif // VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunctioncycle.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunctioncycle.cp0000644000015301777760000000753412321547255033540 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindfunctioncycle.h" #include "callgrindfunction_p.h" #include "callgrindfunctioncall.h" #include "callgrindparsedata.h" #include #include namespace Valgrind { namespace Callgrind { //BEGIN FunctionCycle::Private class FunctionCycle::Private : public Function::Private { public: Private(const ParseData *data); QVector m_functions; }; FunctionCycle::Private::Private(const ParseData *data) : Function::Private(data) { } #define CYCLE_D static_cast(this->d) //BEGIN FunctionCycle FunctionCycle::FunctionCycle(const ParseData *data) : Function(new Private(data)) { } FunctionCycle::~FunctionCycle() { // d should be deleted by Function::~Function() } void FunctionCycle::setFunctions(const QVector functions) { Private *d = CYCLE_D; d->m_functions = functions; d->m_incomingCallMap.clear(); d->m_outgoingCallMap.clear(); d->m_called = 0; d->m_selfCost.fill(0, d->m_data->events().size()); d->m_inclusiveCost.fill(0, d->m_data->events().size()); foreach (const Function *func, functions) { // just add up self cost d->accumulateCost(d->m_selfCost, func->selfCosts()); // add outgoing calls to functions that are not part of the cycle foreach (const FunctionCall *call, func->outgoingCalls()) { if (!functions.contains(call->callee())) d->accumulateCall(call, Function::Private::Outgoing); } // add incoming calls from functions that are not part of the cycle foreach (const FunctionCall *call, func->incomingCalls()) { if (!functions.contains(call->caller())) { d->accumulateCall(call, Function::Private::Incoming); d->m_called += call->calls(); d->accumulateCost(d->m_inclusiveCost, call->costs()); } } } // now subtract self from incl. cost (see implementation of inclusiveCost()) // now subtract self cost (see @c inclusiveCost() implementation) for (int i = 0, c = d->m_inclusiveCost.size(); i < c; ++i) { if (d->m_inclusiveCost.at(i) < d->m_selfCost.at(i)) d->m_inclusiveCost[i] = 0; else d->m_inclusiveCost[i] -= d->m_selfCost.at(i); } } QVector FunctionCycle::functions() const { return CYCLE_D->m_functions; } } // namespace Callgrind } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindcostitem.h0000644000015301777760000000630312321547255032340 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRIND_COSTITEM_H #define LIBVALGRIND_CALLGRIND_COSTITEM_H #include QT_BEGIN_NAMESPACE class QString; template class QVector; QT_END_NAMESPACE namespace Valgrind { namespace Callgrind { class FunctionCall; class ParseData; /** * This class represents the cost(s) at given position(s). */ class CostItem { public: /// @p data the file data this cost item was parsed in. /// required for decompression of string data like differing source file information explicit CostItem(ParseData *data); ~CostItem(); /** * Position data for the given position-index @p posIdx * @see ParseData::positions() */ quint64 position(int posIdx) const; void setPosition(int posIdx, quint64 position); QVector positions() const; /** * Cost data for the given event-index @p event * @see ParseData::events() */ quint64 cost(int event) const; void setCost(int event, quint64 cost); QVector costs() const; /** * If this cost item represents a function call, this will return the @c Callee. * Otherwise zero will be returned. */ const FunctionCall *call() const; ///NOTE: @c CostItem will take ownership void setCall(const FunctionCall *call); /** * If this cost item represents a jump to a different file, this will * return the path to that file. The string will be empty otherwise. */ QString differingFile() const; /// @return compressed file id or -1 if none is set qint64 differingFileId() const; void setDifferingFile(qint64 fileId); private: Q_DISABLE_COPY(CostItem) class Private; Private *d; }; } // namespace Callgrind } // namespace Valgrind #endif // LIBVALGRIND_CALLGRIND_COSTITEM_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindparsedata.h0000644000015301777760000001161312321547255032455 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRIND_PARSEDATA_P_H #define LIBVALGRIND_CALLGRIND_PARSEDATA_P_H #include QT_BEGIN_NAMESPACE class QString; template class QVector; class QStringList; QT_END_NAMESPACE namespace Valgrind { namespace Callgrind { class Function; /** * Represents all the information extracted from a callgrind data file. */ class ParseData { public: explicit ParseData(); ~ParseData(); static QString prettyStringForEvent(const QString &event); /// List of events reported in the data file. QStringList events() const; void setEvents(const QStringList &events); static QString prettyStringForPosition(const QString &position); /// List of positions reported in the data file. QStringList positions() const; void setPositions(const QStringList &positions); /// the index of the line number in @c positions() /// or -1 if no line numbers where reported. int lineNumberPositionIndex() const; /** * Total cost of @p event reported in the data file. * * @see events() */ quint64 totalCost(uint event) const; void setTotalCost(uint event, quint64 cost); /** * When @p detectCycles is set to true, the returned list will have all @c Function's in call * cycles replaced with @c FunctionCycle. * * @return All functions that where reported in the data file. */ QVector functions(bool detectCycles = false) const; /// NOTE: The @c ParseData will take ownership. void addFunction(const Function *function); /// @return executed command with arguments QString command() const; void setCommand(const QString &command); /// @return pid of executed command quint64 pid() const; void setPid(quint64 pid); /// @return number of data, if callgrind_control --dump was used uint part() const; void setPart(uint part) const; /// @return list of desc: lines in the data QStringList descriptions() const; void addDescription(const QString &description); void setDescriptions(const QStringList &descriptions); /// @return version of the callgrind data format int version() const; void setVersion(int version); /// @return creator of the data QString creator() const; void setCreator(const QString &creator); /** * Internal name compression lookup table. * * We save the @c QString representations of the compressed data format only once here. * This should make sure the memory consumption doesn't skyrocket as long * as these strings are only displayed without applying detaching operations on them. */ /// for Objects QString stringForObjectCompression(qint64 id) const; /// @p id if it is -1, an uncompressed string is assumed and it will be compressed internally void addCompressedObject(const QString &object, qint64 &id); /// for Files QString stringForFileCompression(qint64 id) const; /// @p id if it is -1, an uncompressed string is assumed and it will be compressed internally void addCompressedFile(const QString &file, qint64 &id); /// for Functions QString stringForFunctionCompression(qint64 id) const; /// @p id if it is -1, an uncompressed string is assumed and it will be compressed internally void addCompressedFunction(const QString &function, qint64 &id); private: class Private; Private *d; }; } // namespace Callgrind } // namespace Valgrind #endif // LIBVALGRIND_CALLGRIND_PARSEDATA_P_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindfunctioncycle.h0000644000015301777760000000510512321547255033355 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H #define LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H #include "callgrindfunction.h" namespace Valgrind { namespace Callgrind { /** * self cost of a function cycle: sum of self costs of functions in the cycle * callers of a function cycle: set of callers to functions in the cycle * excluding calls inside the cycle * callees of a function cycle: set of callees from functions in the cycle * excluding calees inside the cycle * inclusive cost of a function cycle: sum of inclusive cost of callees of the cycle (see above) */ class FunctionCycle : public Function { public: explicit FunctionCycle(const ParseData *data); virtual ~FunctionCycle(); /// sets the list of functions that make up this cycle /// NOTE: ownership is *not* transferred to the cycle void setFunctions(const QVector functions); /// @return the functions that make up this cycle QVector functions() const; private: class Private; }; } // namespace Callgrind } // namespace Valgrind #endif // LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrind/callgrindrunner.h0000644000015301777760000000461712321547255032030 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRIND_CALLGRIND_CALLGRINDRUNNER_H #define VALGRIND_CALLGRIND_CALLGRINDRUNNER_H #include "../valgrindrunner.h" #include "callgrindcontroller.h" namespace Valgrind { namespace Callgrind { class Parser; class CallgrindController; class CallgrindRunner : public ValgrindRunner { Q_OBJECT public: explicit CallgrindRunner(QObject *parent = 0); Parser *parser() const; CallgrindController *controller() const; bool isPaused() const; bool start(); signals: void statusMessage(const QString &message); private slots: void localParseDataAvailable(const QString &file); void controllerFinished(Valgrind::Callgrind::CallgrindController::Option); void processFinished(int, QProcess::ExitStatus); private: void triggerParse(); QString tool() const; CallgrindController *m_controller; Parser *m_parser; bool m_paused; }; } // namespace Callgrind } // namespace Valgrind #endif // VALGRIND_CALLGRIND_CALLGRINDRUNNER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindprocess.cpp0000644000015301777760000002571512321547255030442 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindprocess.h" #include #include #include #include #include #ifdef Q_OS_WIN # include #endif namespace Valgrind { ValgrindProcess::ValgrindProcess(bool isLocal, const QSsh::SshConnectionParameters &sshParams, QSsh::SshConnection *connection, QObject *parent) : QObject(parent), m_isLocal(isLocal) { m_remote.m_params = sshParams; m_remote.m_connection = connection; m_remote.m_error = QProcess::UnknownError; m_pid = 0; } void ValgrindProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode) { if (isLocal()) m_localProcess.setProcessChannelMode(mode); ///TODO: remote support this by handling the mode internally } void ValgrindProcess::setWorkingDirectory(const QString &path) { if (isLocal()) m_localProcess.setWorkingDirectory(path); else m_remote.m_workingDir = path; } QString ValgrindProcess::workingDirectory() const { if (isLocal()) return m_localProcess.workingDirectory(); else return m_remote.m_workingDir; } bool ValgrindProcess::isRunning() const { if (isLocal()) return m_localProcess.state() != QProcess::NotRunning; else return m_remote.m_process && m_remote.m_process->isRunning(); } void ValgrindProcess::setEnvironment(const Utils::Environment &environment) { if (isLocal()) m_localProcess.setEnvironment(environment); ///TODO: remote anything that should/could be done here? } void ValgrindProcess::close() { if (isLocal()) { m_localProcess.terminate(); } else { QTC_ASSERT(m_remote.m_connection->state() == QSsh::SshConnection::Connected, return); if (m_remote.m_process) { if (m_pid) { const QString killTemplate = QString::fromLatin1("kill -%2 %1" // kill ).arg(m_pid); const QString niceKill = killTemplate.arg(QLatin1String("SIGTERM")); const QString brutalKill = killTemplate.arg(QLatin1String("SIGKILL")); const QString remoteCall = niceKill + QLatin1String("; sleep 1; ") + brutalKill; QSsh::SshRemoteProcess::Ptr cleanup = m_remote.m_connection->createRemoteProcess(remoteCall.toUtf8()); cleanup->start(); } } } } void ValgrindProcess::run(const QString &valgrindExecutable, const QStringList &valgrindArguments, const QString &debuggeeExecutable, const QString &debuggeeArguments) { Utils::QtcProcess::addArgs(&m_arguments, valgrindArguments); Utils::QtcProcess::addArg(&m_arguments, debuggeeExecutable); Utils::QtcProcess::addArgs(&m_arguments, debuggeeArguments); if (isLocal()) { connect(&m_localProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SIGNAL(finished(int,QProcess::ExitStatus))); connect(&m_localProcess, SIGNAL(started()), this, SIGNAL(started())); connect(&m_localProcess, SIGNAL(error(QProcess::ProcessError)), this, SIGNAL(error(QProcess::ProcessError))); connect(&m_localProcess, SIGNAL(readyReadStandardError()), this, SLOT(handleReadyReadStandardError())); connect(&m_localProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(handleReadyReadStandardOutput())); m_localProcess.setCommand(valgrindExecutable, m_arguments); m_localProcess.start(); m_localProcess.waitForStarted(); m_pid = Utils::qPidToPid(m_localProcess.pid()); } else { m_remote.m_valgrindExe = valgrindExecutable; m_remote.m_debuggee = debuggeeExecutable; // connect to host and wait for connection if (!m_remote.m_connection) m_remote.m_connection = new QSsh::SshConnection(m_remote.m_params, this); if (m_remote.m_connection->state() != QSsh::SshConnection::Connected) { connect(m_remote.m_connection, SIGNAL(connected()), this, SLOT(connected())); connect(m_remote.m_connection, SIGNAL(error(QSsh::SshError)), this, SLOT(handelError(QSsh::SshError))); if (m_remote.m_connection->state() == QSsh::SshConnection::Unconnected) m_remote.m_connection->connectToHost(); } else { connected(); } } } QString ValgrindProcess::errorString() const { if (isLocal()) return m_localProcess.errorString(); else return m_remote.m_errorString; } QProcess::ProcessError ValgrindProcess::error() const { if (isLocal()) return m_localProcess.error(); else return m_remote.m_error; } void ValgrindProcess::handleError(QSsh::SshError error) { if (isLocal()) { } else { switch (error) { case QSsh::SshTimeoutError: m_remote.m_error = QProcess::Timedout; break; default: m_remote.m_error = QProcess::FailedToStart; break; } } m_remote.m_errorString = m_remote.m_connection->errorString(); emit this->error(m_remote.m_error); } qint64 ValgrindProcess::pid() const { return m_pid; } void ValgrindProcess::handleReadyReadStandardError() { QByteArray b; if (isLocal()) b = m_localProcess.readAllStandardError(); else b = m_remote.m_process->readAllStandardError(); if (!b.isEmpty()) emit processOutput(b, Utils::StdErrFormat); } void ValgrindProcess::handleReadyReadStandardOutput() { QByteArray b; if (isLocal()) b = m_localProcess.readAllStandardOutput(); else b = m_remote.m_process->readAllStandardOutput(); if (!b.isEmpty()) emit processOutput(b, Utils::StdOutFormat); } /// Remote void ValgrindProcess::connected() { QTC_ASSERT(m_remote.m_connection->state() == QSsh::SshConnection::Connected, return); // connected, run command QString cmd; if (!m_remote.m_workingDir.isEmpty()) cmd += QString::fromLatin1("cd '%1' && ").arg(m_remote.m_workingDir); cmd += m_remote.m_valgrindExe + QLatin1Char(' ') + m_arguments; m_remote.m_process = m_remote.m_connection->createRemoteProcess(cmd.toUtf8()); connect(m_remote.m_process.data(), SIGNAL(readyReadStandardError()), this, SLOT(handleReadyReadStandardError())); connect(m_remote.m_process.data(), SIGNAL(readyReadStandardOutput()), this, SLOT(handleReadyReadStandardOutput())); connect(m_remote.m_process.data(), SIGNAL(closed(int)), this, SLOT(closed(int))); connect(m_remote.m_process.data(), SIGNAL(started()), this, SLOT(processStarted())); m_remote.m_process->start(); } QSsh::SshConnection *ValgrindProcess::connection() const { return m_remote.m_connection; } void ValgrindProcess::processStarted() { QTC_ASSERT(m_remote.m_connection->state() == QSsh::SshConnection::Connected, return); // find out what PID our process has // NOTE: valgrind cloaks its name, // e.g.: valgrind --tool=memcheck foobar // => ps aux, pidof will see valgrind.bin // => pkill/killall/top... will see memcheck-amd64-linux or similar // hence we need to do something more complex... // plain path to exe, m_valgrindExe contains e.g. env vars etc. pp. const QString proc = m_remote.m_valgrindExe.split(QLatin1Char(' ')).last(); // sleep required since otherwise we might only match "bash -c..." // and not the actual valgrind run const QString cmd = QString::fromLatin1("sleep 1; ps ax" // list all processes with aliased name " | grep '\\b%1.*%2'" // find valgrind process " | tail -n 1" // limit to single process // we pick the last one, first would be "bash -c ..." " | awk '{print $1;}'" // get pid ).arg(proc, QFileInfo(m_remote.m_debuggee).fileName()); m_remote.m_findPID = m_remote.m_connection->createRemoteProcess(cmd.toUtf8()); connect(m_remote.m_findPID.data(), SIGNAL(readyReadStandardError()), this, SLOT(handleReadyReadStandardError())); connect(m_remote.m_findPID.data(), SIGNAL(readyReadStandardOutput()), this, SLOT(findPIDOutputReceived())); m_remote.m_findPID->start(); } void ValgrindProcess::findPIDOutputReceived() { bool ok; m_pid = m_remote.m_findPID->readAllStandardOutput().trimmed().toLongLong(&ok); if (!ok) { m_pid = 0; m_remote.m_errorString = tr("Could not determine remote PID."); m_remote.m_error = QProcess::FailedToStart; emit ValgrindProcess::error(QProcess::FailedToStart); close(); } else { emit started(); } } /////////// void ValgrindProcess::closed(int status) { QTC_ASSERT(m_remote.m_process, return); m_remote.m_errorString = m_remote.m_process->errorString(); if (status == QSsh::SshRemoteProcess::FailedToStart) { m_remote.m_error = QProcess::FailedToStart; emit ValgrindProcess::error(QProcess::FailedToStart); } else if (status == QSsh::SshRemoteProcess::NormalExit) { emit finished(m_remote.m_process->exitCode(), QProcess::NormalExit); } else if (status == QSsh::SshRemoteProcess::CrashExit) { m_remote.m_error = QProcess::Crashed; emit finished(m_remote.m_process->exitCode(), QProcess::CrashExit); } } } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrind.pro0000644000015301777760000000247512321547255027057 0ustar pbusernogroup00000000000000include(../../qtcreatorplugin.pri) include(callgrind/callgrind.pri) include(memcheck/memcheck.pri) include(xmlprotocol/xmlprotocol.pri) QT *= network CONFIG += exceptions HEADERS += \ valgrindplugin.h \ valgrindengine.h \ valgrindconfigwidget.h \ valgrindsettings.h \ valgrindrunner.h \ valgrindprocess.h \ callgrindcostdelegate.h \ callgrindcostview.h \ callgrindhelper.h \ callgrindnamedelegate.h \ callgrindtool.h \ callgrindvisualisation.h \ callgrindengine.h \ workarounds.h \ callgrindtextmark.h \ valgrindtool.h \ memchecktool.h \ memcheckengine.h \ memcheckerrorview.h \ suppressiondialog.h \ valgrindruncontrolfactory.h SOURCES += \ valgrindplugin.cpp \ valgrindengine.cpp \ valgrindconfigwidget.cpp \ valgrindsettings.cpp \ valgrindrunner.cpp \ valgrindprocess.cpp \ valgrindtool.cpp \ callgrindcostdelegate.cpp \ callgrindcostview.cpp \ callgrindhelper.cpp \ callgrindnamedelegate.cpp \ callgrindtool.cpp \ callgrindvisualisation.cpp \ callgrindengine.cpp \ workarounds.cpp \ callgrindtextmark.cpp \ memchecktool.cpp \ memcheckengine.cpp \ memcheckerrorview.cpp \ suppressiondialog.cpp \ valgrindruncontrolfactory.cpp FORMS += \ valgrindconfigwidget.ui qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memchecktool.h0000644000015301777760000000756012321547255027352 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef MEMCHECKTOOL_H #define MEMCHECKTOOL_H #include "valgrindtool.h" #include QT_BEGIN_NAMESPACE class QModelIndex; class QAction; class QMenu; QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { class ErrorListModel; class Error; } } namespace Valgrind { namespace Internal { class FrameFinder; class MemcheckErrorView; class ValgrindBaseSettings; class MemcheckErrorFilterProxyModel : public QSortFilterProxyModel { Q_OBJECT public: MemcheckErrorFilterProxyModel(QObject *parent = 0); public slots: void setAcceptedKinds(const QList &acceptedKinds); void setFilterExternalIssues(bool filter); protected: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; private: QList m_acceptedKinds; bool m_filterExternalIssues; }; class MemcheckTool : public ValgrindTool { Q_OBJECT public: MemcheckTool(QObject *parent); ProjectExplorer::RunMode runMode() const; private slots: void settingsDestroyed(QObject *settings); void maybeActiveRunConfigurationChanged(); void engineStarting(const Analyzer::AnalyzerRunControl *engine); void engineFinished(); void loadingExternalXmlLogFileFinished(); void parserError(const Valgrind::XmlProtocol::Error &error); void internalParserError(const QString &errorString); void updateErrorFilter(); void suppressionActionTriggered(); void loadExternalXmlLogFile(); private: ToolMode toolMode() const; QWidget *createWidgets(); void setBusyCursor(bool busy); Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration = 0); void clearErrorView(); void updateFromSettings(); int updateUiAfterFinishedHelper(); private: ValgrindBaseSettings *m_settings; QMenu *m_filterMenu; FrameFinder *m_frameFinder; Valgrind::XmlProtocol::ErrorListModel *m_errorModel; MemcheckErrorFilterProxyModel *m_errorProxyModel; MemcheckErrorView *m_errorView; QList m_errorFilterActions; QAction *m_filterProjectAction; QList m_suppressionActions; QAction *m_suppressionSeparator; QAction *m_loadExternalLogFile; QAction *m_goBack; QAction *m_goNext; }; } // namespace Internal } // namespace Valgrind #endif // MEMCHECKTOOL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/suppressiondialog.cpp0000644000015301777760000002222012321547255030773 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "suppressiondialog.h" #include "memcheckerrorview.h" #include "valgrindsettings.h" #include "xmlprotocol/suppression.h" #include "xmlprotocol/errorlistmodel.h" #include "xmlprotocol/stack.h" #include "xmlprotocol/frame.h" #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Valgrind::XmlProtocol; namespace Valgrind { namespace Internal { static QString suppressionText(const Error &error) { Suppression sup(error.suppression()); // workaround: https://bugs.kde.org/show_bug.cgi?id=255822 if (sup.frames().size() >= 24) sup.setFrames(sup.frames().mid(0, 23)); QTC_ASSERT(sup.frames().size() < 24, /**/); // try to set some useful name automatically, instead of "insert_name_here" // we take the last stack frame and append the suppression kind, e.g.: // QDebug::operator<<(bool) [Memcheck:Cond] if (!error.stacks().isEmpty() && !error.stacks().first().frames().isEmpty()) { const Frame frame = error.stacks().first().frames().first(); QString newName; if (!frame.functionName().isEmpty()) newName = frame.functionName(); else if (!frame.object().isEmpty()) newName = frame.object(); if (!newName.isEmpty()) sup.setName(newName + QLatin1Char('[') + sup.kind() + QLatin1Char(']')); } return sup.toString(); } /// @p error input error, which might get hidden when it has the same stack /// @p suppressed the error that got suppressed already static bool equalSuppression(const Error &error, const Error &suppressed) { if (error.kind() != suppressed.kind() || error.suppression().isNull()) return false; const SuppressionFrames errorFrames = error.suppression().frames(); const SuppressionFrames suppressedFrames = suppressed.suppression().frames(); // limit to 23 frames, see: https://bugs.kde.org/show_bug.cgi?id=255822 if (qMin(23, suppressedFrames.size()) > errorFrames.size()) return false; int frames = 23; if (errorFrames.size() < frames) frames = errorFrames.size(); if (suppressedFrames.size() < frames) frames = suppressedFrames.size(); for (int i = 0; i < frames; ++i) if (errorFrames.at(i) != suppressedFrames.at(i)) return false; return true; } bool sortIndizesReverse(const QModelIndex &l, const QModelIndex &r) { return l.row() > r.row(); } SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, const QList &errors) : m_view(view), m_settings(view->settings()), m_cleanupIfCanceled(false), m_errors(errors), m_fileChooser(new Utils::PathChooser(this)), m_suppressionEdit(new QPlainTextEdit(this)) { setWindowTitle(tr("Save Suppression")); QLabel *fileLabel = new QLabel(tr("Suppression File:"), this); QLabel *suppressionsLabel = new QLabel(tr("Suppression:"), this); suppressionsLabel->setBuddy(m_suppressionEdit); QFont font; font.setFamily(QLatin1String("Monospace")); m_suppressionEdit->setFont(font); m_buttonBox = new QDialogButtonBox(this); m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save); QFormLayout *formLayout = new QFormLayout(this); formLayout->addRow(fileLabel, m_fileChooser); formLayout->addRow(suppressionsLabel); formLayout->addRow(m_suppressionEdit); formLayout->addRow(m_buttonBox); QFile defaultSuppFile(view->defaultSuppressionFile()); if (!defaultSuppFile.exists()) { if (defaultSuppFile.open(QIODevice::WriteOnly)) { defaultSuppFile.close(); m_cleanupIfCanceled = true; } } m_fileChooser->setExpectedKind(Utils::PathChooser::File); m_fileChooser->setPath(defaultSuppFile.fileName()); m_fileChooser->setPromptDialogFilter(QLatin1String("*.supp")); m_fileChooser->setPromptDialogTitle(tr("Select Suppression File")); QString suppressions; foreach (const Error &error, m_errors) suppressions += suppressionText(error); m_suppressionEdit->setPlainText(suppressions); connect(m_fileChooser, SIGNAL(validChanged()), SLOT(validate())); connect(m_suppressionEdit->document(), SIGNAL(contentsChanged()), SLOT(validate())); connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject())); } void SuppressionDialog::maybeShow(MemcheckErrorView *view) { QModelIndexList indices = view->selectionModel()->selectedRows(); // Can happen when using arrow keys to navigate and shortcut to trigger suppression: if (indices.isEmpty() && view->selectionModel()->currentIndex().isValid()) indices.append(view->selectionModel()->currentIndex()); QList errors; foreach (const QModelIndex &index, indices) { Error error = view->model()->data(index, ErrorListModel::ErrorRole).value(); if (!error.suppression().isNull()) errors.append(error); } if (errors.isEmpty()) return; SuppressionDialog dialog(view, errors); dialog.exec(); } void SuppressionDialog::accept() { const QString path = m_fileChooser->path(); QTC_ASSERT(!path.isEmpty(), return); QTC_ASSERT(!m_suppressionEdit->toPlainText().trimmed().isEmpty(), return); Utils::FileSaver saver(path, QIODevice::Append); if (!saver.hasError()) { QTextStream stream(saver.file()); stream << m_suppressionEdit->toPlainText(); saver.setResult(&stream); } if (!saver.finalize(this)) return; // Add file to project if there is a project containing this file on the file system. if (!ProjectExplorer::SessionManager::projectForFile(path)) { foreach (ProjectExplorer::Project *p, ProjectExplorer::SessionManager::projects()) { if (path.startsWith(p->projectDirectory())) { p->rootProjectNode()->addFiles(QStringList() << path); break; } } } m_settings->addSuppressionFiles(QStringList(path)); QModelIndexList indices = m_view->selectionModel()->selectedRows(); qSort(indices.begin(), indices.end(), sortIndizesReverse); QAbstractItemModel *model = m_view->model(); foreach (const QModelIndex &index, indices) { bool removed = model->removeRow(index.row()); QTC_ASSERT(removed, qt_noop()); Q_UNUSED(removed); } // One suppression might hide multiple rows, care for that. for (int row = 0; row < model->rowCount(); ++row ) { const Error rowError = model->data( model->index(row, 0), ErrorListModel::ErrorRole).value(); foreach (const Error &error, m_errors) { if (equalSuppression(rowError, error)) { bool removed = model->removeRow(row); QTC_CHECK(removed); // Gets incremented in the for loop again. --row; break; } } } // Select a new item. m_view->setCurrentIndex(indices.first()); QDialog::accept(); } void SuppressionDialog::reject() { if (m_cleanupIfCanceled) QFile::remove(m_view->defaultSuppressionFile()); QDialog::reject(); } void SuppressionDialog::validate() { bool valid = m_fileChooser->isValid() && !m_suppressionEdit->toPlainText().trimmed().isEmpty(); m_buttonBox->button(QDialogButtonBox::Save)->setEnabled(valid); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindruncontrolfactory.cpp0000644000015301777760000001265212321547255032555 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Kläralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindruncontrolfactory.h" #include "valgrindsettings.h" #include "valgrindplugin.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Analyzer; using namespace ProjectExplorer; namespace Valgrind { namespace Internal { ValgrindRunControlFactory::ValgrindRunControlFactory(QObject *parent) : IRunControlFactory(parent) { } bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const { Q_UNUSED(runConfiguration); return mode == CallgrindRunMode || mode == MemcheckRunMode; } RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) { Q_UNUSED(errorMessage); AnalyzerStartParameters sp; sp.displayName = runConfiguration->displayName(); sp.runMode = mode; if (LocalApplicationRunConfiguration *rc1 = qobject_cast(runConfiguration)) { EnvironmentAspect *aspect = runConfiguration->extraAspect(); if (aspect) sp.environment = aspect->environment(); sp.workingDirectory = rc1->workingDirectory(); sp.debuggee = rc1->executable(); sp.debuggeeArgs = rc1->commandLineArguments(); const IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit()); QTC_ASSERT(device, return 0); QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0); QTcpServer server; if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) { qWarning() << "Cannot open port on host for profiling."; return 0; } sp.connParams.host = server.serverAddress().toString(); sp.connParams.port = server.serverPort(); sp.startMode = StartLocal; } else if (RemoteLinux::AbstractRemoteLinuxRunConfiguration *rc2 = qobject_cast(runConfiguration)) { sp.startMode = StartRemote; sp.debuggee = rc2->remoteExecutableFilePath(); sp.connParams = DeviceKitInformation::device(rc2->target()->kit())->sshParameters(); sp.debuggeeArgs = rc2->arguments().join(QLatin1String(" ")); } else { QTC_ASSERT(false, return 0); } return AnalyzerManager::createRunControl(sp, runConfiguration); } class ValgrindRunConfigurationAspect : public IRunConfigurationAspect { public: ValgrindRunConfigurationAspect(RunConfiguration *parent) : IRunConfigurationAspect(parent) { setProjectSettings(new ValgrindProjectSettings()); setGlobalSettings(ValgrindPlugin::globalSettings()); setId(ANALYZER_VALGRIND_SETTINGS); setDisplayName(QCoreApplication::translate("Valgrind::Internal::ValgrindRunConfigurationAspect", "Valgrind Settings")); setUsingGlobalSettings(true); resetProjectToGlobalSettings(); } IRunConfigurationAspect *create(RunConfiguration *parent) const { return new ValgrindRunConfigurationAspect(parent); } RunConfigWidget *createConfigurationWidget() { return new Analyzer::AnalyzerRunConfigWidget(this); } }; IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc) { return new ValgrindRunConfigurationAspect(rc); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memchecktool.cpp0000644000015301777760000005154112321547255027703 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "memchecktool.h" #include "memcheckengine.h" #include "memcheckerrorview.h" #include "valgrindsettings.h" #include "valgrindplugin.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Analyzer; using namespace ProjectExplorer; using namespace Valgrind::XmlProtocol; namespace Valgrind { namespace Internal { // ---------------------------- MemcheckErrorFilterProxyModel MemcheckErrorFilterProxyModel::MemcheckErrorFilterProxyModel(QObject *parent) : QSortFilterProxyModel(parent), m_filterExternalIssues(false) { } void MemcheckErrorFilterProxyModel::setAcceptedKinds(const QList &acceptedKinds) { if (m_acceptedKinds != acceptedKinds) { m_acceptedKinds = acceptedKinds; invalidate(); } } void MemcheckErrorFilterProxyModel::setFilterExternalIssues(bool filter) { if (m_filterExternalIssues != filter) { m_filterExternalIssues = filter; invalidate(); } } bool MemcheckErrorFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { // We only deal with toplevel items. if (sourceParent.isValid()) return true; // Because toplevel items have no parent, we can't use sourceParent to find them. we just use // sourceParent as an invalid index, telling the model that the index we're looking for has no // parent. QAbstractItemModel *model = sourceModel(); QModelIndex sourceIndex = model->index(sourceRow, filterKeyColumn(), sourceParent); if (!sourceIndex.isValid()) return true; const Error error = sourceIndex.data(ErrorListModel::ErrorRole).value(); // Filter on kind if (!m_acceptedKinds.contains(error.kind())) return false; // Filter non-project stuff if (m_filterExternalIssues && !error.stacks().isEmpty()) { // ALGORITHM: look at last five stack frames, if none of these is inside any open projects, // assume this error was created by an external library QSet validFolders; foreach (Project *project, SessionManager::projects()) { validFolders << project->projectDirectory(); foreach (Target *target, project->targets()) { foreach (BuildConfiguration *config, target->buildConfigurations()) validFolders << config->buildDirectory().toString(); } } const QVector< Frame > frames = error.stacks().first().frames(); const int framesToLookAt = qMin(6, frames.size()); bool inProject = false; for (int i = 0; i < framesToLookAt; ++i) { const Frame &frame = frames.at(i); foreach (const QString &folder, validFolders) { if (frame.object().startsWith(folder)) { inProject = true; break; } } } if (!inProject) return false; } return true; } static void initKindFilterAction(QAction *action, const QList &kinds) { action->setCheckable(true); QVariantList data; foreach (int kind, kinds) data << kind; action->setData(data); } MemcheckTool::MemcheckTool(QObject *parent) : ValgrindTool(parent) { m_settings = 0; m_errorModel = 0; m_errorProxyModel = 0; m_errorView = 0; m_filterMenu = 0; setObjectName(QLatin1String("MemcheckTool")); m_filterProjectAction = new QAction(tr("External Errors"), this); m_filterProjectAction->setToolTip( tr("Show issues originating outside currently opened projects.")); m_filterProjectAction->setCheckable(true); m_suppressionSeparator = new QAction(tr("Suppressions"), this); m_suppressionSeparator->setSeparator(true); m_suppressionSeparator->setToolTip( tr("These suppression files were used in the last memory analyzer run.")); QAction *a = new QAction(tr("Definite Memory Leaks"), this); initKindFilterAction(a, QList() << Leak_DefinitelyLost << Leak_IndirectlyLost); m_errorFilterActions.append(a); a = new QAction(tr("Possible Memory Leaks"), this); initKindFilterAction(a, QList() << Leak_PossiblyLost << Leak_StillReachable); m_errorFilterActions.append(a); a = new QAction(tr("Use of Uninitialized Memory"), this); initKindFilterAction(a, QList() << InvalidRead << InvalidWrite << InvalidJump << Overlap << InvalidMemPool << UninitCondition << UninitValue << SyscallParam << ClientCheck); m_errorFilterActions.append(a); a = new QAction(tr("Invalid Calls to \"free()\""), this); initKindFilterAction(a, QList() << InvalidFree << MismatchedFree); m_errorFilterActions.append(a); } void MemcheckTool::settingsDestroyed(QObject *settings) { QTC_ASSERT(m_settings == settings, return); m_settings = ValgrindPlugin::globalSettings(); } void MemcheckTool::updateFromSettings() { foreach (QAction *action, m_errorFilterActions) { bool contained = true; foreach (const QVariant &v, action->data().toList()) { bool ok; int kind = v.toInt(&ok); if (ok && !m_settings->visibleErrorKinds().contains(kind)) contained = false; } action->setChecked(contained); } m_filterProjectAction->setChecked(!m_settings->filterExternalIssues()); m_errorView->settingsChanged(m_settings); connect(m_settings, SIGNAL(visibleErrorKindsChanged(QList)), m_errorProxyModel, SLOT(setAcceptedKinds(QList))); m_errorProxyModel->setAcceptedKinds(m_settings->visibleErrorKinds()); connect(m_settings, SIGNAL(filterExternalIssuesChanged(bool)), m_errorProxyModel, SLOT(setFilterExternalIssues(bool))); m_errorProxyModel->setFilterExternalIssues(m_settings->filterExternalIssues()); } void MemcheckTool::maybeActiveRunConfigurationChanged() { ValgrindBaseSettings *settings = 0; if (Project *project = SessionManager::startupProject()) if (Target *target = project->activeTarget()) if (RunConfiguration *rc = target->activeRunConfiguration()) if (IRunConfigurationAspect *aspect = rc->extraAspect(ANALYZER_VALGRIND_SETTINGS)) settings = qobject_cast(aspect->currentSettings()); if (!settings) // fallback to global settings settings = ValgrindPlugin::globalSettings(); if (m_settings == settings) return; // disconnect old settings class if any if (m_settings) { m_settings->disconnect(this); m_settings->disconnect(m_errorProxyModel); } // now make the new settings current, update and connect input widgets m_settings = settings; QTC_ASSERT(m_settings, return); connect(m_settings, SIGNAL(destroyed(QObject*)), SLOT(settingsDestroyed(QObject*))); updateFromSettings(); } RunMode MemcheckTool::runMode() const { return MemcheckRunMode; } IAnalyzerTool::ToolMode MemcheckTool::toolMode() const { return DebugMode; } class FrameFinder : public ErrorListModel::RelevantFrameFinder { public: Frame findRelevant(const Error &error) const { const QVector stacks = error.stacks(); if (stacks.isEmpty()) return Frame(); const Stack &stack = stacks[0]; const QVector frames = stack.frames(); if (frames.isEmpty()) return Frame(); //find the first frame belonging to the project if (!m_projectFiles.isEmpty()) { foreach (const Frame &frame, frames) { if (frame.directory().isEmpty() || frame.file().isEmpty()) continue; //filepaths can contain "..", clean them: const QString f = QFileInfo(frame.directory() + QLatin1Char('/') + frame.file()).absoluteFilePath(); if (m_projectFiles.contains(f)) return frame; } } //if no frame belonging to the project was found, return the first one that is not malloc/new foreach (const Frame &frame, frames) { if (!frame.functionName().isEmpty() && frame.functionName() != QLatin1String("malloc") && !frame.functionName().startsWith(QLatin1String("operator new("))) { return frame; } } //else fallback to the first frame return frames.first(); } void setFiles(const QStringList &files) { m_projectFiles = files; } private: QStringList m_projectFiles; }; QWidget *MemcheckTool::createWidgets() { QTC_ASSERT(!m_errorView, return 0); Utils::FancyMainWindow *mw = AnalyzerManager::mainWindow(); m_errorView = new MemcheckErrorView; m_errorView->setObjectName(QLatin1String("MemcheckErrorView")); m_errorView->setFrameStyle(QFrame::NoFrame); m_errorView->setAttribute(Qt::WA_MacShowFocusRect, false); m_errorModel = new ErrorListModel(m_errorView); m_frameFinder = new Internal::FrameFinder; m_errorModel->setRelevantFrameFinder(QSharedPointer(m_frameFinder)); m_errorProxyModel = new MemcheckErrorFilterProxyModel(m_errorView); m_errorProxyModel->setSourceModel(m_errorModel); m_errorProxyModel->setDynamicSortFilter(true); m_errorView->setModel(m_errorProxyModel); m_errorView->setSelectionMode(QAbstractItemView::ExtendedSelection); // make m_errorView->selectionModel()->selectedRows() return something m_errorView->setSelectionBehavior(QAbstractItemView::SelectRows); m_errorView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_errorView->setAutoScroll(false); m_errorView->setObjectName(QLatin1String("Valgrind.MemcheckTool.ErrorView")); QDockWidget *errorDock = AnalyzerManager::createDockWidget (this, tr("Memory Issues"), m_errorView, Qt::BottomDockWidgetArea); errorDock->show(); mw->splitDockWidget(mw->toolBarDockWidget(), errorDock, Qt::Vertical); connect(ProjectExplorerPlugin::instance(), SIGNAL(updateRunActions()), SLOT(maybeActiveRunConfigurationChanged())); // // The Control Widget. // QAction *action = 0; QHBoxLayout *layout = new QHBoxLayout; QToolButton *button = 0; layout->setMargin(0); layout->setSpacing(0); // Load external XML log file action = new QAction(this); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_OPENFILE))); action->setToolTip(tr("Load External XML Log File")); connect(action, SIGNAL(triggered(bool)), this, SLOT(loadExternalXmlLogFile())); button = new QToolButton; button->setDefaultAction(action); layout->addWidget(button); m_loadExternalLogFile = action; // Go to previous leak. action = new QAction(this); action->setDisabled(true); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_PREV))); action->setToolTip(tr("Go to previous leak.")); connect(action, SIGNAL(triggered(bool)), m_errorView, SLOT(goBack())); button = new QToolButton; button->setDefaultAction(action); layout->addWidget(button); m_goBack = action; // Go to next leak. action = new QAction(this); action->setDisabled(true); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_NEXT))); action->setToolTip(tr("Go to next leak.")); connect(action, SIGNAL(triggered(bool)), m_errorView, SLOT(goNext())); button = new QToolButton; button->setDefaultAction(action); layout->addWidget(button); m_goNext = action; QToolButton *filterButton = new QToolButton; filterButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER))); filterButton->setText(tr("Error Filter")); filterButton->setPopupMode(QToolButton::InstantPopup); m_filterMenu = new QMenu(filterButton); foreach (QAction *filterAction, m_errorFilterActions) m_filterMenu->addAction(filterAction); m_filterMenu->addSeparator(); m_filterMenu->addAction(m_filterProjectAction); m_filterMenu->addAction(m_suppressionSeparator); connect(m_filterMenu, SIGNAL(triggered(QAction*)), SLOT(updateErrorFilter())); filterButton->setMenu(m_filterMenu); layout->addWidget(filterButton); layout->addStretch(); QWidget *widget = new QWidget; widget->setObjectName(QLatin1String("MemCheckToolBarWidget")); widget->setLayout(layout); return widget; } AnalyzerRunControl *MemcheckTool::createRunControl(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration) { m_frameFinder->setFiles(runConfiguration ? runConfiguration->target() ->project()->files(Project::AllFiles) : QStringList()); MemcheckRunControl *engine = new MemcheckRunControl(sp, runConfiguration); connect(engine, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)), this, SLOT(engineStarting(const Analyzer::AnalyzerRunControl*))); connect(engine, SIGNAL(parserError(Valgrind::XmlProtocol::Error)), this, SLOT(parserError(Valgrind::XmlProtocol::Error))); connect(engine, SIGNAL(internalParserError(QString)), this, SLOT(internalParserError(QString))); connect(engine, SIGNAL(finished()), this, SLOT(engineFinished())); return engine; } void MemcheckTool::engineStarting(const AnalyzerRunControl *engine) { setBusyCursor(true); clearErrorView(); m_loadExternalLogFile->setDisabled(true); QString dir; if (RunConfiguration *rc = engine->runConfiguration()) dir = rc->target()->project()->projectDirectory() + QDir::separator(); const MemcheckRunControl *mEngine = dynamic_cast(engine); QTC_ASSERT(mEngine, return); const QString name = QFileInfo(mEngine->executable()).fileName(); m_errorView->setDefaultSuppressionFile(dir + name + QLatin1String(".supp")); foreach (const QString &file, mEngine->suppressionFiles()) { QAction *action = m_filterMenu->addAction(QFileInfo(file).fileName()); action->setToolTip(file); action->setData(file); connect(action, SIGNAL(triggered(bool)), this, SLOT(suppressionActionTriggered())); m_suppressionActions.append(action); } } void MemcheckTool::suppressionActionTriggered() { QAction *action = qobject_cast(sender()); QTC_ASSERT(action, return); const QString file = action->data().toString(); QTC_ASSERT(!file.isEmpty(), return); Core::EditorManager::openEditorAt(file, 0); } void MemcheckTool::loadExternalXmlLogFile() { const QString filePath = QFileDialog::getOpenFileName( Core::ICore::mainWindow(), tr("Open Memcheck XML Log File"), QString(), tr("XML Files (*.xml);;All Files (*)")); if (filePath.isEmpty()) return; QFile *logFile = new QFile(filePath); if (!logFile->open(QIODevice::ReadOnly | QIODevice::Text)) { delete logFile; QMessageBox::critical(m_errorView, tr("Internal Error"), tr("Failed to open file for reading: %1").arg(filePath)); return; } setBusyCursor(true); clearErrorView(); m_loadExternalLogFile->setDisabled(true); if (!m_settings || m_settings != ValgrindPlugin::globalSettings()) { m_settings = ValgrindPlugin::globalSettings(); m_errorView->settingsChanged(m_settings); updateFromSettings(); } ThreadedParser *parser = new ThreadedParser; connect(parser, SIGNAL(error(Valgrind::XmlProtocol::Error)), this, SLOT(parserError(Valgrind::XmlProtocol::Error))); connect(parser, SIGNAL(internalError(QString)), this, SLOT(internalParserError(QString))); connect(parser, SIGNAL(finished()), this, SLOT(loadingExternalXmlLogFileFinished())); connect(parser, SIGNAL(finished()), parser, SLOT(deleteLater())); parser->parse(logFile); // ThreadedParser owns the file } void MemcheckTool::parserError(const Valgrind::XmlProtocol::Error &error) { m_errorModel->addError(error); } void MemcheckTool::internalParserError(const QString &errorString) { QMessageBox::critical(m_errorView, tr("Internal Error"), tr("Error occurred parsing Valgrind output: %1").arg(errorString)); } void MemcheckTool::clearErrorView() { QTC_ASSERT(m_errorView, return); m_errorModel->clear(); qDeleteAll(m_suppressionActions); m_suppressionActions.clear(); //QTC_ASSERT(filterMenu()->actions().last() == m_suppressionSeparator, qt_noop()); } void MemcheckTool::updateErrorFilter() { QTC_ASSERT(m_errorView, return); QTC_ASSERT(m_settings, return); m_settings->setFilterExternalIssues(!m_filterProjectAction->isChecked()); QList errorKinds; foreach (QAction *a, m_errorFilterActions) { if (!a->isChecked()) continue; foreach (const QVariant &v, a->data().toList()) { bool ok; int kind = v.toInt(&ok); if (ok) errorKinds << kind; } } m_settings->setVisibleErrorKinds(errorKinds); } int MemcheckTool::updateUiAfterFinishedHelper() { const int issuesFound = m_errorModel->rowCount(); m_goBack->setEnabled(issuesFound > 1); m_goNext->setEnabled(issuesFound > 1); m_loadExternalLogFile->setEnabled(true); setBusyCursor(false); return issuesFound; } void MemcheckTool::engineFinished() { const int issuesFound = updateUiAfterFinishedHelper(); AnalyzerManager::showStatusMessage(issuesFound > 0 ? AnalyzerManager::tr("Memory Analyzer Tool finished, %n issues were found.", 0, issuesFound) : AnalyzerManager::tr("Memory Analyzer Tool finished, no issues were found.")); } void MemcheckTool::loadingExternalXmlLogFileFinished() { const int issuesFound = updateUiAfterFinishedHelper(); AnalyzerManager::showStatusMessage(issuesFound > 0 ? AnalyzerManager::tr("Log file processed, %n issues were found.", 0, issuesFound) : AnalyzerManager::tr("Log file processed, no issues were found.")); } void MemcheckTool::setBusyCursor(bool busy) { QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor); m_errorView->setCursor(cursor); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindtool.cpp0000644000015301777760000001433612321547255027736 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindtool.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Analyzer; using namespace Core; using namespace ProjectExplorer; namespace Valgrind { namespace Internal { ValgrindTool::ValgrindTool(QObject *parent) : IAnalyzerTool(parent) {} static bool buildTypeAccepted(IAnalyzerTool::ToolMode toolMode, BuildConfiguration::BuildType buildType) { if (toolMode == IAnalyzerTool::AnyMode) return true; if (buildType == BuildConfiguration::Unknown) return true; if (buildType == BuildConfiguration::Debug && toolMode == IAnalyzerTool::DebugMode) return true; if (buildType == BuildConfiguration::Release && toolMode == IAnalyzerTool::ReleaseMode) return true; return false; } static void startLocalTool(IAnalyzerTool *tool) { // Make sure mode is shown. AnalyzerManager::showMode(); // ### not sure if we're supposed to check if the RunConFiguration isEnabled Project *pro = SessionManager::startupProject(); BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown; if (pro) { if (const Target *target = pro->activeTarget()) { // Build configuration is 0 for QML projects. if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration()) buildType = buildConfig->buildType(); } } // Check the project for whether the build config is in the correct mode // if not, notify the user and urge him to use the correct mode. if (!buildTypeAccepted(tool->toolMode(), buildType)) { const QString currentMode = buildType == BuildConfiguration::Debug ? AnalyzerManager::tr("Debug") : AnalyzerManager::tr("Release"); QString toolModeString; switch (tool->toolMode()) { case IAnalyzerTool::DebugMode: toolModeString = AnalyzerManager::tr("Debug"); break; case IAnalyzerTool::ReleaseMode: toolModeString = AnalyzerManager::tr("Release"); break; default: QTC_CHECK(false); } //const QString toolName = tool->displayName(); const QString toolName = AnalyzerManager::tr("Tool"); // FIXME const QString title = AnalyzerManager::tr("Run %1 in %2 Mode?").arg(toolName).arg(currentMode); const QString message = AnalyzerManager::tr("

You are trying " "to run the tool \"%1\" on an application in %2 mode. " "The tool is designed to be used in %3 mode.

" "Debug and Release mode run-time characteristics differ " "significantly, analytical findings for one mode may or " "may not be relevant for the other.

" "Do you want to continue and run the tool in %2 mode?

") .arg(toolName).arg(currentMode).arg(toolModeString); if (Utils::CheckableMessageBox::doNotAskAgainQuestion(ICore::mainWindow(), title, message, ICore::settings(), QLatin1String("AnalyzerCorrectModeWarning"), QDialogButtonBox::Yes|QDialogButtonBox::Cancel, QDialogButtonBox::Cancel, QDialogButtonBox::Yes) != QDialogButtonBox::Yes) return; } ProjectExplorerPlugin::instance()->runProject(pro, tool->runMode()); } static void startRemoteTool(IAnalyzerTool *tool) { StartRemoteDialog dlg; if (dlg.exec() != QDialog::Accepted) return; AnalyzerStartParameters sp; sp.startMode = StartRemote; sp.connParams = dlg.sshParams(); sp.debuggee = dlg.executable(); sp.debuggeeArgs = dlg.arguments(); sp.displayName = dlg.executable(); sp.workingDirectory = dlg.workingDirectory(); AnalyzerRunControl *rc = tool->createRunControl(sp, 0); QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt())); ProjectExplorerPlugin::instance()->startRunControl(rc, tool->runMode()); } void ValgrindTool::startTool(StartMode mode) { if (mode == StartLocal) startLocalTool(this); if (mode == StartRemote) startRemoteTool(this); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindcostview.h0000644000015301777760000000447712321547255030427 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDCOSTVIEW_H #define CALLGRINDCOSTVIEW_H #include "callgrindcostdelegate.h" #include namespace Valgrind { namespace Internal { class CostDelegate; class NameDelegate; class CostView : public Utils::BaseTreeView { Q_OBJECT public: explicit CostView(QWidget *parent = 0); ~CostView(); /** * Overload automatically updates the cost delegate * and sets it for the cost columns of DataModel and CallModel. */ void setModel(QAbstractItemModel *model); /** * How to format cost data columns in the view. */ void setCostFormat(CostDelegate::CostFormat format); CostDelegate::CostFormat costFormat() const; void contextMenuEvent(QContextMenuEvent *ev); private: CostDelegate *m_costDelegate; NameDelegate *m_nameDelegate; }; } // namespace Internal } // namespace Valgrind #endif // CALLGRINDCOSTVIEW_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindprocess.h0000644000015301777760000000677612321547255030115 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRINDPROCESS_H #define VALGRINDPROCESS_H #include #include #include #include namespace Valgrind { struct Remote { QSsh::SshConnectionParameters m_params; QSsh::SshConnection *m_connection; QSsh::SshRemoteProcess::Ptr m_process; QString m_workingDir; QString m_valgrindExe; QString m_debuggee; QString m_errorString; QProcess::ProcessError m_error; QSsh::SshRemoteProcess::Ptr m_findPID; }; /** * Process for supplying local and remote valgrind runs */ class ValgrindProcess : public QObject { Q_OBJECT public: ValgrindProcess(bool isLocal, const QSsh::SshConnectionParameters &sshParams, QSsh::SshConnection *connection = 0, QObject *parent = 0); bool isRunning() const; void run(const QString &valgrindExecutable, const QStringList &valgrindArguments, const QString &debuggeeExecutable, const QString &debuggeeArguments); void close(); QString errorString() const; QProcess::ProcessError error() const; void setProcessChannelMode(QProcess::ProcessChannelMode mode); void setWorkingDirectory(const QString &path); QString workingDirectory() const; void setEnvironment(const Utils::Environment &environment); qint64 pid() const; QSsh::SshConnection *connection() const; bool isLocal() const { return m_isLocal; } signals: void started(); void finished(int, QProcess::ExitStatus); void error(QProcess::ProcessError); void processOutput(const QByteArray &, Utils::OutputFormat format); private slots: void handleReadyReadStandardError(); void handleReadyReadStandardOutput(); void handleError(QSsh::SshError); void closed(int); void connected(); void processStarted(); void findPIDOutputReceived(); private: Utils::QtcProcess m_localProcess; qint64 m_pid; Remote m_remote; QString m_arguments; bool m_isLocal; }; } // namespace Valgrind #endif // VALGRINDPROCESS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindconfigwidget.ui0000644000015301777760000003403212321547255031260 0ustar pbusernogroup00000000000000 Valgrind::Internal::ValgrindConfigWidget 0 0 655 364 0 0 Generic Settings Valgrind executable: 1 0 Detect self-modifying code: 1 No Only on Stack Everywhere Everywhere Except in File-backend Mappings Qt::Horizontal 40 20 0 0 Profiling Options Limits the amount of results the profiler gives you. A lower limit will likely increase performance. Result view: Minimum event cost: minimumInclusiveCostRatio % 2 10.000000000000000 0.100000000000000 Show additional information for events in tooltips true <html><head/><body> <p>Does full cache simulation.</p> <p>By default, only instruction read accesses will be counted ("Ir").</p> <p> With cache simulation, further event counters are enabled: <ul><li>Cache misses on instruction reads ("I1mr"/"I2mr")</li> <li>Data read accesses ("Dr") and related cache misses ("D1mr"/"D2mr")</li> <li>Data write accesses ("Dw") and related cache misses ("D1mw"/"D2mw")</li></ul> </p> </body></html> Enable cache simulation <html><head/><body> <p>Do branch prediction simulation.</p> <p>Further event counters are enabled: </p> <ul><li>Number of executed conditional branches and related predictor misses ( "Bc"/"Bcm")</li> <li>Executed indirect jumps and related misses of the jump address predictor ( "Bi"/"Bim")</li></ul></body></html> Enable branch prediction simulation Collect information for system call times. Collect system call time Collect the number of global bus events that are executed. The event type "Ge" is used for these events. Collect global bus events Visualization: Minimum event cost: % 0.000000000000000 50.000000000000000 Qt::Vertical QSizePolicy::Expanding 1 500 0 0 Memory Analysis Options Track origins of uninitialized memory true Show reachable and indirectly lost blocks Check for leaks on finish: 0 No Summary Only Full Qt::Horizontal 40 20 Backtrace frame count: numCallers 5 50 12 Qt::Horizontal 40 20 Suppression files: suppressionList 0 1 QLayout::SetMinimumSize Add... Remove false Qt::Vertical 20 40 Utils::PathChooser QWidget
utils/pathchooser.h
1
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindtextmark.cpp0000644000015301777760000000655512321547255030755 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindtextmark.h" #include "callgrindhelper.h" #include "callgrind/callgrinddatamodel.h" #include "callgrind/callgrindfunction.h" #include #include #include using namespace Valgrind::Internal; using namespace Valgrind::Callgrind; CallgrindTextMark::CallgrindTextMark(const QPersistentModelIndex &index, const QString &fileName, int lineNumber) : TextEditor::BaseTextMark(fileName, lineNumber), m_modelIndex(index) { setPriority(TextEditor::ITextMark::HighPriority); setWidthFactor(4.0); } void CallgrindTextMark::paint(QPainter *painter, const QRect &paintRect) const { if (!m_modelIndex.isValid()) return; bool ok; qreal costs = m_modelIndex.data(RelativeTotalCostRole).toReal(&ok); QTC_ASSERT(ok, return); QTC_ASSERT(costs >= 0.0 && costs <= 100.0, return); painter->save(); // set up painter->setPen(Qt::black); // draw bar QRect fillRect = paintRect; fillRect.setWidth(paintRect.width() * costs); painter->fillRect(paintRect, Qt::white); painter->fillRect(fillRect, CallgrindHelper::colorForCostRatio(costs)); painter->drawRect(paintRect); // draw text const QTextOption flags = Qt::AlignHCenter | Qt::AlignVCenter; const QString text = CallgrindHelper::toPercent(costs * 100.0f); // decrease font size if paint rect is too small (very unlikely, but may happen) QFont font = painter->font(); QFontMetrics fm = QFontMetrics(font); while (fm.boundingRect(text).width() > paintRect.width()) { font.setPointSize(font.pointSize() - 1); fm = QFontMetrics(font); } painter->setFont(font); painter->drawText(paintRect, text, flags); painter->restore(); } const Function *CallgrindTextMark::function() const { if (!m_modelIndex.isValid()) return 0; return m_modelIndex.data(DataModel::FunctionRole).value(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindconfigwidget.h0000644000015301777760000000500712321547255031072 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ANALYZER_VALGRINDCONFIGWIDGET_H #define ANALYZER_VALGRINDCONFIGWIDGET_H #include QT_BEGIN_NAMESPACE class QStandardItemModel; QT_END_NAMESPACE namespace Valgrind { namespace Internal { namespace Ui { class ValgrindConfigWidget; } class ValgrindBaseSettings; class ValgrindConfigWidget : public QWidget { Q_OBJECT public: ValgrindConfigWidget(ValgrindBaseSettings *settings, QWidget *parent, bool global); virtual ~ValgrindConfigWidget(); void setSuppressions(const QStringList &files); QStringList suppressions() const; public Q_SLOTS: void slotAddSuppression(); void slotRemoveSuppression(); void slotSuppressionsRemoved(const QStringList &files); void slotSuppressionsAdded(const QStringList &files); void slotSuppressionSelectionChanged(); private slots: void updateUi(); private: ValgrindBaseSettings *m_settings; Ui::ValgrindConfigWidget *m_ui; QStandardItemModel *m_model; }; } // namespace Internal } // namespace Valgrind #endif // ANALYZER_VALGRINDCONFIGWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindhelper.cpp0000644000015301777760000000535512321547255030372 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindhelper.h" #include #include #include #include namespace Valgrind { namespace Internal { QColor CallgrindHelper::colorForString(const QString &text) { static QMap colorCache; if (colorCache.contains(text)) return colorCache.value(text); // Minimum lightness of 100 to be readable with black text. const QColor color = QColor::fromHsl(((qreal)qrand() / RAND_MAX * 359), ((qreal)qrand() / RAND_MAX * 255), ((qreal)qrand() / RAND_MAX * 127) + 128); colorCache[text] = color; return color; } QColor CallgrindHelper::colorForCostRatio(qreal ratio) { ratio = qBound(qreal(0.0), ratio, qreal(1.0)); return QColor::fromHsv(120 - ratio * 120, 255, 255, (-((ratio-1) * (ratio-1))) * 120 + 120); } QString CallgrindHelper::toPercent(float costs, const QLocale &locale) { if (costs > 99.9f) return locale.toString(100) + locale.percent(); if (costs > 9.99f) return locale.toString(costs, 'f', 1) + locale.percent(); if (costs > 0.009f) return locale.toString(costs, 'f', 2) + locale.percent(); return QLatin1Char('<') + locale.toString(0.01f) + locale.percent(); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindnamedelegate.cpp0000644000015301777760000000614612321547255031525 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindnamedelegate.h" #include "callgrindhelper.h" #include #include namespace Valgrind { namespace Internal { NameDelegate::NameDelegate(QObject *parent) : QStyledItemDelegate(parent) { } void NameDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { // init QStyleOptionViewItemV4 opt(option); initStyleOption(&opt, index); const int margin = 2; const int size = 10; const QString text = index.data().toString(); QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); // draw controls, but no text opt.text.clear(); style->drawControl(QStyle::CE_ItemViewItem, &opt, painter); // draw bar in the first few pixels painter->save(); const QRectF barRect = opt.rect.adjusted( margin, margin, -opt.rect.width() + size - margin, -margin); painter->setPen(Qt::black); painter->setBrush(CallgrindHelper::colorForString(text)); painter->drawRect(barRect); // move cell rect to right opt.rect.adjust(size+margin, 0, 0, 0); // draw text const QString elidedText = painter->fontMetrics().elidedText(text, Qt::ElideRight, opt.rect.width()); const QBrush &textBrush = (option.state & QStyle::State_Selected) ? opt.palette.highlightedText() : opt.palette.text(); painter->setBrush(Qt::NoBrush); painter->setPen(textBrush.color()); painter->drawText(opt.rect, elidedText); painter->restore(); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindengine.cpp0000644000015301777760000002001512321547255030215 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindengine.h" #include "valgrindsettings.h" #include "valgrindplugin.h" #include #include #include #include #include #include #include #include #include #define VALGRIND_DEBUG_OUTPUT 0 using namespace Analyzer; using namespace Core; using namespace Utils; using namespace ProjectExplorer; namespace Valgrind { namespace Internal { const int progressMaximum = 1000000; ValgrindRunControl::ValgrindRunControl(const AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration) : AnalyzerRunControl(sp, runConfiguration), m_settings(0), m_progress(new QFutureInterface()), m_progressWatcher(new QFutureWatcher()), m_isStopping(false) { if (runConfiguration) if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS)) m_settings = qobject_cast(aspect->currentSettings()); if (!m_settings) m_settings = ValgrindPlugin::globalSettings(); connect(m_progressWatcher, SIGNAL(canceled()), this, SLOT(handleProgressCanceled())); connect(m_progressWatcher, SIGNAL(finished()), this, SLOT(handleProgressFinished())); } ValgrindRunControl::~ValgrindRunControl() { delete m_progress; } bool ValgrindRunControl::startEngine() { emit starting(this); FutureProgress *fp = ProgressManager::addTask(m_progress->future(), progressTitle(), "valgrind"); fp->setKeepOnFinish(FutureProgress::HideOnFinish); m_progress->setProgressRange(0, progressMaximum); m_progress->reportStarted(); m_progressWatcher->setFuture(m_progress->future()); m_progress->setProgressValue(progressMaximum / 10); const AnalyzerStartParameters &sp = startParameters(); #if VALGRIND_DEBUG_OUTPUT emit outputReceived(tr("Valgrind options: %1").arg(toolArguments().join(QLatin1Char(' '))), DebugFormat); emit outputReceived(tr("Working directory: %1").arg(sp.workingDirectory), DebugFormat); emit outputReceived(tr("Command line arguments: %1").arg(sp.debuggeeArgs), DebugFormat); #endif ValgrindRunner *run = runner(); run->setWorkingDirectory(sp.workingDirectory); QString valgrindExe = m_settings->valgrindExecutable(); if (!sp.analyzerCmdPrefix.isEmpty()) valgrindExe = sp.analyzerCmdPrefix + QLatin1Char(' ') + valgrindExe; run->setValgrindExecutable(valgrindExe); run->setValgrindArguments(genericToolArguments() + toolArguments()); run->setDebuggeeExecutable(sp.debuggee); run->setDebuggeeArguments(sp.debuggeeArgs); run->setEnvironment(sp.environment); run->setConnectionParameters(sp.connParams); run->setStartMode(sp.startMode); connect(run, SIGNAL(processOutputReceived(QByteArray,Utils::OutputFormat)), SLOT(receiveProcessOutput(QByteArray,Utils::OutputFormat))); connect(run, SIGNAL(processErrorReceived(QString,QProcess::ProcessError)), SLOT(receiveProcessError(QString,QProcess::ProcessError))); connect(run, SIGNAL(finished()), SLOT(runnerFinished())); if (!run->start()) { m_progress->cancel(); return false; } return true; } void ValgrindRunControl::stopEngine() { m_isStopping = true; runner()->stop(); } QString ValgrindRunControl::executable() const { return startParameters().debuggee; } QStringList ValgrindRunControl::genericToolArguments() const { QTC_ASSERT(m_settings, return QStringList()); QString smcCheckValue; switch (m_settings->selfModifyingCodeDetection()) { case ValgrindBaseSettings::DetectSmcNo: smcCheckValue = QLatin1String("none"); break; case ValgrindBaseSettings::DetectSmcEverywhere: smcCheckValue = QLatin1String("all"); break; case ValgrindBaseSettings::DetectSmcEverywhereButFile: smcCheckValue = QLatin1String("all-non-file"); break; case ValgrindBaseSettings::DetectSmcStackOnly: default: smcCheckValue = QLatin1String("stack"); break; } return QStringList() << QLatin1String("--smc-check=") + smcCheckValue; } void ValgrindRunControl::handleProgressCanceled() { AnalyzerManager::stopTool(); m_progress->reportCanceled(); m_progress->reportFinished(); } void ValgrindRunControl::handleProgressFinished() { QApplication::alert(ICore::mainWindow(), 3000); } void ValgrindRunControl::runnerFinished() { appendMessage(tr("Analyzing finished.") + QLatin1Char('\n'), NormalMessageFormat); emit finished(); m_progress->reportFinished(); disconnect(runner(), SIGNAL(processOutputReceived(QByteArray,Utils::OutputFormat)), this, SLOT(receiveProcessOutput(QByteArray,Utils::OutputFormat))); disconnect(runner(), SIGNAL(finished()), this, SLOT(runnerFinished())); } void ValgrindRunControl::receiveProcessOutput(const QByteArray &output, OutputFormat format) { int progress = m_progress->progressValue(); if (progress < 5 * progressMaximum / 10) progress += progress / 100; else if (progress < 9 * progressMaximum / 10) progress += progress / 1000; m_progress->setProgressValue(progress); appendMessage(QString::fromLocal8Bit(output), format); } void ValgrindRunControl::receiveProcessError(const QString &message, QProcess::ProcessError error) { if (error == QProcess::FailedToStart) { const QString valgrind = m_settings->valgrindExecutable(); if (!valgrind.isEmpty()) appendMessage(tr("Error: \"%1\" could not be started: %2").arg(valgrind, message) + QLatin1Char('\n'), ErrorMessageFormat); else appendMessage(tr("Error: no Valgrind executable set.") + QLatin1Char('\n'), ErrorMessageFormat); } else if (m_isStopping && error == QProcess::Crashed) { // process gets killed on stop appendMessage(tr("Process terminated.") + QLatin1Char('\n'), ErrorMessageFormat); } else { appendMessage(QString::fromLatin1("** %1 **\n").arg(message), ErrorMessageFormat); } if (m_isStopping) return; QObject *obj = ExtensionSystem::PluginManager::getObjectByName(QLatin1String("AppOutputPane")); if (IOutputPane *pane = qobject_cast(obj)) pane->popup(IOutputPane::NoModeSwitch); } } // namespace Internal } // namepsace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindruncontrolfactory.h0000644000015301777760000000456512321547255032226 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Kläralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRINDRUNCONTROLFACTORY_H #define VALGRINDRUNCONTROLFACTORY_H #include namespace Valgrind { namespace Internal { class ValgrindRunControlFactory : public ProjectExplorer::IRunControlFactory { Q_OBJECT public: typedef ProjectExplorer::RunConfiguration RunConfiguration; explicit ValgrindRunControlFactory(QObject *parent = 0); // IRunControlFactory implementation bool canRun(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, QString *errorMessage); ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(ProjectExplorer::RunConfiguration *rc); }; } // namespace Internal } // namespace Valgrind #endif // VALGRINDRUNCONTROLFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindrunner.h0000644000015301777760000000666112321547255027741 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRIND_RUNNER_H #define VALGRIND_RUNNER_H #include #include #include #include namespace Utils { class Environment; class SshConnectionParameters; } namespace Valgrind { class ValgrindProcess; class ValgrindRunner : public QObject { Q_OBJECT public: explicit ValgrindRunner(QObject *parent = 0); ~ValgrindRunner(); QString valgrindExecutable() const; void setValgrindExecutable(const QString &executable); QStringList valgrindArguments() const; void setValgrindArguments(const QStringList &toolArguments); QString debuggeeExecutable() const; void setDebuggeeExecutable(const QString &executable); QString debuggeeArguments() const; void setDebuggeeArguments(const QString &arguments); void setWorkingDirectory(const QString &path); QString workingDirectory() const; void setEnvironment(const Utils::Environment &environment); void setProcessChannelMode(QProcess::ProcessChannelMode mode); void setStartMode(Analyzer::StartMode startMode); Analyzer::StartMode startMode() const; void setConnectionParameters(const QSsh::SshConnectionParameters &connParams); const QSsh::SshConnectionParameters &connectionParameters() const; void waitForFinished() const; QString errorString() const; virtual bool start(); virtual void stop(); ValgrindProcess *valgrindProcess() const; protected: virtual QString tool() const = 0; signals: void processOutputReceived(const QByteArray &, Utils::OutputFormat); void processErrorReceived(const QString &, QProcess::ProcessError); void started(); void finished(); protected slots: virtual void processError(QProcess::ProcessError); virtual void processStarted(); virtual void processFinished(int, QProcess::ExitStatus); private: class Private; Private *d; }; } // namespace Valgrind #endif // VALGRIND_RUNNER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrind_dependencies.pri0000644000015301777760000000027512321547255031553 0ustar pbusernogroup00000000000000QTC_PLUGIN_NAME = Valgrind QTC_LIB_DEPENDS += \ cplusplus \ utils QTC_PLUGIN_DEPENDS += \ analyzerbase \ coreplugin \ projectexplorer \ texteditor \ remotelinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindcostdelegate.h0000644000015301777760000000475612321547255031227 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDCOSTDELEGATE_H #define CALLGRINDCOSTDELEGATE_H #include namespace Valgrind { namespace Internal { class CostDelegate : public QStyledItemDelegate { public: explicit CostDelegate(QObject *parent = 0); virtual ~CostDelegate(); virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; void setModel(QAbstractItemModel *model); enum CostFormat { /// show absolute numbers FormatAbsolute, /// show percentages relative to the total inclusive cost FormatRelative, /// show percentages relative to the parent cost FormatRelativeToParent }; void setFormat(CostFormat format); CostFormat format() const; private: class Private; Private *d; }; } // namespace Internal } // namespace Valgrind Q_DECLARE_METATYPE(Valgrind::Internal::CostDelegate::CostFormat) #endif // CALLGRINDCOSTDELEGATE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindtool.cpp0000644000015301777760000010167612321547255030073 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindtool.h" #include "callgrindcostdelegate.h" #include "callgrindcostview.h" #include "callgrindengine.h" #include "callgrindtextmark.h" #include "callgrindvisualisation.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // shared/cplusplus includes #include using namespace Analyzer; using namespace Core; using namespace Valgrind::Callgrind; using namespace ProjectExplorer; namespace Valgrind { namespace Internal { class CallgrindToolPrivate : public QObject { Q_OBJECT public: friend class CallgrindTool; explicit CallgrindToolPrivate(CallgrindTool *parent); virtual ~CallgrindToolPrivate(); void setParseData(ParseData *data); CostDelegate::CostFormat costFormat() const; QWidget *createWidgets(); void doClear(bool clearParseData); void updateEventCombo(); AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration = 0); signals: void cycleDetectionEnabled(bool enabled); void dumpRequested(); void resetRequested(); void pauseToggled(bool checked); public slots: void slotClear(); void slotRequestDump(); void loadExternalXmlLogFile(); void selectFunction(const Valgrind::Callgrind::Function *); void setCostFormat(Valgrind::Internal::CostDelegate::CostFormat format); void enableCycleDetection(bool enabled); void shortenTemplates(bool enabled); void setCostEvent(int index); /// This function will add custom text marks to the editor /// \note Call this after the data model has been populated void createTextMarks(); /// This function will clear all text marks from the editor void clearTextMarks(); void updateFilterString(); void updateCostFormat(); void handleFilterProjectCosts(); void handleShowCostsAction(); void handleShowCostsOfFunction(); void slotGoToOverview(); void stackBrowserChanged(); /// If \param busy is true, all widgets get a busy cursor when hovered void setBusyCursor(bool busy); void dataFunctionSelected(const QModelIndex &index); void calleeFunctionSelected(const QModelIndex &index); void callerFunctionSelected(const QModelIndex &index); void visualisationFunctionSelected(const Valgrind::Callgrind::Function *function); void showParserResults(const Valgrind::Callgrind::ParseData *data); void takeParserData(CallgrindRunControl *rc); void takeParserData(ParseData *data); void engineStarting(const Analyzer::AnalyzerRunControl *); void engineFinished(); void editorOpened(Core::IEditor *); void requestContextMenu(TextEditor::ITextEditor *editor, int line, QMenu *menu); public: CallgrindTool *q; DataModel *m_dataModel; DataProxyModel *m_proxyModel; StackBrowser *m_stackBrowser; CallModel *m_callersModel; CallModel *m_calleesModel; // callgrind widgets CostView *m_flatView; CostView *m_callersView; CostView *m_calleesView; Visualisation *m_visualisation; // navigation QAction *m_goBack; QAction *m_goNext; QLineEdit *m_searchFilter; // cost formatting QAction *m_filterProjectCosts; QAction *m_costAbsolute; QAction *m_costRelative; QAction *m_costRelativeToParent; QAction *m_cycleDetection; QAction *m_shortenTemplates; QComboBox *m_eventCombo; QTimer *m_updateTimer; QVector m_textMarks; QAction *m_loadExternalLogFile; QAction *m_dumpAction; QAction *m_resetAction; QAction *m_pauseAction; QString m_toggleCollectFunction; }; CallgrindToolPrivate::CallgrindToolPrivate(CallgrindTool *parent) : q(parent) , m_dataModel(new DataModel(this)) , m_proxyModel(new DataProxyModel(this)) , m_stackBrowser(new StackBrowser(this)) , m_callersModel(new CallModel(this)) , m_calleesModel(new CallModel(this)) , m_flatView(0) , m_callersView(0) , m_calleesView(0) , m_visualisation(0) , m_goBack(0) , m_goNext(0) , m_searchFilter(0) , m_filterProjectCosts(0) , m_costAbsolute(0) , m_costRelative(0) , m_costRelativeToParent(0) , m_eventCombo(0) , m_updateTimer(new QTimer(this)) , m_dumpAction(0) , m_resetAction(0) , m_pauseAction(0) { m_updateTimer->setInterval(200); m_updateTimer->setSingleShot(true); m_proxyModel->setSourceModel(m_dataModel); m_proxyModel->setDynamicSortFilter(true); m_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); m_proxyModel->setFilterKeyColumn(DataModel::NameColumn); m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); connect(m_stackBrowser, SIGNAL(currentChanged()), SLOT(stackBrowserChanged())); connect(m_updateTimer, SIGNAL(timeout()), SLOT(updateFilterString())); } CallgrindToolPrivate::~CallgrindToolPrivate() { qDeleteAll(m_textMarks); doClear(false); } void CallgrindToolPrivate::slotGoToOverview() { selectFunction(0); } void CallgrindToolPrivate::slotClear() { doClear(true); } void CallgrindToolPrivate::doClear(bool clearParseData) { if (clearParseData) // Crashed when done from destructor. setParseData(0); // clear filters if (m_filterProjectCosts) m_filterProjectCosts->setChecked(false); m_proxyModel->setFilterBaseDir(QString()); if (m_searchFilter) m_searchFilter->setText(QString()); m_proxyModel->setFilterFixedString(QString()); } void CallgrindToolPrivate::setBusyCursor(bool busy) { QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor); m_flatView->setCursor(cursor); m_calleesView->setCursor(cursor); m_callersView->setCursor(cursor); m_visualisation->setCursor(cursor); } void CallgrindToolPrivate::selectFunction(const Function *func) { if (!func) { m_flatView->clearSelection(); m_visualisation->setFunction(0); m_callersModel->clear(); m_calleesModel->clear(); return; } const QModelIndex index = m_dataModel->indexForObject(func); const QModelIndex proxyIndex = m_proxyModel->mapFromSource(index); m_flatView->selectionModel()->clearSelection(); m_flatView->selectionModel()->setCurrentIndex(proxyIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); m_flatView->scrollTo(proxyIndex); m_callersModel->setCalls(func->incomingCalls(), func); m_calleesModel->setCalls(func->outgoingCalls(), func); m_visualisation->setFunction(func); const Function *item = m_stackBrowser->current(); if (!item || item != func) m_stackBrowser->select(func); if (QFile::exists(func->file())) { ///TODO: custom position support? int line = func->lineNumber(); EditorManager::openEditorAt(func->file(), qMax(line, 0)); } } void CallgrindToolPrivate::stackBrowserChanged() { m_goBack->setEnabled(m_stackBrowser->hasPrevious()); m_goNext->setEnabled(m_stackBrowser->hasNext()); const Function *item = m_stackBrowser->current(); selectFunction(item); } void CallgrindToolPrivate::updateFilterString() { m_proxyModel->setFilterFixedString(m_searchFilter->text()); } void CallgrindToolPrivate::setCostFormat(CostDelegate::CostFormat format) { switch (format) { case CostDelegate::FormatAbsolute: m_costAbsolute->setChecked(true); break; case CostDelegate::FormatRelative: m_costRelative->setChecked(true); break; case CostDelegate::FormatRelativeToParent: m_costRelativeToParent->setChecked(true); break; } } void CallgrindToolPrivate::setCostEvent(int index) { // prevent assert in model, don't try to set event to -1 // happens when we clear the eventcombo if (index == -1) index = 0; m_dataModel->setCostEvent(index); m_calleesModel->setCostEvent(index); m_callersModel->setCostEvent(index); } void CallgrindToolPrivate::enableCycleDetection(bool enabled) { m_cycleDetection->setChecked(enabled); } void CallgrindToolPrivate::shortenTemplates(bool enabled) { m_shortenTemplates->setChecked(enabled); } // Following functions can be called with actions=0 or widgets=0 // depending on initialization sequence (whether callgrind was current). CostDelegate::CostFormat CallgrindToolPrivate::costFormat() const { if (m_costRelativeToParent && m_costRelativeToParent->isChecked()) return CostDelegate::FormatRelativeToParent; if (m_costRelative && m_costRelative->isChecked()) return CostDelegate::FormatRelative; return CostDelegate::FormatAbsolute; } void CallgrindToolPrivate::updateCostFormat() { const CostDelegate::CostFormat format = costFormat(); if (m_flatView) m_flatView->setCostFormat(format); if (m_calleesView) { m_calleesView->setCostFormat(format); m_callersView->setCostFormat(format); } if (ValgrindGlobalSettings *settings = ValgrindPlugin::globalSettings()) settings->setCostFormat(format); } void CallgrindToolPrivate::handleFilterProjectCosts() { ProjectExplorer::Project *pro = ProjectExplorer::ProjectExplorerPlugin::currentProject(); QTC_ASSERT(pro, return); if (m_filterProjectCosts->isChecked()) { const QString projectDir = pro->projectDirectory(); m_proxyModel->setFilterBaseDir(projectDir); } else { m_proxyModel->setFilterBaseDir(QString()); } } void CallgrindToolPrivate::dataFunctionSelected(const QModelIndex &index) { const Function *func = index.data(DataModel::FunctionRole).value(); QTC_ASSERT(func, return); selectFunction(func); } void CallgrindToolPrivate::calleeFunctionSelected(const QModelIndex &index) { const FunctionCall *call = index.data(CallModel::FunctionCallRole).value(); QTC_ASSERT(call, return); selectFunction(call->callee()); } void CallgrindToolPrivate::callerFunctionSelected(const QModelIndex &index) { const FunctionCall *call = index.data(CallModel::FunctionCallRole).value(); QTC_ASSERT(call, return); selectFunction(call->caller()); } void CallgrindToolPrivate::visualisationFunctionSelected(const Function *function) { if (function && function == m_visualisation->function()) // up-navigation when the initial function was activated m_stackBrowser->goBack(); else selectFunction(function); } void CallgrindToolPrivate::setParseData(ParseData *data) { // we have new parse data, invalidate filters in the proxy model m_visualisation->setFunction(0); // invalidate parse data in the data model delete m_dataModel->parseData(); if (data && data->events().isEmpty()) { // might happen if the user cancelled the profile run // callgrind then sometimes produces empty callgrind.out.PID files delete data; data = 0; } m_dataModel->setParseData(data); m_calleesModel->setParseData(data); m_callersModel->setParseData(data); updateEventCombo(); // clear history for new data m_stackBrowser->clear(); // unset busy state //setBusy(false); } void CallgrindToolPrivate::updateEventCombo() { QTC_ASSERT(m_eventCombo, return); m_eventCombo->clear(); const ParseData *data = m_dataModel->parseData(); if (!data || data->events().isEmpty()) { m_eventCombo->hide(); return; } m_eventCombo->show(); foreach (const QString &event, data->events()) m_eventCombo->addItem(ParseData::prettyStringForEvent(event)); } static QToolButton *createToolButton(QAction *action) { QToolButton *button = new QToolButton; button->setDefaultAction(action); //button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); return button; } CallgrindTool::CallgrindTool(QObject *parent) : ValgrindTool(parent) { d = new CallgrindToolPrivate(this); setObjectName(QLatin1String("CallgrindTool")); connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), d, SLOT(editorOpened(Core::IEditor*))); } CallgrindTool::~CallgrindTool() { delete d; } RunMode CallgrindTool::runMode() const { return CallgrindRunMode; } IAnalyzerTool::ToolMode CallgrindTool::toolMode() const { return ReleaseMode; } AnalyzerRunControl *CallgrindTool::createRunControl(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration) { return d->createRunControl(sp, runConfiguration); } AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration) { CallgrindRunControl *rc = new CallgrindRunControl(sp, runConfiguration); connect(rc, SIGNAL(parserDataReady(CallgrindRunControl*)), SLOT(takeParserData(CallgrindRunControl*))); connect(rc, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)), SLOT(engineStarting(const Analyzer::AnalyzerRunControl*))); connect(rc, SIGNAL(finished()), SLOT(engineFinished())); connect(this, SIGNAL(dumpRequested()), rc, SLOT(dump())); connect(this, SIGNAL(resetRequested()), rc, SLOT(reset())); connect(this, SIGNAL(pauseToggled(bool)), rc, SLOT(setPaused(bool))); // initialize run control rc->setPaused(m_pauseAction->isChecked()); // we may want to toggle collect for one function only in this run rc->setToggleCollectFunction(m_toggleCollectFunction); m_toggleCollectFunction.clear(); QTC_ASSERT(m_visualisation, return rc); // apply project settings if (runConfiguration) { if (IRunConfigurationAspect *analyzerAspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS)) { if (const ValgrindBaseSettings *settings = qobject_cast(analyzerAspect->currentSettings())) { m_visualisation->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0); m_proxyModel->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0); m_dataModel->setVerboseToolTipsEnabled(settings->enableEventToolTips()); } } } return rc; } void CallgrindTool::startTool(StartMode mode) { ValgrindTool::startTool(mode); d->setBusyCursor(true); } void CallgrindTool::loadExternalXmlLogFile() { d->loadExternalXmlLogFile(); } void CallgrindTool::handleShowCostsOfFunction() { d->handleShowCostsOfFunction(); } QWidget *CallgrindTool::createWidgets() { return d->createWidgets(); } QWidget *CallgrindToolPrivate::createWidgets() { QTC_ASSERT(!m_visualisation, return 0); // // DockWidgets // Utils::FancyMainWindow *mw = AnalyzerManager::mainWindow(); m_visualisation = new Visualisation(mw); m_visualisation->setFrameStyle(QFrame::NoFrame); m_visualisation->setObjectName(QLatin1String("Valgrind.CallgrindTool.Visualisation")); m_visualisation->setModel(m_dataModel); connect(m_visualisation, SIGNAL(functionActivated(const Valgrind::Callgrind::Function*)), this, SLOT(visualisationFunctionSelected(const Valgrind::Callgrind::Function*))); m_callersView = new CostView(mw); m_callersView->setObjectName(QLatin1String("Valgrind.CallgrindTool.CallersView")); m_callersView->sortByColumn(CallModel::CostColumn); m_callersView->setFrameStyle(QFrame::NoFrame); // enable sorting QSortFilterProxyModel *callerProxy = new QSortFilterProxyModel(m_callersModel); callerProxy->setSourceModel(m_callersModel); m_callersView->setModel(callerProxy); m_callersView->hideColumn(CallModel::CalleeColumn); connect(m_callersView, SIGNAL(activated(QModelIndex)), this, SLOT(callerFunctionSelected(QModelIndex))); m_calleesView = new CostView(mw); m_calleesView->setObjectName(QLatin1String("Valgrind.CallgrindTool.CalleesView")); m_calleesView->sortByColumn(CallModel::CostColumn); m_calleesView->setFrameStyle(QFrame::NoFrame); // enable sorting QSortFilterProxyModel *calleeProxy = new QSortFilterProxyModel(m_calleesModel); calleeProxy->setSourceModel(m_calleesModel); m_calleesView->setModel(calleeProxy); m_calleesView->hideColumn(CallModel::CallerColumn); connect(m_calleesView, SIGNAL(activated(QModelIndex)), this, SLOT(calleeFunctionSelected(QModelIndex))); m_flatView = new CostView(mw); m_flatView->setObjectName(QLatin1String("Valgrind.CallgrindTool.FlatView")); m_flatView->sortByColumn(DataModel::SelfCostColumn); m_flatView->setFrameStyle(QFrame::NoFrame); m_flatView->setAttribute(Qt::WA_MacShowFocusRect, false); m_flatView->setModel(m_proxyModel); connect(m_flatView, SIGNAL(activated(QModelIndex)), this, SLOT(dataFunctionSelected(QModelIndex))); updateCostFormat(); QDockWidget *callersDock = AnalyzerManager::createDockWidget (q, tr("Callers"), m_callersView, Qt::BottomDockWidgetArea); QDockWidget *flatDock = AnalyzerManager::createDockWidget (q, tr("Functions"), m_flatView, Qt::BottomDockWidgetArea); QDockWidget *calleesDock = AnalyzerManager::createDockWidget (q, tr("Callees"), m_calleesView, Qt::BottomDockWidgetArea); QDockWidget *visualizationDock = AnalyzerManager::createDockWidget (q, tr("Visualization"), m_visualisation, Qt::RightDockWidgetArea); callersDock->show(); calleesDock->show(); flatDock->show(); visualizationDock->hide(); mw->splitDockWidget(mw->toolBarDockWidget(), flatDock, Qt::Vertical); mw->splitDockWidget(mw->toolBarDockWidget(), calleesDock, Qt::Vertical); mw->splitDockWidget(calleesDock, callersDock, Qt::Horizontal); // // Control Widget // QAction *action = 0; QWidget *widget = new QWidget; QHBoxLayout *layout = new QHBoxLayout; layout->setMargin(0); layout->setSpacing(0); widget->setLayout(layout); // load external XML log file action = new QAction(this); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_OPENFILE))); action->setToolTip(tr("Load External XML Log File")); connect(action, SIGNAL(triggered(bool)), this, SLOT(loadExternalXmlLogFile())); layout->addWidget(createToolButton(action)); m_loadExternalLogFile = action; // dump action action = new QAction(this); action->setDisabled(true); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_REDO))); //action->setText(tr("Dump")); action->setToolTip(tr("Request the dumping of profile information. This will update the callgrind visualization.")); connect(action, SIGNAL(triggered()), this, SLOT(slotRequestDump())); layout->addWidget(createToolButton(action)); m_dumpAction = action; // reset action action = new QAction(this); action->setDisabled(true); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_CLEAR))); //action->setText(tr("Reset")); action->setToolTip(tr("Reset all event counters.")); connect(action, SIGNAL(triggered()), this, SIGNAL(resetRequested())); layout->addWidget(createToolButton(action)); m_resetAction = action; // pause action action = new QAction(this); action->setCheckable(true); action->setIcon(QIcon(QLatin1String(":/qml/images/pause-small.png"))); //action->setText(tr("Ignore")); action->setToolTip(tr("Pause event logging. No events are counted which will speed up program execution during profiling.")); connect(action, SIGNAL(toggled(bool)), this, SIGNAL(pauseToggled(bool))); layout->addWidget(createToolButton(action)); m_pauseAction = action; // navigation // go back action = new QAction(this); action->setDisabled(true); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_PREV))); action->setToolTip(tr("Go back one step in history. This will select the previously selected item.")); connect(action, SIGNAL(triggered(bool)), m_stackBrowser, SLOT(goBack())); layout->addWidget(createToolButton(action)); m_goBack = action; // go forward action = new QAction(this); action->setDisabled(true); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_NEXT))); action->setToolTip(tr("Go forward one step in history.")); connect(action, SIGNAL(triggered(bool)), m_stackBrowser, SLOT(goNext())); layout->addWidget(createToolButton(action)); m_goNext = action; layout->addWidget(new Utils::StyledSeparator); // event selection m_eventCombo = new QComboBox; m_eventCombo->setToolTip(tr("Selects which events from the profiling data are shown and visualized.")); connect(m_eventCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setCostEvent(int))); updateEventCombo(); layout->addWidget(m_eventCombo); // cost formatting { QMenu *menu = new QMenu(layout->parentWidget()); QActionGroup *group = new QActionGroup(this); // show costs as absolute numbers m_costAbsolute = new QAction(tr("Absolute Costs"), this); m_costAbsolute->setToolTip(tr("Show costs as absolute numbers.")); m_costAbsolute->setCheckable(true); m_costAbsolute->setChecked(true); connect(m_costAbsolute, SIGNAL(toggled(bool)), SLOT(updateCostFormat())); group->addAction(m_costAbsolute); menu->addAction(m_costAbsolute); // show costs in percentages m_costRelative = new QAction(tr("Relative Costs"), this); m_costRelative->setToolTip(tr("Show costs relative to total inclusive cost.")); m_costRelative->setCheckable(true); connect(m_costRelative, SIGNAL(toggled(bool)), SLOT(updateCostFormat())); group->addAction(m_costRelative); menu->addAction(m_costRelative); // show costs relative to parent m_costRelativeToParent = new QAction(tr("Relative Costs to Parent"), this); m_costRelativeToParent->setToolTip(tr("Show costs relative to parent functions inclusive cost.")); m_costRelativeToParent->setCheckable(true); connect(m_costRelativeToParent, SIGNAL(toggled(bool)), SLOT(updateCostFormat())); group->addAction(m_costRelativeToParent); menu->addAction(m_costRelativeToParent); QToolButton *button = new QToolButton; button->setMenu(menu); button->setPopupMode(QToolButton::InstantPopup); button->setText(QLatin1String("$")); button->setToolTip(tr("Cost Format")); layout->addWidget(button); } ValgrindGlobalSettings *settings = ValgrindPlugin::globalSettings(); // cycle detection //action = new QAction(QLatin1String("Cycle Detection"), this); ///FIXME: icon action = new QAction(QLatin1String("O"), this); ///FIXME: icon action->setToolTip(tr("Enable cycle detection to properly handle recursive or circular function calls.")); action->setCheckable(true); connect(action, SIGNAL(toggled(bool)), m_dataModel, SLOT(enableCycleDetection(bool))); connect(action, SIGNAL(toggled(bool)), settings, SLOT(setDetectCycles(bool))); layout->addWidget(createToolButton(action)); m_cycleDetection = action; // shorter template signature action = new QAction(QLatin1String("<>"), this); action->setToolTip(tr("This removes template parameter lists when displaying function names.")); action->setCheckable(true); connect(action, SIGNAL(toggled(bool)), m_dataModel, SLOT(setShortenTemplates(bool))); connect(action, SIGNAL(toggled(bool)), settings, SLOT(setShortenTemplates(bool))); layout->addWidget(createToolButton(action)); m_shortenTemplates = action; // filtering action = new QAction(tr("Show Project Costs Only"), this); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER))); action->setToolTip(tr("Show only profiling info that originated from this project source.")); action->setCheckable(true); connect(action, SIGNAL(toggled(bool)), this, SLOT(handleFilterProjectCosts())); layout->addWidget(createToolButton(action)); m_filterProjectCosts = action; // filter ///FIXME: find workaround for https://bugreports.qt-project.org/browse/QTCREATORBUG-3247 QLineEdit *filter = new QLineEdit; filter->setPlaceholderText(tr("Filter...")); connect(filter, SIGNAL(textChanged(QString)), m_updateTimer, SLOT(start())); layout->addWidget(filter); m_searchFilter = filter; setCostFormat(settings->costFormat()); enableCycleDetection(settings->detectCycles()); layout->addWidget(new Utils::StyledSeparator); layout->addStretch(); return widget; } void CallgrindToolPrivate::clearTextMarks() { qDeleteAll(m_textMarks); m_textMarks.clear(); } void CallgrindToolPrivate::engineStarting(const Analyzer::AnalyzerRunControl *) { // enable/disable actions m_resetAction->setEnabled(true); m_dumpAction->setEnabled(true); m_loadExternalLogFile->setEnabled(false); clearTextMarks(); slotClear(); } void CallgrindToolPrivate::engineFinished() { // enable/disable actions m_resetAction->setEnabled(false); m_dumpAction->setEnabled(false); m_loadExternalLogFile->setEnabled(true); const ParseData *data = m_dataModel->parseData(); if (data) showParserResults(data); else AnalyzerManager::showStatusMessage(tr("Profiling aborted.")); setBusyCursor(false); } void CallgrindToolPrivate::showParserResults(const ParseData *data) { QString msg; if (data) { // be careful, the list of events might be empty if (data->events().isEmpty()) { msg = tr("Parsing finished, no data."); } else { const QString costStr = QString::fromLatin1("%1 %2").arg(QString::number(data->totalCost(0)), data->events().first()); msg = tr("Parsing finished, total cost of %1 reported.").arg(costStr); } } else { msg = tr("Parsing failed."); } AnalyzerManager::showStatusMessage(msg); } void CallgrindToolPrivate::editorOpened(IEditor *editor) { TextEditor::ITextEditor *textEditor = qobject_cast(editor); if (!textEditor) return; connect(textEditor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)), SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*))); } void CallgrindToolPrivate::requestContextMenu(TextEditor::ITextEditor *editor, int line, QMenu *menu) { // find callgrind text mark that corresponds to this editor's file and line number const Function *func = 0; foreach (CallgrindTextMark *textMark, m_textMarks) { if (textMark->fileName() == editor->document()->filePath() && textMark->lineNumber() == line) { func = textMark->function(); break; } } if (!func) return; // no callgrind text mark under cursor, return // add our action to the context menu QAction *action = new QAction(tr("Select this Function in the Analyzer Output"), menu); connect(action, SIGNAL(triggered()), SLOT(handleShowCostsAction())); action->setData(QVariant::fromValue(func)); menu->addAction(action); } void CallgrindToolPrivate::handleShowCostsAction() { const QAction *action = qobject_cast(sender()); QTC_ASSERT(action, return); const Function *func = action->data().value(); QTC_ASSERT(func, return); selectFunction(func); } void CallgrindToolPrivate::handleShowCostsOfFunction() { CPlusPlus::Symbol *symbol = AnalyzerUtils::findSymbolUnderCursor(); if (!symbol) return; if (!symbol->isFunction()) return; CPlusPlus::Overview view; const QString qualifiedFunctionName = view.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(symbol)); m_toggleCollectFunction = qualifiedFunctionName + QLatin1String("()"); AnalyzerManager::selectTool(q, StartLocal); AnalyzerManager::startTool(); } void CallgrindToolPrivate::slotRequestDump() { //setBusy(true); m_visualisation->setText(tr("Populating...")); dumpRequested(); } void CallgrindToolPrivate::loadExternalXmlLogFile() { const QString filePath = QFileDialog::getOpenFileName( Core::ICore::mainWindow(), tr("Open Callgrind XML Log File"), QString(), tr("XML Files (*.xml);;All Files (*)")); if (filePath.isEmpty()) return; QFile logFile(filePath); if (!logFile.open(QIODevice::ReadOnly | QIODevice::Text)) { QMessageBox::critical(AnalyzerManager::mainWindow(), tr("Internal Error"), tr("Failed to open file for reading: %1").arg(filePath)); return; } AnalyzerManager::showStatusMessage(tr("Parsing Profile Data...")); QCoreApplication::processEvents(); Parser parser; parser.parse(&logFile); takeParserData(parser.takeData()); } void CallgrindToolPrivate::takeParserData(CallgrindRunControl *rc) { takeParserData(rc->takeParserData()); } void CallgrindToolPrivate::takeParserData(ParseData *data) { showParserResults(data); if (!data) return; // clear first clearTextMarks(); slotClear(); setParseData(data); createTextMarks(); } void CallgrindToolPrivate::createTextMarks() { DataModel *model = m_dataModel; QTC_ASSERT(model, return); QList locations; for (int row = 0; row < model->rowCount(); ++row) { const QModelIndex index = model->index(row, DataModel::InclusiveCostColumn); QString fileName = index.data(DataModel::FileNameRole).toString(); if (fileName.isEmpty() || fileName == QLatin1String("???")) continue; bool ok = false; const int lineNumber = index.data(DataModel::LineNumberRole).toInt(&ok); QTC_ASSERT(ok, continue); // sanitize filename, text marks need a canonical (i.e. no ".."s) path // BaseTextMark::editorOpened(Core::IEditor *editor) compares file names on string basis QFileInfo info(fileName); fileName = info.canonicalFilePath(); if (fileName.isEmpty()) continue; // isEmpty == true => file does not exist, continue then // create only one text mark per location const QString location = QString::fromLatin1("%1:%2").arg(fileName, QString::number(lineNumber)); if (locations.contains(location)) continue; locations << location; CallgrindTextMark *mark = new CallgrindTextMark(index, fileName, lineNumber); mark->init(); m_textMarks.append(mark); } } } // namespace Internal } // namespace Valgrind #include "callgrindtool.moc" qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheckengine.cpp0000644000015301777760000001315212321547255030167 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "memcheckengine.h" #include "valgrindsettings.h" #include #include #include #include #include using namespace Analyzer; using namespace ProjectExplorer; using namespace Valgrind::XmlProtocol; namespace Valgrind { namespace Internal { MemcheckRunControl::MemcheckRunControl(const AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration) : ValgrindRunControl(sp, runConfiguration) { connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)), SIGNAL(parserError(Valgrind::XmlProtocol::Error))); connect(&m_parser, SIGNAL(suppressionCount(QString,qint64)), SIGNAL(suppressionCount(QString,qint64))); connect(&m_parser, SIGNAL(internalError(QString)), SIGNAL(internalParserError(QString))); connect(&m_parser, SIGNAL(status(Valgrind::XmlProtocol::Status)), SLOT(status(Valgrind::XmlProtocol::Status))); m_progress->setProgressRange(0, XmlProtocol::Status::Finished + 1); } QString MemcheckRunControl::progressTitle() const { return tr("Analyzing Memory"); } Valgrind::ValgrindRunner *MemcheckRunControl::runner() { return &m_runner; } bool MemcheckRunControl::startEngine() { m_runner.setParser(&m_parser); // Clear about-to-be-outdated tasks. TaskHub::clearTasks(Analyzer::Constants::ANALYZERTASK_ID); appendMessage(tr("Analyzing memory of %1").arg(executable()) + QLatin1Char('\n'), Utils::NormalMessageFormat); return ValgrindRunControl::startEngine(); } void MemcheckRunControl::stopEngine() { disconnect(&m_parser, SIGNAL(internalError(QString)), this, SIGNAL(internalParserError(QString))); ValgrindRunControl::stopEngine(); } QStringList MemcheckRunControl::toolArguments() const { QStringList arguments; arguments << QLatin1String("--gen-suppressions=all"); QTC_ASSERT(m_settings, return arguments); if (m_settings->trackOrigins()) arguments << QLatin1String("--track-origins=yes"); if (m_settings->showReachable()) arguments << QLatin1String("--show-reachable=yes"); QString leakCheckValue; switch (m_settings->leakCheckOnFinish()) { case ValgrindBaseSettings::LeakCheckOnFinishNo: leakCheckValue = QLatin1String("no"); break; case ValgrindBaseSettings::LeakCheckOnFinishYes: leakCheckValue = QLatin1String("full"); break; case ValgrindBaseSettings::LeakCheckOnFinishSummaryOnly: default: leakCheckValue = QLatin1String("summary"); break; } arguments << QLatin1String("--leak-check=") + leakCheckValue; foreach (const QString &file, m_settings->suppressionFiles()) arguments << QString::fromLatin1("--suppressions=%1").arg(file); arguments << QString::fromLatin1("--num-callers=%1").arg(m_settings->numCallers()); return arguments; } QStringList MemcheckRunControl::suppressionFiles() const { return m_settings->suppressionFiles(); } void MemcheckRunControl::status(const Status &status) { m_progress->setProgressValue(status.state() + 1); } void MemcheckRunControl::receiveLogMessage(const QByteArray &b) { QString error = QString::fromLocal8Bit(b); // workaround https://bugs.kde.org/show_bug.cgi?id=255888 error.remove(QRegExp(QLatin1String("==*== "), Qt::CaseSensitive, QRegExp::Wildcard)); error = error.trimmed(); if (error.isEmpty()) return; stopEngine(); QString file; int line = -1; QRegExp suppressionError(QLatin1String("in suppressions file \"([^\"]+)\" near line (\\d+)"), Qt::CaseSensitive, QRegExp::RegExp2); if (suppressionError.indexIn(error) != -1) { file = suppressionError.cap(1); line = suppressionError.cap(2).toInt(); } TaskHub::addTask(Task(Task::Error, error, Utils::FileName::fromUserInput(file), line, Analyzer::Constants::ANALYZERTASK_ID)); TaskHub::requestPopup(); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindplugin.cpp0000644000015301777760000001501412321547255030251 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindplugin.h" #include "callgrindtool.h" #include "memchecktool.h" #include "valgrindruncontrolfactory.h" #include "valgrindsettings.h" #include "valgrindconfigwidget.h" #include #include #include #include #include #include #include #include #include #include #include #include using namespace Analyzer; namespace Valgrind { namespace Internal { static ValgrindGlobalSettings *theGlobalSettings = 0; class ValgrindOptionsPage : public Core::IOptionsPage { public: explicit ValgrindOptionsPage() { setId(ANALYZER_VALGRIND_SETTINGS); setDisplayName(QCoreApplication::translate("Valgrind::Internal::ValgrindOptionsPage", "Valgrind")); setCategory("T.Analyzer"); setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer")); setCategoryIcon(QLatin1String(":/images/analyzer_category.png")); } QWidget *createPage(QWidget *parent) { return new ValgrindConfigWidget(theGlobalSettings, parent, true); } void apply() { theGlobalSettings->writeSettings(); } void finish() {} }; class ValgrindAction : public AnalyzerAction { public: explicit ValgrindAction(QObject *parent = 0) : AnalyzerAction(parent) { } }; ValgrindPlugin::~ValgrindPlugin() { delete theGlobalSettings; theGlobalSettings = 0; } bool ValgrindPlugin::initialize(const QStringList &, QString *) { theGlobalSettings = new ValgrindGlobalSettings(); theGlobalSettings->readSettings(); addAutoReleasedObject(new ValgrindOptionsPage()); m_memcheckTool = new MemcheckTool(this); m_callgrindTool = new CallgrindTool(this); ValgrindAction *action = 0; QString callgrindToolTip = tr("Valgrind Function Profile uses the " "\"callgrind\" tool to record function calls when a program runs."); QString memcheckToolTip = tr("Valgrind Analyze Memory uses the " "\"memcheck\" tool to find memory leaks."); if (!Utils::HostOsInfo::isWindowsHost()) { action = new ValgrindAction(this); action->setId("Memcheck.Local"); action->setTool(m_memcheckTool); action->setText(tr("Valgrind Memory Analyzer")); action->setToolTip(memcheckToolTip); action->setMenuGroup(Constants::G_ANALYZER_TOOLS); action->setStartMode(StartLocal); action->setEnabled(false); AnalyzerManager::addAction(action); action = new ValgrindAction(this); action->setId("Callgrind.Local"); action->setTool(m_callgrindTool); action->setText(tr("Valgrind Function Profiler")); action->setToolTip(callgrindToolTip); action->setMenuGroup(Constants::G_ANALYZER_TOOLS); action->setStartMode(StartLocal); action->setEnabled(false); AnalyzerManager::addAction(action); } action = new ValgrindAction(this); action->setId("Memcheck.Remote"); action->setTool(m_memcheckTool); action->setText(tr("Valgrind Memory Analyzer (Remote)")); action->setToolTip(memcheckToolTip); action->setMenuGroup(Constants::G_ANALYZER_REMOTE_TOOLS); action->setStartMode(StartRemote); AnalyzerManager::addAction(action); action = new ValgrindAction(this); action->setId("Callgrind.Remote"); action->setTool(m_callgrindTool); action->setText(tr("Valgrind Function Profiler (Remote)")); action->setToolTip(callgrindToolTip); action->setMenuGroup(Constants::G_ANALYZER_REMOTE_TOOLS); action->setStartMode(StartRemote); AnalyzerManager::addAction(action); addAutoReleasedObject(new ValgrindRunControlFactory()); return true; } ValgrindGlobalSettings *ValgrindPlugin::globalSettings() { return theGlobalSettings; } void ValgrindPlugin::extensionsInitialized() { using namespace Core; // If there is a CppEditor context menu add our own context menu actions. if (ActionContainer *editorContextMenu = ActionManager::actionContainer(CppEditor::Constants::M_CONTEXT)) { Context analyzerContext = Context(Analyzer::Constants::C_ANALYZEMODE); editorContextMenu->addSeparator(analyzerContext); QAction *action = new QAction(tr("Profile Costs of This Function and Its Callees"), this); action->setIcon(QIcon(QLatin1String(Analyzer::Constants::ANALYZER_CONTROL_START_ICON))); connect(action, SIGNAL(triggered()), m_callgrindTool, SLOT(handleShowCostsOfFunction())); Command *cmd = ActionManager::registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction", analyzerContext); editorContextMenu->addAction(cmd); cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_NonConfigurable); } } } // namespace Internal } // namespace Valgrind Q_EXPORT_PLUGIN(Valgrind::Internal::ValgrindPlugin) qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindtool.h0000644000015301777760000000356112321547255027401 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef VALGRINDTOOL_H #define VALGRINDTOOL_H #include namespace Valgrind { namespace Internal { class ValgrindTool : public Analyzer::IAnalyzerTool { Q_OBJECT public: explicit ValgrindTool(QObject *parent = 0); void startTool(Analyzer::StartMode mode); }; } // namespace Internal } // namespace Valgrind #endif // VALGRIND_TOOL qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrind_test.pri0000644000015301777760000000435012321547255030102 0ustar pbusernogroup00000000000000QT *= network INCLUDEPATH *= $$PWD HEADERS += \ $$PWD/xmlprotocol/frame.h \ $$PWD/xmlprotocol/parser.h \ $$PWD/xmlprotocol/error.h \ $$PWD/xmlprotocol/status.h \ $$PWD/xmlprotocol/suppression.h \ $$PWD/xmlprotocol/threadedparser.h \ $$PWD/xmlprotocol/announcethread.h \ $$PWD/xmlprotocol/stack.h \ $$PWD/xmlprotocol/errorlistmodel.h \ $$PWD/xmlprotocol/stackmodel.h \ $$PWD/xmlprotocol/modelhelpers.h \ $$PWD/callgrind/callgrindparser.h \ $$PWD/callgrind/callgrindparsedata.h \ $$PWD/callgrind/callgrindfunction.h \ $$PWD/callgrind/callgrindfunction_p.h \ $$PWD/callgrind/callgrindfunctioncycle.h \ $$PWD/callgrind/callgrindfunctioncall.h \ $$PWD/callgrind/callgrindcostitem.h \ $$PWD/callgrind/callgrinddatamodel.h \ $$PWD/callgrind/callgrindcallmodel.h \ $$PWD/callgrind/callgrindcontroller.h \ $$PWD/callgrind/callgrindcycledetection.h \ $$PWD/callgrind/callgrindproxymodel.h \ $$PWD/callgrind/callgrindstackbrowser.h \ $$PWD/callgrind/callgrindrunner.h \ $$PWD/memcheck/memcheckrunner.h \ $$PWD/valgrindrunner.h \ $$PWD/valgrindprocess.h SOURCES += $$PWD/xmlprotocol/error.cpp \ $$PWD/xmlprotocol/frame.cpp \ $$PWD/xmlprotocol/parser.cpp \ $$PWD/xmlprotocol/status.cpp \ $$PWD/xmlprotocol/suppression.cpp \ $$PWD/xmlprotocol/threadedparser.cpp \ $$PWD/xmlprotocol/announcethread.cpp \ $$PWD/xmlprotocol/stack.cpp \ $$PWD/xmlprotocol/errorlistmodel.cpp \ $$PWD/xmlprotocol/stackmodel.cpp \ $$PWD/xmlprotocol/modelhelpers.cpp \ $$PWD/callgrind/callgrindparser.cpp \ $$PWD/callgrind/callgrindparsedata.cpp \ $$PWD/callgrind/callgrindfunction.cpp \ $$PWD/callgrind/callgrindfunctioncycle.cpp \ $$PWD/callgrind/callgrindfunctioncall.cpp \ $$PWD/callgrind/callgrindcostitem.cpp \ $$PWD/callgrind/callgrinddatamodel.cpp \ $$PWD/callgrind/callgrindcallmodel.cpp \ $$PWD/callgrind/callgrindcontroller.cpp \ $$PWD/callgrind/callgrindcycledetection.cpp \ $$PWD/callgrind/callgrindproxymodel.cpp \ $$PWD/callgrind/callgrindrunner.cpp \ $$PWD/callgrind/callgrindstackbrowser.cpp \ $$PWD/memcheck/memcheckrunner.cpp \ $$PWD/valgrindrunner.cpp \ $$PWD/valgrindprocess.cpp qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindcostdelegate.cpp0000644000015301777760000001200712321547255031546 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindcostdelegate.h" #include "callgrindcostview.h" #include "callgrindhelper.h" #include "callgrind/callgrindabstractmodel.h" #include "callgrind/callgrindparsedata.h" #include #include #include using namespace Valgrind::Callgrind; namespace Valgrind { namespace Internal { class CostDelegate::Private { public: Private(); QAbstractItemModel *m_model; CostDelegate::CostFormat m_format; float relativeCost(const QModelIndex &index) const; QString displayText(const QModelIndex &index, const QLocale &locale) const; }; CostDelegate::Private::Private() : m_model(0) , m_format(CostDelegate::FormatAbsolute) {} static int toNativeRole(CostDelegate::CostFormat format) { switch (format) { case CostDelegate::FormatAbsolute: case CostDelegate::FormatRelative: return Callgrind::RelativeTotalCostRole; case CostDelegate::FormatRelativeToParent: return Callgrind::RelativeParentCostRole; default: return -1; } } float CostDelegate::Private::relativeCost(const QModelIndex &index) const { bool ok = false; float cost = index.data(toNativeRole(m_format)).toFloat(&ok); QTC_ASSERT(ok, return 0); return cost; } QString CostDelegate::Private::displayText(const QModelIndex &index, const QLocale &locale) const { switch (m_format) { case FormatAbsolute: return locale.toString(index.data().toULongLong()); case FormatRelative: case FormatRelativeToParent: if (!m_model) break; float cost = relativeCost(index) * 100.0f; return CallgrindHelper::toPercent(cost, locale); } return QString(); } CostDelegate::CostDelegate(QObject *parent) : QStyledItemDelegate(parent), d(new Private) { } CostDelegate::~CostDelegate() { delete d; } void CostDelegate::setModel(QAbstractItemModel *model) { d->m_model = model; } void CostDelegate::setFormat(CostFormat format) { d->m_format = format; } CostDelegate::CostFormat CostDelegate::format() const { return d->m_format; } void CostDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyleOptionViewItemV4 opt(option); initStyleOption(&opt, index); QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); // Draw controls, but no text. opt.text.clear(); style->drawControl(QStyle::CE_ItemViewItem, &opt, painter); painter->save(); // Draw bar. float ratio = qBound(0.0f, d->relativeCost(index), 1.0f); QRect barRect = opt.rect; barRect.setWidth(opt.rect.width() * ratio); painter->setPen(Qt::NoPen); painter->setBrush(CallgrindHelper::colorForCostRatio(ratio)); painter->drawRect(barRect); // Draw text. QLocale loc = opt.locale; loc.setNumberOptions(0); const QString text = d->displayText(index, loc); const QBrush &textBrush = (option.state & QStyle::State_Selected ? opt.palette.highlightedText() : opt.palette.text()); painter->setBrush(Qt::NoBrush); painter->setPen(textBrush.color()); painter->drawText(opt.rect, Qt::AlignRight, text); painter->restore(); } QSize CostDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyleOptionViewItemV4 opt(option); initStyleOption(&opt, index); const QString text = d->displayText(index, opt.locale); const QSize size = QSize(option.fontMetrics.width(text), option.fontMetrics.height()); return size; } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindengine.cpp0000644000015301777760000001151412321547255030352 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindengine.h" #include "valgrindsettings.h" #include #include #include #include using namespace Analyzer; using namespace Valgrind; using namespace Valgrind::Internal; CallgrindRunControl::CallgrindRunControl(const AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration) : ValgrindRunControl(sp, runConfiguration) , m_markAsPaused(false) { connect(&m_runner, SIGNAL(finished()), this, SLOT(slotFinished())); connect(&m_runner, SIGNAL(started()), this, SLOT(slotStarted())); connect(m_runner.parser(), SIGNAL(parserDataReady()), this, SLOT(slotFinished())); connect(&m_runner, SIGNAL(statusMessage(QString)), SLOT(showStatusMessage(QString))); m_progress->setProgressRange(0, 2); } void CallgrindRunControl::showStatusMessage(const QString &msg) { AnalyzerManager::showStatusMessage(msg); } QStringList CallgrindRunControl::toolArguments() const { QStringList arguments; QTC_ASSERT(m_settings, return arguments); if (m_settings->enableCacheSim()) arguments << QLatin1String("--cache-sim=yes"); if (m_settings->enableBranchSim()) arguments << QLatin1String("--branch-sim=yes"); if (m_settings->collectBusEvents()) arguments << QLatin1String("--collect-bus=yes"); if (m_settings->collectSystime()) arguments << QLatin1String("--collect-systime=yes"); if (m_markAsPaused) arguments << QLatin1String("--instr-atstart=no"); // add extra arguments if (!m_argumentForToggleCollect.isEmpty()) arguments << m_argumentForToggleCollect; return arguments; } QString CallgrindRunControl::progressTitle() const { return tr("Profiling"); } Valgrind::ValgrindRunner * CallgrindRunControl::runner() { return &m_runner; } bool CallgrindRunControl::startEngine() { appendMessage(tr("Profiling %1").arg(executable()) + QLatin1Char('\n'), Utils::NormalMessageFormat); return ValgrindRunControl::startEngine(); } void CallgrindRunControl::dump() { m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::Dump); } void CallgrindRunControl::setPaused(bool paused) { if (m_markAsPaused == paused) return; m_markAsPaused = paused; // call controller only if it is attached to a valgrind process if (m_runner.controller()->valgrindProcess()) { if (paused) pause(); else unpause(); } } void CallgrindRunControl::setToggleCollectFunction(const QString &toggleCollectFunction) { if (toggleCollectFunction.isEmpty()) return; m_argumentForToggleCollect = QLatin1String("--toggle-collect=") + toggleCollectFunction; } void CallgrindRunControl::reset() { m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::ResetEventCounters); } void CallgrindRunControl::pause() { m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::Pause); } void CallgrindRunControl::unpause() { m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::UnPause); } Valgrind::Callgrind::ParseData *CallgrindRunControl::takeParserData() { return m_runner.parser()->takeData(); } void CallgrindRunControl::slotFinished() { emit parserDataReady(this); } void CallgrindRunControl::slotStarted() { m_progress->setProgressValue(1); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindvisualisation.h0000644000015301777760000000542412321547255031447 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDVISUALISATION_H #define CALLGRINDVISUALISATION_H #include QT_BEGIN_NAMESPACE class QAbstractItemModel; class QModelIndex; QT_END_NAMESPACE namespace Valgrind { namespace Callgrind { class Function; } } namespace Valgrind { namespace Internal { class Visualisation : public QGraphicsView { Q_OBJECT public: explicit Visualisation(QWidget *parent = 0); virtual ~Visualisation(); void setModel(QAbstractItemModel *model); const Valgrind::Callgrind::Function *functionForItem(QGraphicsItem *item) const; QGraphicsItem *itemForFunction(const Valgrind::Callgrind::Function *function) const; void setFunction(const Valgrind::Callgrind::Function *function); const Valgrind::Callgrind::Function *function() const; void setMinimumInclusiveCostRatio(double ratio); public slots: void setText(const QString &message); signals: void functionActivated(const Valgrind::Callgrind::Function *); void functionSelected(const Valgrind::Callgrind::Function *); protected slots: void populateScene(); protected: void mousePressEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); void resizeEvent(QResizeEvent *event); private: class Private; Private *d; }; } // namespace Internal } // namespace Valgrind #endif // VALGRIND_CALLGRIND_CALLGRINDVISUALISATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/workarounds.h0000644000015301777760000000335612321547255027255 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef WORKAROUNDS_H #define WORKAROUNDS_H #include QT_BEGIN_NAMESPACE class QPalette; QT_END_NAMESPACE ///FIXME: remove this once https://bugreports.qt-project.org/browse/QTCREATORBUG-3247 gets fixed QPalette panelPalette(const QPalette &oldPalette, bool lightColored = false); #endif // WORKAROUNDS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindtextmark.h0000644000015301777760000000446312321547255030416 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDTEXTMARK_H #define CALLGRINDTEXTMARK_H #include #include namespace Valgrind { namespace Callgrind { class Function; } namespace Internal { class CallgrindTextMark : public TextEditor::BaseTextMark { public: /** * This creates a callgrind text mark for a specific Function * * \param index DataModel model index * \note The index parameter must refer to one of the DataModel cost columns */ explicit CallgrindTextMark(const QPersistentModelIndex &index, const QString &fileName, int lineNumber); const Valgrind::Callgrind::Function *function() const; virtual void paint(QPainter *painter, const QRect &paintRect) const; private: QPersistentModelIndex m_modelIndex; }; } // namespace Internal } // namespace Valgrind #endif // CALLGRINDTEXTMARK_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheckengine.h0000644000015301777760000000514112321547255027633 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef MEMCHECKENGINE_H #define MEMCHECKENGINE_H #include "valgrindengine.h" #include "memcheck/memcheckrunner.h" #include "xmlprotocol/threadedparser.h" namespace Valgrind { namespace Internal { class MemcheckRunControl : public ValgrindRunControl { Q_OBJECT public: MemcheckRunControl(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration); bool startEngine(); void stopEngine(); QStringList suppressionFiles() const; signals: void internalParserError(const QString &errorString); void parserError(const Valgrind::XmlProtocol::Error &error); void suppressionCount(const QString &name, qint64 count); protected: virtual QString progressTitle() const; virtual QStringList toolArguments() const; virtual ValgrindRunner *runner(); private slots: void receiveLogMessage(const QByteArray &); void status(const Valgrind::XmlProtocol::Status &status); private: XmlProtocol::ThreadedParser m_parser; Memcheck::MemcheckRunner m_runner; }; } // namespace Internal } // namespace Valgrind #endif // MEMCHECKENGINE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/valgrindconfigwidget.cpp0000644000015301777760000002475212321547255031435 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "valgrindconfigwidget.h" #include "valgrindsettings.h" #include "valgrindplugin.h" #include "ui_valgrindconfigwidget.h" #include #include #include #include #include namespace Valgrind { namespace Internal { ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings, QWidget *parent, bool global) : QWidget(parent), m_settings(settings), m_ui(new Ui::ValgrindConfigWidget) { m_ui->setupUi(this); m_model = new QStandardItemModel(this); m_ui->valgrindExeChooser->setExpectedKind(Utils::PathChooser::ExistingCommand); m_ui->valgrindExeChooser->setPromptDialogTitle(tr("Valgrind Command")); updateUi(); connect(m_settings, SIGNAL(changed()), this, SLOT(updateUi())); connect(m_ui->valgrindExeChooser, SIGNAL(changed(QString)), m_settings, SLOT(setValgrindExecutable(QString))); connect(m_settings, SIGNAL(valgrindExecutableChanged(QString)), m_ui->valgrindExeChooser, SLOT(setPath(QString))); connect(m_ui->smcDetectionComboBox, SIGNAL(currentIndexChanged(int)), m_settings, SLOT(setSelfModifyingCodeDetection(int))); if (Utils::HostOsInfo::isWindowsHost()) { // FIXME: On Window we know that we don't have a local valgrind // executable, so having the "Browse" button in the path chooser // (which is needed for the remote executable) is confusing. m_ui->valgrindExeChooser->buttonAtIndex(0)->hide(); } // // Callgrind // connect(m_ui->enableCacheSim, SIGNAL(toggled(bool)), m_settings, SLOT(setEnableCacheSim(bool))); connect(m_settings, SIGNAL(enableCacheSimChanged(bool)), m_ui->enableCacheSim, SLOT(setChecked(bool))); connect(m_ui->enableBranchSim, SIGNAL(toggled(bool)), m_settings, SLOT(setEnableBranchSim(bool))); connect(m_settings, SIGNAL(enableBranchSimChanged(bool)), m_ui->enableBranchSim, SLOT(setChecked(bool))); connect(m_ui->collectSystime, SIGNAL(toggled(bool)), m_settings, SLOT(setCollectSystime(bool))); connect(m_settings, SIGNAL(collectSystimeChanged(bool)), m_ui->collectSystime, SLOT(setChecked(bool))); connect(m_ui->collectBusEvents, SIGNAL(toggled(bool)), m_settings, SLOT(setCollectBusEvents(bool))); connect(m_settings, SIGNAL(collectBusEventsChanged(bool)), m_ui->collectBusEvents, SLOT(setChecked(bool))); connect(m_ui->enableEventToolTips, SIGNAL(toggled(bool)), m_settings, SLOT(setEnableEventToolTips(bool))); connect(m_settings, SIGNAL(enableEventToolTipsChanged(bool)), m_ui->enableEventToolTips, SLOT(setChecked(bool))); connect(m_ui->minimumInclusiveCostRatio, SIGNAL(valueChanged(double)), m_settings, SLOT(setMinimumInclusiveCostRatio(double))); connect(m_settings, SIGNAL(minimumInclusiveCostRatioChanged(double)), m_ui->minimumInclusiveCostRatio, SLOT(setValue(double))); connect(m_ui->visualisationMinimumInclusiveCostRatio, SIGNAL(valueChanged(double)), m_settings, SLOT(setVisualisationMinimumInclusiveCostRatio(double))); connect(m_settings, SIGNAL(visualisationMinimumInclusiveCostRatioChanged(double)), m_ui->visualisationMinimumInclusiveCostRatio, SLOT(setValue(double))); // // Memcheck // m_ui->suppressionList->setModel(m_model); m_ui->suppressionList->setSelectionMode(QAbstractItemView::MultiSelection); connect(m_ui->addSuppression, SIGNAL(clicked()), this, SLOT(slotAddSuppression())); connect(m_ui->removeSuppression, SIGNAL(clicked()), this, SLOT(slotRemoveSuppression())); connect(m_ui->numCallers, SIGNAL(valueChanged(int)), m_settings, SLOT(setNumCallers(int))); connect(m_settings, SIGNAL(numCallersChanged(int)), m_ui->numCallers, SLOT(setValue(int))); connect(m_ui->leakCheckOnFinish, SIGNAL(currentIndexChanged(int)), m_settings, SLOT(setLeakCheckOnFinish(int))); connect(m_settings, SIGNAL(leakCheckOnFinishChanged(int)), m_ui->leakCheckOnFinish, SLOT(setCurrentIndex(int))); connect(m_ui->showReachable, SIGNAL(toggled(bool)), m_settings, SLOT(setShowReachable(bool))); connect(m_settings, SIGNAL(showReachableChanged(bool)), m_ui->showReachable, SLOT(setChecked(bool))); connect(m_ui->trackOrigins, SIGNAL(toggled(bool)), m_settings, SLOT(setTrackOrigins(bool))); connect(m_settings, SIGNAL(trackOriginsChanged(bool)), m_ui->trackOrigins, SLOT(setChecked(bool))); connect(m_settings, SIGNAL(suppressionFilesRemoved(QStringList)), this, SLOT(slotSuppressionsRemoved(QStringList))); connect(m_settings, SIGNAL(suppressionFilesAdded(QStringList)), this, SLOT(slotSuppressionsAdded(QStringList))); connect(m_ui->suppressionList->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSuppressionSelectionChanged())); slotSuppressionSelectionChanged(); if (!global) { // In project settings we want a flat vertical list. QVBoxLayout *l = new QVBoxLayout; while (layout()->count()) if (QWidget *w = layout()->takeAt(0)->widget()) l->addWidget(w); delete layout(); setLayout(l); } } ValgrindConfigWidget::~ValgrindConfigWidget() { delete m_ui; } void ValgrindConfigWidget::updateUi() { m_ui->valgrindExeChooser->setPath(m_settings->valgrindExecutable()); m_ui->smcDetectionComboBox->setCurrentIndex(m_settings->selfModifyingCodeDetection()); m_ui->enableCacheSim->setChecked(m_settings->enableCacheSim()); m_ui->enableBranchSim->setChecked(m_settings->enableBranchSim()); m_ui->collectSystime->setChecked(m_settings->collectSystime()); m_ui->collectBusEvents->setChecked(m_settings->collectBusEvents()); m_ui->enableEventToolTips->setChecked(m_settings->enableEventToolTips()); m_ui->minimumInclusiveCostRatio->setValue(m_settings->minimumInclusiveCostRatio()); m_ui->visualisationMinimumInclusiveCostRatio->setValue(m_settings->visualisationMinimumInclusiveCostRatio()); m_ui->numCallers->setValue(m_settings->numCallers()); m_ui->leakCheckOnFinish->setCurrentIndex(m_settings->leakCheckOnFinish()); m_ui->showReachable->setChecked(m_settings->showReachable()); m_ui->trackOrigins->setChecked(m_settings->trackOrigins()); m_model->clear(); foreach (const QString &file, m_settings->suppressionFiles()) m_model->appendRow(new QStandardItem(file)); } void ValgrindConfigWidget::slotAddSuppression() { ValgrindGlobalSettings *conf = ValgrindPlugin::globalSettings(); QTC_ASSERT(conf, return); QStringList files = QFileDialog::getOpenFileNames(this, tr("Valgrind Suppression Files"), conf->lastSuppressionDialogDirectory(), tr("Valgrind Suppression File (*.supp);;All Files (*)")); //dialog.setHistory(conf->lastSuppressionDialogHistory()); if (!files.isEmpty()) { foreach (const QString &file, files) m_model->appendRow(new QStandardItem(file)); m_settings->addSuppressionFiles(files); conf->setLastSuppressionDialogDirectory(QFileInfo(files.at(0)).absolutePath()); //conf->setLastSuppressionDialogHistory(dialog.history()); } } void ValgrindConfigWidget::slotSuppressionsAdded(const QStringList &files) { QStringList filesToAdd = files; for (int i = 0, c = m_model->rowCount(); i < c; ++i) filesToAdd.removeAll(m_model->item(i)->text()); foreach (const QString &file, filesToAdd) m_model->appendRow(new QStandardItem(file)); } bool sortReverse(int l, int r) { return l > r; } void ValgrindConfigWidget::slotRemoveSuppression() { // remove from end so no rows get invalidated QList rows; QStringList removed; foreach (const QModelIndex &index, m_ui->suppressionList->selectionModel()->selectedIndexes()) { rows << index.row(); removed << index.data().toString(); } qSort(rows.begin(), rows.end(), sortReverse); foreach (int row, rows) m_model->removeRow(row); m_settings->removeSuppressionFiles(removed); } void ValgrindConfigWidget::slotSuppressionsRemoved(const QStringList &files) { for (int i = 0; i < m_model->rowCount(); ++i) { if (files.contains(m_model->item(i)->text())) { m_model->removeRow(i); --i; } } } void ValgrindConfigWidget::setSuppressions(const QStringList &files) { m_model->clear(); foreach (const QString &file, files) m_model->appendRow(new QStandardItem(file)); } QStringList ValgrindConfigWidget::suppressions() const { QStringList ret; for (int i = 0; i < m_model->rowCount(); ++i) ret << m_model->item(i)->text(); return ret; } void ValgrindConfigWidget::slotSuppressionSelectionChanged() { m_ui->removeSuppression->setEnabled(m_ui->suppressionList->selectionModel()->hasSelection()); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindvisualisation.cpp0000644000015301777760000003444412321547255032006 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "callgrindvisualisation.h" #include "callgrindhelper.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define VISUALISATION_DEBUG 0 // Margin from hardcoded value in: // QGraphicsView::fitInView(const QRectF &rect, // Qt::AspectRatioMode aspectRatioMode) // Bug report here: https://bugreports.qt-project.org/browse/QTBUG-11945 static const int FIT_IN_VIEW_MARGIN = 2; using namespace Valgrind::Callgrind; namespace Valgrind { namespace Internal { class FunctionGraphicsTextItem : public QAbstractGraphicsShapeItem { public: FunctionGraphicsTextItem(const QString &text, QGraphicsItem *parent); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); virtual QRectF boundingRect() const; private: QString m_text; QStaticText m_staticText; qreal m_previousViewportDimension; }; class FunctionGraphicsItem : public QGraphicsRectItem { public: enum DataKey { FunctionCallKey }; FunctionGraphicsItem(const QString &text, qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = 0); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); FunctionGraphicsTextItem *textItem() const; private: FunctionGraphicsTextItem *m_text; }; FunctionGraphicsTextItem::FunctionGraphicsTextItem(const QString &text, QGraphicsItem *parent) : QAbstractGraphicsShapeItem(parent) , m_text(text) , m_previousViewportDimension(0) { setFlag(QGraphicsItem::ItemIgnoresTransformations); setAcceptedMouseButtons(0); // do not steal focus from parent item setToolTip(text); } void FunctionGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *widget) { const qreal textHeight = painter->fontMetrics().height(); // Magic number based on what looked best. const int margin = 2 + FIT_IN_VIEW_MARGIN; const QRectF viewportRect = widget->rect().adjusted(margin, margin, -margin, -margin); const qreal maxWidth = viewportRect.width() * parentItem()->boundingRect().width() / scene()->sceneRect().width(); const qreal maxHeight = viewportRect.height() * parentItem()->boundingRect().height() / scene()->sceneRect().height(); if (textHeight > maxHeight) return; if (viewportRect.width() != m_previousViewportDimension) { const QString &elidedText = painter->fontMetrics().elidedText(m_text, Qt::ElideRight, maxWidth); m_staticText.setText(elidedText); m_staticText.prepare(); m_previousViewportDimension = viewportRect.width(); } #if VISUALISATION_DEBUG painter->setPen(Qt::red); painter->drawRect(boundingRect()); #endif painter->save(); int textLeft = 0; int textTop = 0; const int textWidth = painter->fontMetrics().width(m_staticText.text()); textLeft = -textWidth/2; textTop = (maxHeight - textHeight)/2; painter->drawStaticText(textLeft, textTop, m_staticText); painter->restore(); } QRectF FunctionGraphicsTextItem::boundingRect() const { return mapRectFromParent(parentItem()->boundingRect()); } FunctionGraphicsItem::FunctionGraphicsItem(const QString &text, qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent) : QGraphicsRectItem(x, y, width, height, parent) , m_text(0) { setFlag(QGraphicsItem::ItemIsSelectable); setFlag(QGraphicsItem::ItemClipsToShape); setFlag(QGraphicsItem::ItemClipsChildrenToShape); setToolTip(text); m_text = new FunctionGraphicsTextItem(text, this); m_text->setPos(rect().center().x(), y); } FunctionGraphicsTextItem *FunctionGraphicsItem::textItem() const { return m_text; } void FunctionGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) { painter->save(); QRectF rect = this->rect(); const QColor &color = brush().color(); if (option->state & QStyle::State_Selected) { QLinearGradient gradient(0, 0, rect.width(), 0); gradient.setColorAt(0, color.darker(100)); gradient.setColorAt(0.5, color.lighter(200)); gradient.setColorAt(1, color.darker(100)); painter->setBrush(gradient); } else { painter->setBrush(color); } #if VISUALISATION_DEBUG painter->setPen(Qt::blue); painter->drawRect(boundingRect()); #endif QPen pen = painter->pen(); pen.setColor(color.darker()); pen.setWidthF(0.5); painter->setPen(pen); qreal halfPenWidth = pen.widthF()/2.0; rect.adjust(halfPenWidth, halfPenWidth, -halfPenWidth, -halfPenWidth); painter->drawRect(rect); painter->restore(); } class Visualisation::Private { public: Private(Visualisation *qq); void handleMousePressEvent(QMouseEvent *event, bool doubleClicked); qreal sceneHeight() const; qreal sceneWidth() const; Visualisation *q; DataProxyModel *m_model; QGraphicsScene m_scene; }; Visualisation::Private::Private(Visualisation *qq) : q(qq) , m_model(new DataProxyModel(qq)) { // setup scene m_scene.setObjectName(QLatin1String("Visualisation Scene")); ///NOTE: with size 100x100 the Qt-internal mouse selection fails... m_scene.setSceneRect(0, 0, 1024, 1024); // setup model m_model->setMinimumInclusiveCostRatio(0.1); connect(m_model, SIGNAL(filterFunctionChanged(const Function*,const Function*)), qq, SLOT(populateScene())); } void Visualisation::Private::handleMousePressEvent(QMouseEvent *event, bool doubleClicked) { // find the first item that accepts mouse presses under the cursor position QGraphicsItem *itemAtPos = 0; foreach (QGraphicsItem *item, q->items(event->pos())) { if (!(item->acceptedMouseButtons() & event->button())) continue; itemAtPos = item; break; } // if there is an item, select it if (itemAtPos) { const Function *func = q->functionForItem(itemAtPos); if (doubleClicked) { q->functionActivated(func); } else { q->scene()->clearSelection(); itemAtPos->setSelected(true); q->functionSelected(func); } } } qreal Visualisation::Private::sceneHeight() const { return m_scene.height() - FIT_IN_VIEW_MARGIN; } qreal Visualisation::Private::sceneWidth() const { // Magic number to improve margins appearance return m_scene.width() + 1; } Visualisation::Visualisation(QWidget *parent) : QGraphicsView(parent) , d(new Private(this)) { setObjectName(QLatin1String("Visualisation View")); setScene(&d->m_scene); setRenderHint(QPainter::Antialiasing); } Visualisation::~Visualisation() { delete d; } const Function *Visualisation::functionForItem(QGraphicsItem *item) const { return item->data(FunctionGraphicsItem::FunctionCallKey).value(); } QGraphicsItem *Visualisation::itemForFunction(const Function *function) const { foreach (QGraphicsItem *item, items()) { if (functionForItem(item) == function) return item; } return 0; } void Visualisation::setFunction(const Function *function) { d->m_model->setFilterFunction(function); } const Function *Visualisation::function() const { return d->m_model->filterFunction(); } void Visualisation::setMinimumInclusiveCostRatio(double ratio) { d->m_model->setMinimumInclusiveCostRatio(ratio); } void Visualisation::setModel(QAbstractItemModel *model) { QTC_ASSERT(!d->m_model->sourceModel() && model, return); // only set once! d->m_model->setSourceModel(model); connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)), SLOT(populateScene())); connect(model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)), SLOT(populateScene())); connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)), SLOT(populateScene())); connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(populateScene())); connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), SLOT(populateScene())); connect(model, SIGNAL(layoutChanged()), SLOT(populateScene())); connect(model, SIGNAL(modelReset()), SLOT(populateScene())); connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), SLOT(populateScene())); connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), SLOT(populateScene())); connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), SLOT(populateScene())); populateScene(); } void Visualisation::setText(const QString &message) { d->m_scene.clear(); QGraphicsSimpleTextItem *textItem = d->m_scene.addSimpleText(message); textItem->setBrush(palette().foreground()); textItem->setPos((d->sceneWidth() - textItem->boundingRect().width()) / 2, (d->sceneHeight() - textItem->boundingRect().height()) / 2); textItem->setFlag(QGraphicsItem::ItemIgnoresTransformations); } void Visualisation::populateScene() { // reset scene first d->m_scene.clear(); const qreal sceneWidth = d->sceneWidth(); const qreal sceneHeight = d->sceneHeight(); // cache costs of each element, calculate total costs qreal total = 0; typedef QPair Pair; QLinkedList costs; for (int row = 0; row < d->m_model->rowCount(); ++row) { const QModelIndex index = d->m_model->index(row, DataModel::InclusiveCostColumn); bool ok = false; const qreal cost = index.data().toReal(&ok); QTC_ASSERT(ok, continue); costs << QPair(d->m_model->index(row, 0), cost); total += cost; } if (!costs.isEmpty() || d->m_model->filterFunction()) { // item showing the current filter function QString text; if (d->m_model->filterFunction()) { text = d->m_model->filterFunction()->name(); } else { const float ratioPercent = d->m_model->minimumInclusiveCostRatio() * 100; QString ratioPercentString = QString::number(ratioPercent); ratioPercentString.append(QLocale::system().percent()); const int hiddenFunctions = d->m_model->sourceModel()->rowCount() - d->m_model->rowCount(); text = tr("All functions with an inclusive cost ratio higher than %1 (%2 are hidden)") .arg(ratioPercentString) .arg(hiddenFunctions); } const qreal height = sceneHeight * (costs.isEmpty() ? 1.0 : 0.1); FunctionGraphicsItem *item = new FunctionGraphicsItem(text, 0, 0, sceneWidth, height); const QColor background = CallgrindHelper::colorForString(text); item->setBrush(background); item->setData(FunctionGraphicsItem::FunctionCallKey, QVariant::fromValue(d->m_model->filterFunction())); // NOTE: workaround wrong tooltip being show, no idea why... item->setZValue(-1); d->m_scene.addItem(item); } // add the canvas elements to the scene qreal used = sceneHeight * 0.1; foreach (const Pair &cost, costs) { const QModelIndex &index = cost.first; const QString text = index.data().toString(); const qreal height = (sceneHeight * 0.9 * cost.second) / total; FunctionGraphicsItem *item = new FunctionGraphicsItem(text, 0, used, sceneWidth, height); const QColor background = CallgrindHelper::colorForString(text); item->setBrush(background); item->setData(FunctionGraphicsItem::FunctionCallKey, index.data(DataModel::FunctionRole)); d->m_scene.addItem(item); used += height; } } void Visualisation::mousePressEvent(QMouseEvent *event) { d->handleMousePressEvent(event, false); QGraphicsView::mousePressEvent(event); } void Visualisation::mouseDoubleClickEvent(QMouseEvent *event) { d->handleMousePressEvent(event, true); QGraphicsView::mouseDoubleClickEvent(event); } void Visualisation::resizeEvent(QResizeEvent *event) { fitInView(sceneRect()); QGraphicsView::resizeEvent(event); } } // namespace Internal } // namespace Valgrind qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/Valgrind.pluginspec.in0000644000015301777760000000177212321547255030774 0ustar pbusernogroup00000000000000 Digia Plc (C) 2014 Digia Plc Commercial Usage Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Digia. GNU Lesser General Public License Usage Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. Code Analyzer Valgrind Plugin http://www.qt-project.org $$dependencyList qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/memcheckerrorview.cpp0000644000015301777760000004767512321547255030767 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Andreas Hartmetz, KDAB (andreas.hartmetz@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "memcheckerrorview.h" #include "suppressiondialog.h" #include "valgrindsettings.h" #include "xmlprotocol/error.h" #include "xmlprotocol/errorlistmodel.h" #include "xmlprotocol/frame.h" #include "xmlprotocol/stack.h" #include "xmlprotocol/modelhelpers.h" #include "xmlprotocol/suppression.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Valgrind::XmlProtocol; namespace Valgrind { namespace Internal { class MemcheckErrorDelegate : public QStyledItemDelegate { Q_OBJECT public: /// This delegate can only work on one view at a time, parent. parent will also be the parent /// in the QObject parent-child system. explicit MemcheckErrorDelegate(QListView *parent); QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; public slots: void currentChanged(const QModelIndex &now, const QModelIndex &previous); void viewResized(); void layoutChanged(); void copy(); private slots: void verticalScrolled(); void openLinkInEditor(const QString &link); private: // the constness of this function is a necessary lie because it is called from paint() const. QWidget *createDetailsWidget(const QModelIndex &errorIndex, QWidget *parent) const; static const int s_itemMargin = 2; mutable QPersistentModelIndex m_detailsIndex; mutable QWidget *m_detailsWidget; mutable int m_detailsWidgetHeight; }; MemcheckErrorDelegate::MemcheckErrorDelegate(QListView *parent) : QStyledItemDelegate(parent), m_detailsWidget(0) { connect(parent->verticalScrollBar(), SIGNAL(valueChanged(int)), SLOT(verticalScrolled())); } QSize MemcheckErrorDelegate::sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const { const QListView *view = qobject_cast(parent()); const int viewportWidth = view->viewport()->width(); const bool isSelected = view->selectionModel()->currentIndex() == index; const int dy = 2 * s_itemMargin; if (!isSelected) { QFontMetrics fm(opt.font); return QSize(viewportWidth, fm.height() + dy); } if (m_detailsWidget && m_detailsIndex != index) { m_detailsWidget->deleteLater(); m_detailsWidget = 0; } if (!m_detailsWidget) { m_detailsWidget = createDetailsWidget(index, view->viewport()); QTC_ASSERT(m_detailsWidget->parent() == view->viewport(), m_detailsWidget->setParent(view->viewport())); m_detailsIndex = index; } else { QTC_ASSERT(m_detailsIndex == index, /**/); } const int widthExcludingMargins = viewportWidth - 2 * s_itemMargin; m_detailsWidget->setFixedWidth(widthExcludingMargins); m_detailsWidgetHeight = m_detailsWidget->heightForWidth(widthExcludingMargins); // HACK: it's a bug in QLabel(?) that we have to force the widget to have the size it said // it would have. m_detailsWidget->setFixedHeight(m_detailsWidgetHeight); return QSize(viewportWidth, dy + m_detailsWidget->heightForWidth(widthExcludingMargins)); } static QString makeFrameName(const Frame &frame, const QString &relativeTo, bool link = true, const QString &linkAttr = QString()) { const QString d = frame.directory(); const QString f = frame.file(); const QString fn = frame.functionName(); const QString fullPath = d + QDir::separator() + f; QString path; if (!d.isEmpty() && !f.isEmpty()) path = fullPath; else path = frame.object(); if (QFile::exists(path)) path = QFileInfo(path).canonicalFilePath(); if (path.startsWith(relativeTo)) path.remove(0, relativeTo.length()); if (frame.line() != -1) path += QLatin1Char(':') + QString::number(frame.line()); path = Qt::escape(path); if (link && !f.isEmpty() && QFile::exists(fullPath)) { // make a hyperlink label path = QString::fromLatin1("
%3") .arg(fullPath, QString::number(frame.line()), path, linkAttr); } if (!fn.isEmpty()) return QCoreApplication::translate("Valgrind::Internal", "%1 in %2").arg(Qt::escape(fn), path); if (!path.isEmpty()) return path; return QString::fromLatin1("0x%1").arg(frame.instructionPointer(), 0, 16); } static QString relativeToPath() { // The project for which we insert the snippet. const ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject(); QString relativeTo(project ? project->projectDirectory() : QDir::homePath()); if (!relativeTo.endsWith(QDir::separator())) relativeTo.append(QDir::separator()); return relativeTo; } static QString errorLocation(const QModelIndex &index, const Error &error, bool link = false, const QString &linkAttr = QString()) { const ErrorListModel *model = 0; const QAbstractProxyModel *proxy = qobject_cast(index.model()); while (!model && proxy) { model = qobject_cast(proxy->sourceModel()); proxy = qobject_cast(proxy->sourceModel()); } QTC_ASSERT(model, return QString()); return QCoreApplication::translate("Valgrind::Internal", "in %1"). arg(makeFrameName(model->findRelevantFrame(error), relativeToPath(), link, linkAttr)); } QWidget *MemcheckErrorDelegate::createDetailsWidget(const QModelIndex &errorIndex, QWidget *parent) const { QWidget *widget = new QWidget(parent); QVBoxLayout *layout = new QVBoxLayout; // code + white-space:pre so the padding (see below) works properly // don't include frameName here as it should wrap if required and pre-line is not supported // by Qt yet it seems const QString displayTextTemplate = QString::fromLatin1("%1: %2"); const QString relativeTo = relativeToPath(); const Error error = errorIndex.data(ErrorListModel::ErrorRole).value(); QLabel *errorLabel = new QLabel(); errorLabel->setWordWrap(true); errorLabel->setContentsMargins(0, 0, 0, 0); errorLabel->setMargin(0); errorLabel->setIndent(0); QPalette p = errorLabel->palette(); QColor lc = p.color(QPalette::Text); QString linkStyle = QString::fromLatin1("style=\"color:rgba(%1, %2, %3, %4);\"") .arg(lc.red()).arg(lc.green()).arg(lc.blue()).arg(int(0.7 * 255)); p.setBrush(QPalette::Text, p.highlightedText()); errorLabel->setPalette(p); errorLabel->setText(QString::fromLatin1("%1  %2") .arg(error.what(), errorLocation(errorIndex, error, true, linkStyle), linkStyle)); connect(errorLabel, SIGNAL(linkActivated(QString)), SLOT(openLinkInEditor(QString))); layout->addWidget(errorLabel); const QVector stacks = error.stacks(); for (int i = 0; i < stacks.count(); ++i) { const Stack &stack = stacks.at(i); // auxwhat for additional stacks if (i > 0) { QLabel *stackLabel = new QLabel(stack.auxWhat()); stackLabel->setWordWrap(true); stackLabel->setContentsMargins(0, 0, 0, 0); stackLabel->setMargin(0); stackLabel->setIndent(0); QPalette p = stackLabel->palette(); p.setBrush(QPalette::Text, p.highlightedText()); stackLabel->setPalette(p); layout->addWidget(stackLabel); } int frameNr = 1; foreach (const Frame &frame, stack.frames()) { QString frameName = makeFrameName(frame, relativeTo); QTC_ASSERT(!frameName.isEmpty(), /**/); QLabel *frameLabel = new QLabel(widget); frameLabel->setAutoFillBackground(true); if (frameNr % 2 == 0) { // alternating rows QPalette p = frameLabel->palette(); p.setBrush(QPalette::Base, p.alternateBase()); frameLabel->setPalette(p); } frameLabel->setFont(QFont(QLatin1String("monospace"))); connect(frameLabel, SIGNAL(linkActivated(QString)), SLOT(openLinkInEditor(QString))); // pad frameNr to 2 chars since only 50 frames max are supported by valgrind const QString displayText = displayTextTemplate .arg(frameNr++, 2).arg(frameName); frameLabel->setText(displayText); frameLabel->setToolTip(toolTipForFrame(frame)); frameLabel->setWordWrap(true); frameLabel->setContentsMargins(0, 0, 0, 0); frameLabel->setMargin(0); frameLabel->setIndent(10); layout->addWidget(frameLabel); } } layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); widget->setLayout(layout); return widget; } void MemcheckErrorDelegate::paint(QPainter *painter, const QStyleOptionViewItem &basicOption, const QModelIndex &index) const { QStyleOptionViewItemV4 opt(basicOption); initStyleOption(&opt, index); const QListView *const view = qobject_cast(parent()); const bool isSelected = view->selectionModel()->currentIndex() == index; QFontMetrics fm(opt.font); QPoint pos = opt.rect.topLeft(); painter->save(); const QColor bgColor = isSelected ? opt.palette.highlight().color() : opt.palette.background().color(); painter->setBrush(bgColor); // clear background painter->setPen(Qt::NoPen); painter->drawRect(opt.rect); pos.rx() += s_itemMargin; pos.ry() += s_itemMargin; const Error error = index.data(ErrorListModel::ErrorRole).value(); if (isSelected) { // only show detailed widget and let it handle everything QTC_ASSERT(m_detailsIndex == index, /**/); QTC_ASSERT(m_detailsWidget, return); // should have been set in sizeHint() m_detailsWidget->move(pos); // when scrolling quickly, the widget can get stuck in a visible part of the scroll area // even though it should not be visible. therefore we hide it every time the scroll value // changes and un-hide it when the item with details widget is paint()ed, i.e. visible. m_detailsWidget->show(); const int viewportWidth = view->viewport()->width(); const int widthExcludingMargins = viewportWidth - 2 * s_itemMargin; QTC_ASSERT(m_detailsWidget->width() == widthExcludingMargins, /**/); QTC_ASSERT(m_detailsWidgetHeight == m_detailsWidget->height(), /**/); } else { // the reference coordinate for text drawing is the text baseline; move it inside the view rect. pos.ry() += fm.ascent(); const QColor textColor = opt.palette.text().color(); painter->setPen(textColor); // draw only text + location const QString what = error.what(); painter->drawText(pos, what); const QString name = errorLocation(index, error); const int whatWidth = QFontMetrics(opt.font).width(what); const int space = 10; const int widthLeft = opt.rect.width() - (pos.x() + whatWidth + space + s_itemMargin); if (widthLeft > 0) { QFont monospace = opt.font; monospace.setFamily(QLatin1String("monospace")); QFontMetrics metrics(monospace); QColor nameColor = textColor; nameColor.setAlphaF(0.7); painter->setFont(monospace); painter->setPen(nameColor); QPoint namePos = pos; namePos.rx() += whatWidth + space; painter->drawText(namePos, metrics.elidedText(name, Qt::ElideLeft, widthLeft)); } } // Separator lines (like Issues pane) painter->setPen(QColor::fromRgb(150,150,150)); painter->drawLine(0, opt.rect.bottom(), opt.rect.right(), opt.rect.bottom()); painter->restore(); } void MemcheckErrorDelegate::currentChanged(const QModelIndex &now, const QModelIndex &previous) { if (m_detailsWidget) { m_detailsWidget->deleteLater(); m_detailsWidget = 0; } m_detailsIndex = QModelIndex(); if (now.isValid()) emit sizeHintChanged(now); if (previous.isValid()) emit sizeHintChanged(previous); } void MemcheckErrorDelegate::layoutChanged() { if (m_detailsWidget) { m_detailsWidget->deleteLater(); m_detailsWidget = 0; m_detailsIndex = QModelIndex(); } } void MemcheckErrorDelegate::viewResized() { const QListView *view = qobject_cast(parent()); if (m_detailsWidget) emit sizeHintChanged(view->selectionModel()->currentIndex()); } void MemcheckErrorDelegate::verticalScrolled() { if (m_detailsWidget) m_detailsWidget->hide(); } void MemcheckErrorDelegate::copy() { QTC_ASSERT(m_detailsIndex.isValid(), return); QString content; QTextStream stream(&content); const Error error = m_detailsIndex.data(ErrorListModel::ErrorRole).value(); stream << error.what() << "\n"; stream << " " << errorLocation(m_detailsIndex, error) << "\n"; const QString relativeTo = relativeToPath(); foreach (const Stack &stack, error.stacks()) { if (!stack.auxWhat().isEmpty()) stream << stack.auxWhat(); int i = 1; foreach (const Frame &frame, stack.frames()) { stream << " " << i++ << ": " << makeFrameName(frame, relativeTo) << "\n"; } } stream.flush(); QApplication::clipboard()->setText(content); } void MemcheckErrorDelegate::openLinkInEditor(const QString &link) { const int pathStart = int(sizeof("file://")) - 1; const int pathEnd = link.lastIndexOf(QLatin1Char(':')); const QString path = link.mid(pathStart, pathEnd - pathStart); const int line = link.mid(pathEnd + 1).toInt(0); Core::EditorManager::openEditorAt(path, qMax(line, 0)); } MemcheckErrorView::MemcheckErrorView(QWidget *parent) : QListView(parent), m_settings(0) { setItemDelegate(new MemcheckErrorDelegate(this)); connect(this, SIGNAL(resized()), itemDelegate(), SLOT(viewResized())); m_copyAction = new QAction(this); m_copyAction->setText(tr("Copy Selection")); m_copyAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_COPY))); m_copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C)); m_copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); connect(m_copyAction, SIGNAL(triggered()), itemDelegate(), SLOT(copy())); addAction(m_copyAction); m_suppressAction = new QAction(this); m_suppressAction->setText(tr("Suppress Error")); m_suppressAction->setIcon(QIcon(QLatin1String(":/qmldesigner/images/eye_crossed.png"))); m_suppressAction->setShortcut(QKeySequence(Qt::Key_Delete)); m_suppressAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); connect(m_suppressAction, SIGNAL(triggered()), this, SLOT(suppressError())); addAction(m_suppressAction); } MemcheckErrorView::~MemcheckErrorView() { itemDelegate()->deleteLater(); } void MemcheckErrorView::setModel(QAbstractItemModel *model) { QListView::setModel(model); connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), itemDelegate(), SLOT(currentChanged(QModelIndex,QModelIndex))); connect(model, SIGNAL(layoutChanged()), itemDelegate(), SLOT(layoutChanged())); } void MemcheckErrorView::resizeEvent(QResizeEvent *e) { emit resized(); QListView::resizeEvent(e); } void MemcheckErrorView::setDefaultSuppressionFile(const QString &suppFile) { m_defaultSuppFile = suppFile; } QString MemcheckErrorView::defaultSuppressionFile() const { return m_defaultSuppFile; } void MemcheckErrorView::updateGeometries() { if (model()) { QModelIndex index = model()->index(0, modelColumn(), rootIndex()); QStyleOptionViewItem option = viewOptions(); // delegate for row / column QSize step = itemDelegate()->sizeHint(option, index); horizontalScrollBar()->setSingleStep(step.width() + spacing()); verticalScrollBar()->setSingleStep(step.height() + spacing()); } QListView::updateGeometries(); } // slot, can (for now) be invoked either when the settings were modified *or* when the active // settings object has changed. void MemcheckErrorView::settingsChanged(ValgrindBaseSettings *settings) { QTC_ASSERT(settings, return); m_settings = settings; } void MemcheckErrorView::contextMenuEvent(QContextMenuEvent *e) { const QModelIndexList indizes = selectionModel()->selectedRows(); if (indizes.isEmpty()) return; QList errors; foreach (const QModelIndex &index, indizes) { Error error = model()->data(index, ErrorListModel::ErrorRole).value(); if (!error.suppression().isNull()) errors << error; } QMenu menu; menu.addAction(m_copyAction); menu.addSeparator(); menu.addAction(m_suppressAction); m_suppressAction->setEnabled(!errors.isEmpty()); menu.exec(e->globalPos()); } void MemcheckErrorView::suppressError() { SuppressionDialog::maybeShow(this); } void MemcheckErrorView::goNext() { QTC_ASSERT(rowCount(), return); setCurrentRow((currentRow() + 1) % rowCount()); } void MemcheckErrorView::goBack() { QTC_ASSERT(rowCount(), return); const int prevRow = currentRow() - 1; setCurrentRow(prevRow >= 0 ? prevRow : rowCount() - 1); } int MemcheckErrorView::rowCount() const { return model() ? model()->rowCount() : 0; } int MemcheckErrorView::currentRow() const { const QModelIndex index = selectionModel()->currentIndex(); return index.row(); } void MemcheckErrorView::setCurrentRow(int row) { const QModelIndex index = model()->index(row, 0); selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); scrollTo(index); } } // namespace Internal } // namespace Valgrind #include "memcheckerrorview.moc" qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/valgrind/callgrindhelper.h0000644000015301777760000000425612321547255030036 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CALLGRINDHELPER_H #define CALLGRINDHELPER_H #include QT_BEGIN_NAMESPACE class QColor; class QString; QT_END_NAMESPACE namespace Valgrind { namespace Internal { namespace CallgrindHelper { /** * Returns color for a specific string, the string<->color mapping is cached */ QColor colorForString(const QString &text); /** * Returns color for a specific cost ratio * \param ratio The cost ratio, ratio should be of [0,1] */ QColor colorForCostRatio(qreal ratio); /** * Returns a proper percent representation of a float limited to 5 chars */ QString toPercent(float costs, const QLocale &locale = QLocale()); } } // namespace Internal } // namespace Valgrind #endif // CALLGRINDHELPER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/0000755000015301777760000000000012321547742025265 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000016100000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/typespecificdeviceconfigurationlistmodel.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/typespecificdeviceconfigurationl0000644000015301777760000001165112321547255034026 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "typespecificdeviceconfigurationlistmodel.h" #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { TypeSpecificDeviceConfigurationListModel::TypeSpecificDeviceConfigurationListModel(Target *target) : QAbstractListModel(target) { const DeviceManager * const devConfs = DeviceManager::instance(); connect(devConfs, SIGNAL(updated()), this, SIGNAL(modelReset())); connect(target, SIGNAL(kitChanged()), this, SIGNAL(modelReset())); } int TypeSpecificDeviceConfigurationListModel::rowCount(const QModelIndex &parent) const { if (parent.isValid()) return 0; int count = 0; const DeviceManager * const devConfs = DeviceManager::instance(); const int devConfsCount = devConfs->deviceCount(); for (int i = 0; i < devConfsCount; ++i) { if (deviceMatches(devConfs->deviceAt(i))) ++count; } return count; } QVariant TypeSpecificDeviceConfigurationListModel::data(const QModelIndex &index, int role) const { if (!index.isValid() || index.row() >= rowCount() || role != Qt::DisplayRole) return QVariant(); const IDevice::ConstPtr &device = deviceAt(index.row()); Q_ASSERT(device); QString displayedName = device->displayName(); if (deviceMatches(device) && DeviceManager::instance()->defaultDevice(device->type()) == device) { displayedName = tr("%1 (default)").arg(displayedName); } return displayedName; } IDevice::ConstPtr TypeSpecificDeviceConfigurationListModel::deviceAt(int idx) const { int currentRow = -1; const DeviceManager * const devConfs = DeviceManager::instance(); const int devConfsCount = devConfs->deviceCount(); for (int i = 0; i < devConfsCount; ++i) { const IDevice::ConstPtr device = devConfs->deviceAt(i); if (deviceMatches(device) && ++currentRow == idx) return device; } QTC_CHECK(false); return IDevice::ConstPtr(); } IDevice::ConstPtr TypeSpecificDeviceConfigurationListModel::defaultDeviceConfig() const { const DeviceManager * const deviceManager = DeviceManager::instance(); const int deviceCount = deviceManager->deviceCount(); for (int i = 0; i < deviceCount; ++i) { const IDevice::ConstPtr device = deviceManager->deviceAt(i); if (deviceMatches(device) && deviceManager->defaultDevice(device->type()) == device) { return device; } } return IDevice::ConstPtr(); } IDevice::ConstPtr TypeSpecificDeviceConfigurationListModel::find(Core::Id id) const { const IDevice::ConstPtr &device = DeviceManager::instance()->find(id); if (deviceMatches(device)) return device; return defaultDeviceConfig(); } int TypeSpecificDeviceConfigurationListModel::indexForId(Core::Id id) const { const int count = rowCount(); for (int i = 0; i < count; ++i) { if (deviceAt(i)->id() == id) return i; } return -1; } Target *TypeSpecificDeviceConfigurationListModel::target() const { return qobject_cast(QObject::parent()); } bool TypeSpecificDeviceConfigurationListModel::deviceMatches(IDevice::ConstPtr dev) const { if (dev.isNull()) return false; Core::Id typeId = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit()); return dev->type() == typeId; } } // namespace Internal } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/publickeydeploymentdialog.cpp0000644000015301777760000001016012321547255033236 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "publickeydeploymentdialog.h" #include "sshkeydeployer.h" #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class PublicKeyDeploymentDialogPrivate { public: SshKeyDeployer keyDeployer; bool done; }; } // namespace Internal; using namespace Internal; PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog(const IDevice::ConstPtr &deviceConfig, QWidget *parent) { const QString &dir = QFileInfo(deviceConfig->sshParameters().privateKeyFile).path(); const QString publicKeyFileName = QFileDialog::getOpenFileName(parent ? parent : Core::ICore::mainWindow(), tr("Choose Public Key File"), dir, tr("Public Key Files (*.pub);;All Files (*)")); if (publicKeyFileName.isEmpty()) return 0; return new PublicKeyDeploymentDialog(deviceConfig, publicKeyFileName, parent); } PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &deviceConfig, const QString &publicKeyFileName, QWidget *parent) : QProgressDialog(parent), d(new PublicKeyDeploymentDialogPrivate) { setAutoReset(false); setAutoClose(false); setMinimumDuration(0); setMaximum(1); d->done = false; setLabelText(tr("Deploying...")); setValue(0); connect(this, SIGNAL(canceled()), SLOT(handleCanceled())); connect(&d->keyDeployer, SIGNAL(error(QString)), SLOT(handleDeploymentError(QString))); connect(&d->keyDeployer, SIGNAL(finishedSuccessfully()), SLOT(handleDeploymentSuccess())); d->keyDeployer.deployPublicKey(deviceConfig->sshParameters(), publicKeyFileName); } PublicKeyDeploymentDialog::~PublicKeyDeploymentDialog() { delete d; } void PublicKeyDeploymentDialog::handleDeploymentSuccess() { handleDeploymentFinished(QString()); setValue(1); d->done = true; } void PublicKeyDeploymentDialog::handleDeploymentError(const QString &errorMsg) { handleDeploymentFinished(errorMsg); } void PublicKeyDeploymentDialog::handleDeploymentFinished(const QString &errorMsg) { QString buttonText; const char *textColor; if (errorMsg.isEmpty()) { buttonText = tr("Deployment finished successfully."); textColor = "blue"; } else { buttonText = errorMsg; textColor = "red"; } setLabelText(QString::fromLatin1("%2").arg(QLatin1String(textColor), buttonText)); setCancelButtonText(tr("Close")); } void PublicKeyDeploymentDialog::handleCanceled() { disconnect(&d->keyDeployer, 0, this, 0); d->keyDeployer.stopDeployment(); if (d->done) accept(); else reject(); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxsignaloperation.cpp0000644000015301777760000001113212321547255033460 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxsignaloperation.h" #include #include #include using namespace RemoteLinux; using namespace ProjectExplorer; RemoteLinuxSignalOperation::RemoteLinuxSignalOperation( const QSsh::SshConnectionParameters sshParameters) : DeviceProcessSignalOperation() , m_sshParameters(sshParameters) , m_runner(0) {} RemoteLinuxSignalOperation::~RemoteLinuxSignalOperation() { if (m_runner) { connect(m_runner, SIGNAL(processClosed(int)), m_runner, SLOT(deleteLater())); connect(m_runner, SIGNAL(connectionError()), m_runner, SLOT(deleteLater())); } } static QString signalProcessByPidCommandLine(int pid, int signal) { return QString::fromLatin1("kill -%1 %2").arg(signal).arg(pid); } void RemoteLinuxSignalOperation::run(const QString command) { QTC_ASSERT(!m_runner, return); m_runner = new QSsh::SshRemoteProcessRunner(); connect(m_runner, SIGNAL(processClosed(int)), SLOT(runnerProcessFinished())); connect(m_runner, SIGNAL(connectionError()), SLOT(runnerConnectionError())); m_runner->run(command.toLatin1(), m_sshParameters); } void RemoteLinuxSignalOperation::finish() { delete m_runner; m_runner = 0; emit finished(m_errorMessage); } static QString signalProcessByNameCommandLine(const QString &filePath, int signal) { return QString::fromLatin1( "cd /proc; for pid in `ls -d [0123456789]*`; " "do " "if [ \"`readlink /proc/$pid/exe`\" = \"%1\" ]; then " " kill -%2 $pid;" "fi; " "done").arg(filePath).arg(signal); } QString RemoteLinuxSignalOperation::killProcessByNameCommandLine(const QString &filePath) const { return QString::fromLatin1("%1; %2").arg(signalProcessByNameCommandLine(filePath, 15), signalProcessByNameCommandLine(filePath, 9)); } QString RemoteLinuxSignalOperation::interruptProcessByNameCommandLine(const QString &filePath) const { return signalProcessByNameCommandLine(filePath, 2); } void RemoteLinuxSignalOperation::killProcess(int pid) { run(signalProcessByPidCommandLine(pid, 9)); } void RemoteLinuxSignalOperation::killProcess(const QString &filePath) { run(killProcessByNameCommandLine(filePath)); } void RemoteLinuxSignalOperation::interruptProcess(int pid) { run(signalProcessByPidCommandLine(pid, 2)); } void RemoteLinuxSignalOperation::interruptProcess(const QString &filePath) { run(interruptProcessByNameCommandLine(filePath)); } void RemoteLinuxSignalOperation::runnerProcessFinished() { m_errorMessage.clear(); if (m_runner->processExitStatus() != QSsh::SshRemoteProcess::NormalExit) { m_errorMessage = m_runner->processErrorString(); } else if (m_runner->processExitCode() != 0) { m_errorMessage = tr("Exit code is %1. stderr:").arg(m_runner->processExitCode()) + QLatin1Char(' ') + QString::fromLatin1(m_runner->readAllStandardError()); } finish(); } void RemoteLinuxSignalOperation::runnerConnectionError() { m_errorMessage = m_runner->lastConnectionErrorString(); finish(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfiguration.h0000644000015301777760000000535612321547255034026 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXDEPLOYCONFIGURATION_H #define REMOTELINUXDEPLOYCONFIGURATION_H #include "remotelinux_export.h" #include #include namespace RemoteLinux { namespace Internal { class RemoteLinuxDeployConfigurationFactory; } class REMOTELINUX_EXPORT RemoteLinuxDeployConfiguration : public ProjectExplorer::DeployConfiguration { Q_OBJECT public: RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id, const QString &defaultDisplayName); RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, RemoteLinuxDeployConfiguration *source); ProjectExplorer::NamedWidget *createConfigWidget(); template T *earlierBuildStep(const ProjectExplorer::BuildStep *laterBuildStep) const { const QList &buildSteps = stepList()->steps(); for (int i = 0; i < buildSteps.count(); ++i) { if (buildSteps.at(i) == laterBuildStep) return 0; if (T * const step = dynamic_cast(buildSteps.at(i))) return step; } return 0; } private: friend class Internal::RemoteLinuxDeployConfigurationFactory; }; } // namespace RemoteLinux #endif // REMOTELINUXDEPLOYCONFIGURATION_H ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationwidget.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationwidge0000644000015301777760000000537212321547255034126 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXRUNCONFIGURATIONWIDGET_H #define REMOTELINUXRUNCONFIGURATIONWIDGET_H #include "remotelinux_export.h" #include QT_BEGIN_NAMESPACE class QLabel; class QVBoxLayout; QT_END_NAMESPACE namespace RemoteLinux { class RemoteLinuxRunConfiguration; namespace Internal { class RemoteLinuxRunConfigurationWidgetPrivate; } // namespace Internal class REMOTELINUX_EXPORT RemoteLinuxRunConfigurationWidget : public QWidget { Q_OBJECT public: explicit RemoteLinuxRunConfigurationWidget(RemoteLinuxRunConfiguration *runConfiguration, QWidget *parent = 0); ~RemoteLinuxRunConfigurationWidget(); void addFormLayoutRow(QWidget *label, QWidget *field); void addDisabledLabel(QVBoxLayout *topLayout); Q_SLOT void runConfigurationEnabledChange(); private slots: void argumentsEdited(const QString &args); void updateTargetInformation(); void handleDeploySpecsChanged(); void handleUseAlternateCommandChanged(); void handleAlternateCommandChanged(); void handleWorkingDirectoryChanged(); private: void addGenericWidgets(QVBoxLayout *mainLayout); void setLabelText(QLabel &label, const QString ®ularText, const QString &errorText); Internal::RemoteLinuxRunConfigurationWidgetPrivate * const d; }; } // namespace RemoteLinux #endif // REMOTELINUXRUNCONFIGURATIONWIDGET_H ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwidget.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000001775412321547255034060 0ustar pbusernogroup00000000000000 RemoteLinux::GenericLinuxDeviceConfigurationWidget 0 0 393 321 Form QFormLayout::FieldsStayAtSizeHint 0 0 0 0 Authentication type: 0 0 0 0 Password &Key Qt::Horizontal 40 20 &Host name: hostLineEdit IP or host name of the device &SSH port: sshPortSpinBox 0 65535 22 Free ports: portsLineEdit You can enter lists and ranges like this: 1024,1026-1028,1030 Timeout: timeoutSpinBox s 10000 10 1000 &Username: userLineEdit &Password: pwdLineEdit QLineEdit::Password Show password Private key file: Create New... Machine type: GDB server executable: Leave empty to look up executable in $PATH passwordLabel authTypeButtonsWidget hostNameLabel userNameLabel freePortsLabel userLineEdit authTypeLabel keyLabel machineTypeLabel machineTypeValueLabel gdbServerLabel gdbServerLineEdit Utils::PathChooser QWidget
utils/pathchooser.h
1 editingFinished() browsingFinished()
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxpackageinstaller.cpp0000644000015301777760000001176712321547255033611 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxpackageinstaller.h" #include #include using namespace ProjectExplorer; using namespace QSsh; namespace RemoteLinux { namespace Internal { class AbstractRemoteLinuxPackageInstallerPrivate { public: AbstractRemoteLinuxPackageInstallerPrivate() : isRunning(false), installer(0), killProcess(0) {} bool isRunning; IDevice::ConstPtr deviceConfig; QSsh::SshRemoteProcessRunner *installer; QSsh::SshRemoteProcessRunner *killProcess; }; } // namespace Internal AbstractRemoteLinuxPackageInstaller::AbstractRemoteLinuxPackageInstaller(QObject *parent) : QObject(parent), d(new Internal::AbstractRemoteLinuxPackageInstallerPrivate) { } AbstractRemoteLinuxPackageInstaller::~AbstractRemoteLinuxPackageInstaller() { delete d; } void AbstractRemoteLinuxPackageInstaller::installPackage(const IDevice::ConstPtr &deviceConfig, const QString &packageFilePath, bool removePackageFile) { QTC_ASSERT(!d->isRunning, return); d->deviceConfig = deviceConfig; prepareInstallation(); if (!d->installer) d->installer = new SshRemoteProcessRunner(this); connect(d->installer, SIGNAL(connectionError()), SLOT(handleConnectionError())); connect(d->installer, SIGNAL(readyReadStandardOutput()), SLOT(handleInstallerOutput())); connect(d->installer, SIGNAL(readyReadStandardError()), SLOT(handleInstallerErrorOutput())); connect(d->installer, SIGNAL(processClosed(int)), SLOT(handleInstallationFinished(int))); QString cmdLine = installCommandLine(packageFilePath); if (removePackageFile) cmdLine += QLatin1String(" && (rm ") + packageFilePath + QLatin1String(" || :)"); d->installer->run(cmdLine.toUtf8(), deviceConfig->sshParameters()); d->isRunning = true; } void AbstractRemoteLinuxPackageInstaller::cancelInstallation() { QTC_ASSERT(d->installer && d->isRunning, return); if (!d->killProcess) d->killProcess = new SshRemoteProcessRunner(this); d->killProcess->run(cancelInstallationCommandLine().toUtf8(), d->deviceConfig->sshParameters()); setFinished(); } void AbstractRemoteLinuxPackageInstaller::handleConnectionError() { if (!d->isRunning) return; emit finished(tr("Connection failure: %1").arg(d->installer->lastConnectionErrorString())); setFinished(); } void AbstractRemoteLinuxPackageInstaller::handleInstallationFinished(int exitStatus) { if (!d->isRunning) return; if (exitStatus != SshRemoteProcess::NormalExit || d->installer->processExitCode() != 0) emit finished(tr("Installing package failed.")); else if (!errorString().isEmpty()) emit finished(errorString()); else emit finished(); setFinished(); } void AbstractRemoteLinuxPackageInstaller::handleInstallerOutput() { emit stdoutData(QString::fromUtf8(d->installer->readAllStandardOutput())); } void AbstractRemoteLinuxPackageInstaller::handleInstallerErrorOutput() { emit stderrData(QString::fromUtf8(d->installer->readAllStandardError())); } void AbstractRemoteLinuxPackageInstaller::setFinished() { disconnect(d->installer, 0, this, 0); d->isRunning = false; } RemoteLinuxTarPackageInstaller::RemoteLinuxTarPackageInstaller(QObject *parent) : AbstractRemoteLinuxPackageInstaller(parent) { } QString RemoteLinuxTarPackageInstaller::installCommandLine(const QString &packageFilePath) const { return QLatin1String("cd / && tar xvf ") + packageFilePath; } QString RemoteLinuxTarPackageInstaller::cancelInstallationCommandLine() const { return QLatin1String("pkill tar"); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationfactory.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationf0000644000015301777760000000570712321547255034032 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "genericlinuxdeviceconfigurationfactory.h" #include "genericlinuxdeviceconfigurationwizard.h" #include "linuxdevice.h" #include "remotelinux_constants.h" #include #include using namespace ProjectExplorer; namespace RemoteLinux { GenericLinuxDeviceConfigurationFactory::GenericLinuxDeviceConfigurationFactory(QObject *parent) : IDeviceFactory(parent) { } QString GenericLinuxDeviceConfigurationFactory::displayNameForId(Core::Id type) const { QTC_ASSERT(type == Constants::GenericLinuxOsType, return QString()); return tr("Generic Linux Device"); } QList GenericLinuxDeviceConfigurationFactory::availableCreationIds() const { return QList() << Core::Id(Constants::GenericLinuxOsType); } IDevice::Ptr GenericLinuxDeviceConfigurationFactory::create(Core::Id id) const { QTC_ASSERT(id == Constants::GenericLinuxOsType, return IDevice::Ptr()); GenericLinuxDeviceConfigurationWizard wizard(Core::ICore::mainWindow()); if (wizard.exec() != QDialog::Accepted) return IDevice::Ptr(); return wizard.device(); } bool GenericLinuxDeviceConfigurationFactory::canRestore(const QVariantMap &map) const { return IDevice::typeFromMap(map) == Constants::GenericLinuxOsType; } IDevice::Ptr GenericLinuxDeviceConfigurationFactory::restore(const QVariantMap &map) const { QTC_ASSERT(canRestore(map), return IDevice::Ptr()); const IDevice::Ptr device = LinuxDevice::create(); device->fromMap(map); return device; } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxutils.cpp0000644000015301777760000000300012321547255031415 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxutils.h" namespace RemoteLinux { } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/tarpackagecreationstep.cpp0000644000015301777760000003227512321547255032524 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "tarpackagecreationstep.h" #include #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace { const char IgnoreMissingFilesKey[] = "RemoteLinux.TarPackageCreationStep.IgnoreMissingFiles"; class CreateTarStepWidget : public SimpleBuildStepConfigWidget { Q_OBJECT public: CreateTarStepWidget(TarPackageCreationStep *step) : SimpleBuildStepConfigWidget(step) { m_ignoreMissingFilesCheckBox.setText(tr("Ignore missing files")); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setMargin(0); mainLayout->addWidget(&m_ignoreMissingFilesCheckBox); m_ignoreMissingFilesCheckBox.setChecked(step->ignoreMissingFiles()); connect(&m_ignoreMissingFilesCheckBox, SIGNAL(toggled(bool)), SLOT(handleIgnoreMissingFilesChanged(bool))); connect(step, SIGNAL(packageFilePathChanged()), SIGNAL(updateSummary())); } QString summaryText() const { TarPackageCreationStep * const step = static_cast(this->step()); if (step->packageFilePath().isEmpty()) { return QLatin1String("") + tr("Tarball creation not possible.") + QLatin1String(""); } return QLatin1String("") + tr("Create tarball:") + QLatin1String(" ") + step->packageFilePath(); } bool showWidget() const { return true; } private: Q_SLOT void handleIgnoreMissingFilesChanged(bool ignoreMissingFiles) { TarPackageCreationStep *step = qobject_cast(this->step()); step->setIgnoreMissingFiles(ignoreMissingFiles); } QCheckBox m_ignoreMissingFilesCheckBox; }; const int TarBlockSize = 512; struct TarFileHeader { char fileName[100]; char fileMode[8]; char uid[8]; char gid[8]; char length[12]; char mtime[12]; char chksum[8]; char typeflag; char linkname[100]; char magic[6]; char version[2]; char uname[32]; char gname[32]; char devmajor[8]; char devminor[8]; char fileNamePrefix[155]; char padding[12]; }; } // Anonymous namespace. TarPackageCreationStep::TarPackageCreationStep(BuildStepList *bsl) : AbstractPackagingStep(bsl, stepId()) { ctor(); } TarPackageCreationStep::TarPackageCreationStep(BuildStepList *bsl, TarPackageCreationStep *other) : AbstractPackagingStep(bsl, other) { ctor(); } void TarPackageCreationStep::ctor() { setDefaultDisplayName(displayName()); m_ignoreMissingFiles = false; } bool TarPackageCreationStep::init() { if (!AbstractPackagingStep::init()) return false; m_packagingNeeded = isPackagingNeeded(); if (m_packagingNeeded) m_files = target()->deploymentData().allFiles(); return true; } void TarPackageCreationStep::run(QFutureInterface &fi) { setPackagingStarted(); const bool success = doPackage(fi); setPackagingFinished(success); if (success) emit addOutput(tr("Packaging finished successfully."), MessageOutput); else emit addOutput(tr("Packaging failed."), ErrorMessageOutput); fi.reportResult(success); } void TarPackageCreationStep::setIgnoreMissingFiles(bool ignoreMissingFiles) { m_ignoreMissingFiles = ignoreMissingFiles; } bool TarPackageCreationStep::ignoreMissingFiles() const { return m_ignoreMissingFiles; } bool TarPackageCreationStep::doPackage(QFutureInterface &fi) { emit addOutput(tr("Creating tarball..."), MessageOutput); if (!m_packagingNeeded) { emit addOutput(tr("Tarball up to date, skipping packaging."), MessageOutput); return true; } // TODO: Optimization: Only package changed files QFile tarFile(cachedPackageFilePath()); if (!tarFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { raiseError(tr("Error: tar file %1 cannot be opened (%2).") .arg(QDir::toNativeSeparators(cachedPackageFilePath()), tarFile.errorString())); return false; } foreach (const DeployableFile &d, m_files) { if (d.remoteDirectory().isEmpty()) { emit addOutput(tr("No remote path specified for file '%1', skipping.") .arg(d.localFilePath().toUserOutput()), ErrorMessageOutput); continue; } QFileInfo fileInfo = d.localFilePath().toFileInfo(); if (!appendFile(tarFile, fileInfo, d.remoteDirectory() + QLatin1Char('/') + fileInfo.fileName(), fi)) { return false; } } const QByteArray eofIndicator(2*sizeof(TarFileHeader), 0); if (tarFile.write(eofIndicator) != eofIndicator.length()) { raiseError(tr("Error writing tar file '%1': %2.") .arg(QDir::toNativeSeparators(tarFile.fileName()), tarFile.errorString())); return false; } return true; } bool TarPackageCreationStep::appendFile(QFile &tarFile, const QFileInfo &fileInfo, const QString &remoteFilePath, const QFutureInterface &fi) { if (!writeHeader(tarFile, fileInfo, remoteFilePath)) return false; if (fileInfo.isDir()) { QDir dir(fileInfo.absoluteFilePath()); foreach (const QString &fileName, dir.entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot)) { const QString thisLocalFilePath = dir.path() + QLatin1Char('/') + fileName; const QString thisRemoteFilePath = remoteFilePath + QLatin1Char('/') + fileName; if (!appendFile(tarFile, QFileInfo(thisLocalFilePath), thisRemoteFilePath, fi)) return false; } return true; } const QString nativePath = QDir::toNativeSeparators(fileInfo.filePath()); QFile file(fileInfo.filePath()); if (!file.open(QIODevice::ReadOnly)) { const QString message = tr("Error reading file '%1': %2.") .arg(nativePath, file.errorString()); if (m_ignoreMissingFiles) { raiseWarning(message); return true; } else { raiseError(message); return false; } } const int chunkSize = 1024*1024; emit addOutput(tr("Adding file '%1' to tarball...").arg(nativePath), MessageOutput); // TODO: Wasteful. Work with fixed-size buffer. while (!file.atEnd() && file.error() == QFile::NoError && tarFile.error() == QFile::NoError) { const QByteArray data = file.read(chunkSize); tarFile.write(data); if (fi.isCanceled()) return false; } if (file.error() != QFile::NoError) { raiseError(tr("Error reading file '%1': %2.").arg(nativePath, file.errorString())); return false; } const int blockModulo = file.size() % TarBlockSize; if (blockModulo != 0) tarFile.write(QByteArray(TarBlockSize - blockModulo, 0)); if (tarFile.error() != QFile::NoError) { raiseError(tr("Error writing tar file '%1': %2.") .arg(QDir::toNativeSeparators(tarFile.fileName()), tarFile.errorString())); return false; } return true; } bool TarPackageCreationStep::writeHeader(QFile &tarFile, const QFileInfo &fileInfo, const QString &remoteFilePath) { TarFileHeader header; std::memset(&header, '\0', sizeof header); const QByteArray &filePath = remoteFilePath.toUtf8(); const int maxFilePathLength = sizeof header.fileNamePrefix + sizeof header.fileName; if (filePath.count() > maxFilePathLength) { raiseError(tr("Cannot add file '%1' to tar-archive: path too long.") .arg(QDir::toNativeSeparators(remoteFilePath))); return false; } const int fileNameBytesToWrite = qMin(filePath.length(), sizeof header.fileName); const int fileNameOffset = filePath.length() - fileNameBytesToWrite; std::memcpy(&header.fileName, filePath.data() + fileNameOffset, fileNameBytesToWrite); if (fileNameOffset > 0) std::memcpy(&header.fileNamePrefix, filePath.data(), fileNameOffset); int permissions = (0400 * fileInfo.permission(QFile::ReadOwner)) | (0200 * fileInfo.permission(QFile::WriteOwner)) | (0100 * fileInfo.permission(QFile::ExeOwner)) | (040 * fileInfo.permission(QFile::ReadGroup)) | (020 * fileInfo.permission(QFile::WriteGroup)) | (010 * fileInfo.permission(QFile::ExeGroup)) | (04 * fileInfo.permission(QFile::ReadOther)) | (02 * fileInfo.permission(QFile::WriteOther)) | (01 * fileInfo.permission(QFile::ExeOther)); const QByteArray permissionString = QString::fromLatin1("%1").arg(permissions, sizeof header.fileMode - 1, 8, QLatin1Char('0')).toLatin1(); std::memcpy(&header.fileMode, permissionString.data(), permissionString.length()); const QByteArray uidString = QString::fromLatin1("%1").arg(fileInfo.ownerId(), sizeof header.uid - 1, 8, QLatin1Char('0')).toLatin1(); std::memcpy(&header.uid, uidString.data(), uidString.length()); const QByteArray gidString = QString::fromLatin1("%1").arg(fileInfo.groupId(), sizeof header.gid - 1, 8, QLatin1Char('0')).toLatin1(); std::memcpy(&header.gid, gidString.data(), gidString.length()); const QByteArray sizeString = QString::fromLatin1("%1").arg(fileInfo.size(), sizeof header.length - 1, 8, QLatin1Char('0')).toLatin1(); std::memcpy(&header.length, sizeString.data(), sizeString.length()); const QByteArray mtimeString = QString::fromLatin1("%1").arg(fileInfo.lastModified().toTime_t(), sizeof header.mtime - 1, 8, QLatin1Char('0')).toLatin1(); std::memcpy(&header.mtime, mtimeString.data(), mtimeString.length()); if (fileInfo.isDir()) header.typeflag = '5'; std::memcpy(&header.magic, "ustar", sizeof "ustar"); std::memcpy(&header.version, "00", 2); const QByteArray &owner = fileInfo.owner().toUtf8(); std::memcpy(&header.uname, owner.data(), qMin(owner.length(), sizeof header.uname - 1)); const QByteArray &group = fileInfo.group().toUtf8(); std::memcpy(&header.gname, group.data(), qMin(group.length(), sizeof header.gname - 1)); std::memset(&header.chksum, ' ', sizeof header.chksum); quint64 checksum = 0; for (size_t i = 0; i < sizeof header; ++i) checksum += reinterpret_cast(&header)[i]; const QByteArray checksumString = QString::fromLatin1("%1").arg(checksum, sizeof header.chksum - 1, 8, QLatin1Char('0')).toLatin1(); std::memcpy(&header.chksum, checksumString.data(), checksumString.length()); header.chksum[sizeof header.chksum-1] = 0; if (!tarFile.write(reinterpret_cast(&header), sizeof header)) { raiseError(tr("Error writing tar file '%1': %2") .arg(QDir::toNativeSeparators(cachedPackageFilePath()), tarFile.errorString())); return false; } return true; } QString TarPackageCreationStep::packageFileName() const { return project()->displayName() + QLatin1String(".tar"); } BuildStepConfigWidget *TarPackageCreationStep::createConfigWidget() { return new CreateTarStepWidget(this); } bool TarPackageCreationStep::fromMap(const QVariantMap &map) { if (!AbstractPackagingStep::fromMap(map)) return false; setIgnoreMissingFiles(map.value(QLatin1String(IgnoreMissingFilesKey), false).toBool()); return true; } QVariantMap TarPackageCreationStep::toMap() const { QVariantMap map = AbstractPackagingStep::toMap(); map.insert(QLatin1String(IgnoreMissingFilesKey), ignoreMissingFiles()); return map; } Core::Id TarPackageCreationStep::stepId() { return "MaemoTarPackageCreationStep"; } QString TarPackageCreationStep::displayName() { return tr("Create tarball"); } } // namespace RemoteLinux #include "tarpackagecreationstep.moc" ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationwidget.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationwi0000644000015301777760000000444512321547255034136 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXDEPLOYCONFIGURATIONWIDGET_H #define REMOTELINUXDEPLOYCONFIGURATIONWIDGET_H #include "remotelinux_export.h" #include namespace RemoteLinux { class RemoteLinuxDeployConfiguration; namespace Internal { class RemoteLinuxDeployConfigurationWidgetPrivate; } // namespace Internal class REMOTELINUX_EXPORT RemoteLinuxDeployConfigurationWidget : public ProjectExplorer::NamedWidget { Q_OBJECT public: explicit RemoteLinuxDeployConfigurationWidget(RemoteLinux::RemoteLinuxDeployConfiguration *dc, QWidget *parent = 0); ~RemoteLinuxDeployConfigurationWidget(); private slots: void updateDeploymentDataModel(); private: Internal::RemoteLinuxDeployConfigurationWidgetPrivate * const d; }; } // namespace RemoteLinux #endif // REMOTELINUXDEPLOYCONFIGURATIONWIDGET_H ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationfactory.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationfa0000644000015301777760000001137012321547255034100 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxdeployconfigurationfactory.h" #include "genericdirectuploadstep.h" #include "remotelinuxcheckforfreediskspacestep.h" #include "remotelinux_constants.h" #include "remotelinuxdeployconfiguration.h" #include #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { namespace { QString genericLinuxDisplayName() { return QCoreApplication::translate("RemoteLinux", "Deploy to Remote Linux Host"); } } // anonymous namespace RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory(QObject *parent) : DeployConfigurationFactory(parent) { setObjectName(QLatin1String("RemoteLinuxDeployConfiguration"));} QList RemoteLinuxDeployConfigurationFactory::availableCreationIds(Target *parent) const { QList ids; if (!parent->project()->supportsKit(parent->kit())) return ids; ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->kit()); if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::LinuxOS) return ids; const Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit()); if (devType == Constants::GenericLinuxOsType) ids << genericDeployConfigurationId(); return ids; } QString RemoteLinuxDeployConfigurationFactory::displayNameForId(const Core::Id id) const { if (id == genericDeployConfigurationId()) return genericLinuxDisplayName(); return QString(); } bool RemoteLinuxDeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const { return availableCreationIds(parent).contains(id); } DeployConfiguration *RemoteLinuxDeployConfigurationFactory::create(Target *parent, const Core::Id id) { Q_ASSERT(canCreate(parent, id)); DeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id, genericLinuxDisplayName()); dc->stepList()->insertStep(0, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); dc->stepList()->insertStep(1, new GenericDirectUploadStep(dc->stepList(), GenericDirectUploadStep::stepId())); return dc; } bool RemoteLinuxDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const { return canCreate(parent, idFromMap(map)); } DeployConfiguration *RemoteLinuxDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; Core::Id id = idFromMap(map); RemoteLinuxDeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id, genericLinuxDisplayName()); if (!dc->fromMap(map)) { delete dc; return 0; } return dc; } DeployConfiguration *RemoteLinuxDeployConfigurationFactory::clone(Target *parent, DeployConfiguration *product) { if (!canClone(parent, product)) return 0; return new RemoteLinuxDeployConfiguration(parent, qobject_cast(product)); } Core::Id RemoteLinuxDeployConfigurationFactory::genericDeployConfigurationId() { return "DeployToGenericLinux"; } } // namespace Internal } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/sshkeydeployer.cpp0000644000015301777760000000670612321547255031053 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "sshkeydeployer.h" #include #include using namespace QSsh; namespace RemoteLinux { namespace Internal { class SshKeyDeployerPrivate { public: SshRemoteProcessRunner deployProcess; }; } // namespace Internal SshKeyDeployer::SshKeyDeployer(QObject *parent) : QObject(parent), d(new Internal::SshKeyDeployerPrivate) { } SshKeyDeployer::~SshKeyDeployer() { cleanup(); delete d; } void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams, const QString &keyFilePath) { cleanup(); Utils::FileReader reader; if (!reader.fetch(keyFilePath)) { emit error(tr("Public key error: %1").arg(reader.errorString())); return; } connect(&d->deployProcess, SIGNAL(connectionError()), SLOT(handleConnectionFailure())); connect(&d->deployProcess, SIGNAL(processClosed(int)), SLOT(handleKeyUploadFinished(int))); const QByteArray command = "test -d .ssh " "|| mkdir .ssh && chmod 0700 .ssh && echo '" + reader.data() + "' >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys"; d->deployProcess.run(command, sshParams); } void SshKeyDeployer::handleConnectionFailure() { cleanup(); emit error(tr("Connection failed: %1").arg(d->deployProcess.lastConnectionErrorString())); } void SshKeyDeployer::handleKeyUploadFinished(int exitStatus) { Q_ASSERT(exitStatus == SshRemoteProcess::FailedToStart || exitStatus == SshRemoteProcess::CrashExit || exitStatus == SshRemoteProcess::NormalExit); const int exitCode = d->deployProcess.processExitCode(); const QString errorMsg = d->deployProcess.processErrorString(); cleanup(); if (exitStatus == SshRemoteProcess::NormalExit && exitCode == 0) emit finishedSuccessfully(); else emit error(tr("Key deployment failed: %1.").arg(errorMsg)); } void SshKeyDeployer::stopDeployment() { cleanup(); } void SshKeyDeployer::cleanup() { disconnect(&d->deployProcess, 0, this, 0); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentaspectwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentaspectwidg0000644000015301777760000000773712321547255034140 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxenvironmentaspectwidget.h" #include "remotelinuxenvironmentreader.h" #include #include #include namespace { const QString FetchEnvButtonText = QCoreApplication::translate("RemoteLinux::RemoteLinuxEnvironmentAspectWidget", "Fetch Device Environment"); } // anonymous namespace namespace RemoteLinux { RemoteLinuxEnvironmentAspectWidget::RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect) : ProjectExplorer::EnvironmentAspectWidget(aspect, new QPushButton), deviceEnvReader(new Internal::RemoteLinuxEnvironmentReader(aspect->runConfiguration(), this)) { QPushButton *button = fetchButton(); button->setText(FetchEnvButtonText); connect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); connect(deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished())); connect(deviceEnvReader, SIGNAL(error(QString)), this, SLOT(fetchEnvironmentError(QString))); } RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspectWidget::aspect() const { return dynamic_cast(EnvironmentAspectWidget::aspect()); } QPushButton *RemoteLinuxEnvironmentAspectWidget::fetchButton() const { return qobject_cast(additionalWidget()); } void RemoteLinuxEnvironmentAspectWidget::fetchEnvironment() { QPushButton *button = fetchButton(); disconnect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); connect(button, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment())); button->setText(tr("Cancel Fetch Operation")); deviceEnvReader->start(); } void RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentFinished() { QPushButton *button = fetchButton(); disconnect(button, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment())); connect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); button->setText(FetchEnvButtonText); aspect()->setRemoteEnvironment(deviceEnvReader->remoteEnvironment()); } void RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentError(const QString &error) { QMessageBox::warning(this, tr("Device Error"), tr("Fetching environment failed: %1").arg(error)); } void RemoteLinuxEnvironmentAspectWidget::stopFetchEnvironment() { deviceEnvReader->stop(); fetchEnvironmentFinished(); } // -------------------------------------------------------------------- // RemoteLinuxEnvironmentAspectWidget: // -------------------------------------------------------------------- } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxplugin.cpp0000644000015301777760000000530612321547255031566 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxplugin.h" #include "embeddedlinuxqtversionfactory.h" #include "genericlinuxdeviceconfigurationfactory.h" #include "genericremotelinuxdeploystepfactory.h" #include "remotelinuxdeployconfigurationfactory.h" #include "remotelinuxrunconfigurationfactory.h" #include "remotelinuxruncontrolfactory.h" #include namespace RemoteLinux { namespace Internal { RemoteLinuxPlugin::RemoteLinuxPlugin() { setObjectName(QLatin1String("RemoteLinuxPlugin")); } bool RemoteLinuxPlugin::initialize(const QStringList &arguments, QString *errorMessage) { Q_UNUSED(arguments) Q_UNUSED(errorMessage) addObject(this); addAutoReleasedObject(new GenericLinuxDeviceConfigurationFactory); addAutoReleasedObject(new RemoteLinuxRunConfigurationFactory); addAutoReleasedObject(new RemoteLinuxRunControlFactory); addAutoReleasedObject(new RemoteLinuxDeployConfigurationFactory); addAutoReleasedObject(new GenericRemoteLinuxDeployStepFactory); addAutoReleasedObject(new EmbeddedLinuxQtVersionFactory); return true; } RemoteLinuxPlugin::~RemoteLinuxPlugin() { removeObject(this); } void RemoteLinuxPlugin::extensionsInitialized() { } } // namespace Internal } // namespace RemoteLinux Q_EXPORT_PLUGIN(RemoteLinux::Internal::RemoteLinuxPlugin) ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/embeddedlinuxqtversionfactory.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/embeddedlinuxqtversionfactory.cp0000644000015301777760000000645012321547255033771 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "embeddedlinuxqtversionfactory.h" #include "embeddedlinuxqtversion.h" #include "remotelinux_constants.h" #include namespace RemoteLinux { namespace Internal { EmbeddedLinuxQtVersionFactory::EmbeddedLinuxQtVersionFactory(QObject *parent) : QtSupport::QtVersionFactory(parent) { } EmbeddedLinuxQtVersionFactory::~EmbeddedLinuxQtVersionFactory() { } bool EmbeddedLinuxQtVersionFactory::canRestore(const QString &type) { return type == QLatin1String(RemoteLinux::Constants::EMBEDDED_LINUX_QT); } QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::restore(const QString &type, const QVariantMap &data) { if (!canRestore(type)) return 0; EmbeddedLinuxQtVersion *v = new EmbeddedLinuxQtVersion; v->fromMap(data); return v; } int EmbeddedLinuxQtVersionFactory::priority() const { return 10; } QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource) { Q_UNUSED(evaluator); QFileInfo fi = qmakePath.toFileInfo(); if (!fi.exists() || !fi.isExecutable() || !fi.isFile()) return 0; EmbeddedLinuxQtVersion *version = new EmbeddedLinuxQtVersion(qmakePath, isAutoDetected, autoDetectionSource); QList abis = version->qtAbis(); // Note: This fails for e.g. intel/meego cross builds on x86 linux machines. if (abis.count() == 1 && abis.at(0).os() == ProjectExplorer::Abi::LinuxOS && !ProjectExplorer::Abi::hostAbi().isCompatibleWith(abis.at(0))) return version; delete version; return 0; } } // namespace Internal } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfiguration.h0000644000015301777760000000740312321547255033331 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXRUNCONFIGURATION_H #define REMOTELINUXRUNCONFIGURATION_H #include "remotelinux_export.h" #include "abstractremotelinuxrunconfiguration.h" #include #include namespace Utils { class Environment; class PortList; } namespace RemoteLinux { class RemoteLinuxRunConfigurationWidget; class RemoteLinuxDeployConfiguration; namespace Internal { class RemoteLinuxRunConfigurationPrivate; class RemoteLinuxRunConfigurationFactory; } // namespace Internal class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public AbstractRemoteLinuxRunConfiguration { Q_OBJECT Q_DISABLE_COPY(RemoteLinuxRunConfiguration) friend class Internal::RemoteLinuxRunConfigurationFactory; friend class RemoteLinuxRunConfigurationWidget; public: RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &projectFilePath); ~RemoteLinuxRunConfiguration(); bool isEnabled() const; QString disabledReason() const; QWidget *createConfigurationWidget(); Utils::OutputFormatter *createOutputFormatter() const; virtual Utils::Environment environment() const; QString localExecutableFilePath() const; QString defaultRemoteExecutableFilePath() const; QString remoteExecutableFilePath() const; QStringList arguments() const; void setArguments(const QString &args); QString workingDirectory() const; void setWorkingDirectory(const QString &wd); void setAlternateRemoteExecutable(const QString &exe); QString alternateRemoteExecutable() const; void setUseAlternateExecutable(bool useAlternate); bool useAlternateExecutable() const; QVariantMap toMap() const; int portsUsedByDebuggers() const; QString projectFilePath() const; static const char *IdPrefix; protected: RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, RemoteLinuxRunConfiguration *source); bool fromMap(const QVariantMap &map); QString defaultDisplayName(); void setDisabledReason(const QString &reason) const; protected slots: void updateEnabledState() { emit enabledChanged(); } private slots: void handleBuildSystemDataUpdated(); private: void init(); Internal::RemoteLinuxRunConfigurationPrivate * const d; }; } // namespace RemoteLinux #endif // REMOTELINUXRUNCONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericdirectuploadstep.h0000644000015301777760000000515312321547255032351 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef DIRECTUPLOADSTEP_H #define DIRECTUPLOADSTEP_H #include "abstractremotelinuxdeploystep.h" #include "genericdirectuploadservice.h" #include "remotelinux_export.h" namespace RemoteLinux { namespace Internal { class GenericDirectUploadStepPrivate; } class REMOTELINUX_EXPORT GenericDirectUploadStep : public AbstractRemoteLinuxDeployStep { Q_OBJECT public: GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id); GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, GenericDirectUploadStep *other); ~GenericDirectUploadStep(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); bool initInternal(QString *error = 0); void setIncrementalDeployment(bool incremental); bool incrementalDeployment() const; void setIgnoreMissingFiles(bool ignoreMissingFiles); bool ignoreMissingFiles() const; static Core::Id stepId(); static QString displayName(); private: GenericDirectUploadService *deployService() const; bool fromMap(const QVariantMap &map); QVariantMap toMap() const; void ctor(); Internal::GenericDirectUploadStepPrivate *d; }; } //namespace RemoteLinux #endif // DIRECTUPLOADSTEP_H ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxdeployservice.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxdeployservice0000644000015301777760000002520712321547255034112 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "abstractremotelinuxdeployservice.h" #include #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace QSsh; namespace RemoteLinux { namespace Internal { namespace { class DeployParameters { public: DeployParameters(const DeployableFile &d, const QString &h, const QString &s) : file(d), host(h), sysroot(s) {} bool operator==(const DeployParameters &other) const { return file == other.file && host == other.host && sysroot == other.sysroot; } DeployableFile file; QString host; QString sysroot; }; uint qHash(const DeployParameters &p) { return qHash(qMakePair(qMakePair(p.file, p.host), p.sysroot)); } enum State { Inactive, SettingUpDevice, Connecting, Deploying }; // TODO: Just change these... const char LastDeployedHostsKey[] = "Qt4ProjectManager.MaemoRunConfiguration.LastDeployedHosts"; const char LastDeployedSysrootsKey[] = "Qt4ProjectManager.MaemoRunConfiguration.LastDeployedSysroots"; const char LastDeployedFilesKey[] = "Qt4ProjectManager.MaemoRunConfiguration.LastDeployedFiles"; const char LastDeployedRemotePathsKey[] = "Qt4ProjectManager.MaemoRunConfiguration.LastDeployedRemotePaths"; const char LastDeployedTimesKey[] = "Qt4ProjectManager.MaemoRunConfiguration.LastDeployedTimes"; } // anonymous namespace class AbstractRemoteLinuxDeployServicePrivate { public: AbstractRemoteLinuxDeployServicePrivate() : kit(0), connection(0), state(Inactive), stopRequested(false) {} IDevice::ConstPtr deviceConfiguration; QPointer target; Kit *kit; SshConnection *connection; State state; bool stopRequested; QHash lastDeployed; }; } // namespace Internal using namespace Internal; AbstractRemoteLinuxDeployService::AbstractRemoteLinuxDeployService(QObject *parent) : QObject(parent), d(new AbstractRemoteLinuxDeployServicePrivate) { } AbstractRemoteLinuxDeployService::~AbstractRemoteLinuxDeployService() { delete d; } const Target *AbstractRemoteLinuxDeployService::target() const { return d->target; } const Kit *AbstractRemoteLinuxDeployService::profile() const { return d->kit; } IDevice::ConstPtr AbstractRemoteLinuxDeployService::deviceConfiguration() const { return d->deviceConfiguration; } SshConnection *AbstractRemoteLinuxDeployService::connection() const { return d->connection; } void AbstractRemoteLinuxDeployService::saveDeploymentTimeStamp(const DeployableFile &deployableFile) { if (!d->target) return; QString systemRoot; if (SysRootKitInformation::hasSysRoot(d->kit)) systemRoot = SysRootKitInformation::sysRoot(d->kit).toString(); d->lastDeployed.insert(DeployParameters(deployableFile, deviceConfiguration()->sshParameters().host, systemRoot), QDateTime::currentDateTime()); } bool AbstractRemoteLinuxDeployService::hasChangedSinceLastDeployment(const DeployableFile &deployableFile) const { if (!target()) return true; QString systemRoot; if (SysRootKitInformation::hasSysRoot(d->kit)) systemRoot = SysRootKitInformation::sysRoot(d->kit).toString(); const QDateTime &lastDeployed = d->lastDeployed.value(DeployParameters(deployableFile, deviceConfiguration()->sshParameters().host, systemRoot)); return !lastDeployed.isValid() || deployableFile.localFilePath().toFileInfo().lastModified() > lastDeployed; } void AbstractRemoteLinuxDeployService::setTarget(Target *target) { d->target = target; if (target) d->kit = target->kit(); else d->kit = 0; d->deviceConfiguration = DeviceKitInformation::device(d->kit); } void AbstractRemoteLinuxDeployService::start() { QTC_ASSERT(d->state == Inactive, return); QString errorMsg; if (!isDeploymentPossible(&errorMsg)) { emit errorMessage(errorMsg); emit finished(); return; } if (!isDeploymentNecessary()) { emit progressMessage(tr("No deployment action necessary. Skipping.")); emit finished(); return; } d->state = SettingUpDevice; doDeviceSetup(); } void AbstractRemoteLinuxDeployService::stop() { if (d->stopRequested) return; switch (d->state) { case Inactive: break; case SettingUpDevice: d->stopRequested = true; stopDeviceSetup(); break; case Connecting: setFinished(); break; case Deploying: d->stopRequested = true; stopDeployment(); break; } } bool AbstractRemoteLinuxDeployService::isDeploymentPossible(QString *whyNot) const { if (!deviceConfiguration()) { if (whyNot) *whyNot = tr("No device configuration set."); return false; } return true; } QVariantMap AbstractRemoteLinuxDeployService::exportDeployTimes() const { QVariantMap map; QVariantList hostList; QVariantList fileList; QVariantList sysrootList; QVariantList remotePathList; QVariantList timeList; typedef QHash::ConstIterator DepIt; for (DepIt it = d->lastDeployed.begin(); it != d->lastDeployed.end(); ++it) { fileList << it.key().file.localFilePath().toString(); remotePathList << it.key().file.remoteDirectory(); hostList << it.key().host; sysrootList << it.key().sysroot; timeList << it.value(); } map.insert(QLatin1String(LastDeployedHostsKey), hostList); map.insert(QLatin1String(LastDeployedSysrootsKey), sysrootList); map.insert(QLatin1String(LastDeployedFilesKey), fileList); map.insert(QLatin1String(LastDeployedRemotePathsKey), remotePathList); map.insert(QLatin1String(LastDeployedTimesKey), timeList); return map; } void AbstractRemoteLinuxDeployService::importDeployTimes(const QVariantMap &map) { const QVariantList &hostList = map.value(QLatin1String(LastDeployedHostsKey)).toList(); const QVariantList &sysrootList = map.value(QLatin1String(LastDeployedSysrootsKey)).toList(); const QVariantList &fileList = map.value(QLatin1String(LastDeployedFilesKey)).toList(); const QVariantList &remotePathList = map.value(QLatin1String(LastDeployedRemotePathsKey)).toList(); const QVariantList &timeList = map.value(QLatin1String(LastDeployedTimesKey)).toList(); const int elemCount = qMin(qMin(qMin(hostList.size(), fileList.size()), qMin(remotePathList.size(), timeList.size())), sysrootList.size()); for (int i = 0; i < elemCount; ++i) { const DeployableFile df(fileList.at(i).toString(), remotePathList.at(i).toString()); d->lastDeployed.insert(DeployParameters(df, hostList.at(i).toString(), sysrootList.at(i).toString()), timeList.at(i).toDateTime()); } } void AbstractRemoteLinuxDeployService::handleDeviceSetupDone(bool success) { QTC_ASSERT(d->state == SettingUpDevice, return); if (!success || d->stopRequested) { setFinished(); return; } d->state = Connecting; d->connection = QSsh::acquireConnection(deviceConfiguration()->sshParameters()); connect(d->connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionFailure())); if (d->connection->state() == SshConnection::Connected) { handleConnected(); } else { connect(d->connection, SIGNAL(connected()), SLOT(handleConnected())); emit progressMessage(tr("Connecting to device...")); if (d->connection->state() == SshConnection::Unconnected) d->connection->connectToHost(); } } void AbstractRemoteLinuxDeployService::handleDeploymentDone() { QTC_ASSERT(d->state == Deploying, return); setFinished(); } void AbstractRemoteLinuxDeployService::handleConnected() { QTC_ASSERT(d->state == Connecting, return); if (d->stopRequested) { setFinished(); return; } d->state = Deploying; doDeploy(); } void AbstractRemoteLinuxDeployService::handleConnectionFailure() { switch (d->state) { case Inactive: case SettingUpDevice: qWarning("%s: Unexpected state %d.", Q_FUNC_INFO, d->state); break; case Connecting: { QString errorMsg = tr("Could not connect to host: %1").arg(d->connection->errorString()); if (deviceConfiguration()->machineType() == IDevice::Emulator) errorMsg += tr("\nDid the emulator fail to start?"); else errorMsg += tr("\nIs the device connected and set up for network access?"); emit errorMessage(errorMsg); setFinished(); break; } case Deploying: emit errorMessage(tr("Connection error: %1").arg(d->connection->errorString())); stopDeployment(); } } void AbstractRemoteLinuxDeployService::setFinished() { d->state = Inactive; if (d->connection) { disconnect(d->connection, 0, this, 0); QSsh::releaseConnection(d->connection); d->connection = 0; } d->stopRequested = false; emit finished(); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/embeddedlinuxqtversion.h0000644000015301777760000000422712321547255032226 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef EMBEDDEDLINUXQTVERSION_H #define EMBEDDEDLINUXQTVERSION_H #include namespace RemoteLinux { namespace Internal { class EmbeddedLinuxQtVersion : public QtSupport::BaseQtVersion { public: EmbeddedLinuxQtVersion(); EmbeddedLinuxQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString()); ~EmbeddedLinuxQtVersion(); EmbeddedLinuxQtVersion *clone() const; QString type() const; QList detectQtAbis() const; QString description() const; QString platformName() const; QString platformDisplayName() const; }; } // namespace Internal } // namespace RemoteLinux #endif // EMBEDDEDLINUXQTVERSION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/linuxdevice.h0000644000015301777760000000656512321547255027770 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LINUXDEVICECONFIGURATION_H #define LINUXDEVICECONFIGURATION_H #include "remotelinux_export.h" #include #include namespace QSsh { class SshConnectionParameters; } namespace Utils { class PortList; } namespace RemoteLinux { namespace Internal { class LinuxDevicePrivate; } class REMOTELINUX_EXPORT LinuxDevice : public ProjectExplorer::IDevice { Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::LinuxDevice) public: typedef QSharedPointer Ptr; typedef QSharedPointer ConstPtr; static Ptr create(); static Ptr create(const QString &name, Core::Id type, MachineType machineType, Origin origin = ManuallyAdded, Core::Id id = Core::Id()); QString displayType() const; ProjectExplorer::IDeviceWidget *createWidget(); QList actionIds() const; QString displayNameForActionId(Core::Id actionId) const; void executeAction(Core::Id actionId, QWidget *parent); ProjectExplorer::IDevice::Ptr clone() const; bool canCreateProcess() const { return true; } ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const; bool canAutoDetectPorts() const; ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const; bool canCreateProcessModel() const { return true; } ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const; bool hasDeviceTester() const { return true; } ProjectExplorer::DeviceTester *createDeviceTester() const; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; protected: LinuxDevice() {} LinuxDevice(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id); LinuxDevice(const LinuxDevice &other); private: LinuxDevice &operator=(const LinuxDevice &); }; } // namespace RemoteLinux #endif // LINUXDEVICECONFIGURATION_H ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationfactory.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationfacto0000644000015301777760000001164512321547255034123 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxrunconfigurationfactory.h" #include "remotelinux_constants.h" #include "remotelinuxrunconfiguration.h" #include #include #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { namespace { QString pathFromId(Core::Id id) { QByteArray idStr = id.name(); if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix)) return QString(); return QString::fromUtf8(idStr.mid(strlen(RemoteLinuxRunConfiguration::IdPrefix))); } } // namespace RemoteLinuxRunConfigurationFactory::RemoteLinuxRunConfigurationFactory(QObject *parent) : IRunConfigurationFactory(parent) { setObjectName(QLatin1String("RemoteLinuxRunConfigurationFactory")); } RemoteLinuxRunConfigurationFactory::~RemoteLinuxRunConfigurationFactory() { } bool RemoteLinuxRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const { if (!canHandle(parent)) return false; return !parent->applicationTargets().targetForProject(pathFromId(id)).isEmpty(); } bool RemoteLinuxRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const { if (!canHandle(parent)) return false; return idFromMap(map).name().startsWith(RemoteLinuxRunConfiguration::IdPrefix); } bool RemoteLinuxRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const { const RemoteLinuxRunConfiguration * const rlrc = qobject_cast(source); return rlrc && canCreate(parent, source->id()); } QList RemoteLinuxRunConfigurationFactory::availableCreationIds(Target *parent) const { QList result; if (!canHandle(parent)) return result; const Core::Id base = Core::Id(RemoteLinuxRunConfiguration::IdPrefix); foreach (const BuildTargetInfo &bti, parent->applicationTargets().list) result << base.withSuffix(bti.projectFilePath.toString()); return result; } QString RemoteLinuxRunConfigurationFactory::displayNameForId(const Core::Id id) const { return QFileInfo(pathFromId(id)).completeBaseName() + QLatin1Char(' ') + tr("(on Remote Generic Linux Host)"); } RunConfiguration *RemoteLinuxRunConfigurationFactory::doCreate(Target *parent, const Core::Id id) { return new RemoteLinuxRunConfiguration(parent, id, pathFromId(id)); } RunConfiguration *RemoteLinuxRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map) { Q_UNUSED(map); return new RemoteLinuxRunConfiguration(parent, Core::Id(RemoteLinuxRunConfiguration::IdPrefix), QString()); } RunConfiguration *RemoteLinuxRunConfigurationFactory::clone(Target *parent, RunConfiguration *source) { QTC_ASSERT(canClone(parent, source), return 0); RemoteLinuxRunConfiguration *old = static_cast(source); return new RemoteLinuxRunConfiguration(parent, old); } bool RemoteLinuxRunConfigurationFactory::canHandle(const Target *target) const { if (!target->project()->supportsKit(target->kit())) return false; const Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(target->kit()); return deviceType == RemoteLinux::Constants::GenericLinuxOsType; } } // namespace Internal } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxruncontrolfactory.cpp0000644000015301777760000001164012321547255034063 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxruncontrolfactory.h" #include "remotelinuxanalyzesupport.h" #include "remotelinuxdebugsupport.h" #include "remotelinuxrunconfiguration.h" #include "remotelinuxruncontrol.h" #include #include #include #include #include #include #include #include #include #include #include using namespace Analyzer; using namespace Debugger; using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { RemoteLinuxRunControlFactory::RemoteLinuxRunControlFactory(QObject *parent) : IRunControlFactory(parent) { } RemoteLinuxRunControlFactory::~RemoteLinuxRunControlFactory() { } bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const { if (mode != NormalRunMode && mode != DebugRunMode && mode != DebugRunModeWithBreakOnMain && mode != QmlProfilerRunMode) { return false; } const QByteArray idStr = runConfiguration->id().name(); return runConfiguration->isEnabled() && idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix); } RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage) { QTC_ASSERT(canRun(runConfig, mode), return 0); RemoteLinuxRunConfiguration *rc = qobject_cast(runConfig); QTC_ASSERT(rc, return 0); switch (mode) { case NormalRunMode: return new RemoteLinuxRunControl(rc); case DebugRunMode: case DebugRunModeWithBreakOnMain: { IDevice::ConstPtr dev = DeviceKitInformation::device(rc->target()->kit()); if (!dev) { *errorMessage = tr("Cannot debug: Kit has no device."); return 0; } if (rc->portsUsedByDebuggers() > dev->freePorts().count()) { *errorMessage = tr("Cannot debug: Not enough free ports available."); return 0; } DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc); if (mode == ProjectExplorer::DebugRunModeWithBreakOnMain) params.breakOnMain = true; DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage); if (!runControl) return 0; LinuxDeviceDebugSupport * const debugSupport = new LinuxDeviceDebugSupport(rc, runControl->engine()); connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished())); return runControl; } case QmlProfilerRunMode: { AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(rc, mode); AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig); RemoteLinuxAnalyzeSupport * const analyzeSupport = new RemoteLinuxAnalyzeSupport(rc, runControl, mode); connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished())); return runControl; } case NoRunMode: case CallgrindRunMode: case MemcheckRunMode: QTC_ASSERT(false, return 0); } QTC_ASSERT(false, return 0); return 0; } } // namespace Internal } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/embeddedlinuxqtversion.cpp0000644000015301777760000000557412321547255032567 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "embeddedlinuxqtversion.h" #include "remotelinux_constants.h" #include #include namespace RemoteLinux { namespace Internal { EmbeddedLinuxQtVersion::EmbeddedLinuxQtVersion() : BaseQtVersion() { } EmbeddedLinuxQtVersion::EmbeddedLinuxQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource) : BaseQtVersion(path, isAutodetected, autodetectionSource) { setDisplayName(defaultDisplayName(qtVersionString(), path, false)); } EmbeddedLinuxQtVersion::~EmbeddedLinuxQtVersion() { } EmbeddedLinuxQtVersion *EmbeddedLinuxQtVersion::clone() const { return new EmbeddedLinuxQtVersion(*this); } QString EmbeddedLinuxQtVersion::type() const { return QLatin1String(RemoteLinux::Constants::EMBEDDED_LINUX_QT); } QList EmbeddedLinuxQtVersion::detectQtAbis() const { return qtAbisFromLibrary(qtCorePaths(versionInfo(), qtVersionString())); } QString EmbeddedLinuxQtVersion::description() const { return QCoreApplication::translate("QtVersion", "Embedded Linux", "Qt Version is used for embedded Linux development"); } QString EmbeddedLinuxQtVersion::platformName() const { return QLatin1String(QtSupport::Constants::EMBEDDED_LINUX_PLATFORM); } QString EmbeddedLinuxQtVersion::platformDisplayName() const { return QLatin1String(QtSupport::Constants::EMBEDDED_LINUX_PLATFORM_TR); } } // namespace Internal } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdebugsupport.h0000644000015301777760000000550712321547255032463 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXDEBUGSUPPORT_H #define REMOTELINUXDEBUGSUPPORT_H #include "abstractremotelinuxrunsupport.h" namespace Debugger { class DebuggerEngine; class DebuggerStartParameters; } namespace RemoteLinux { class AbstractRemoteLinuxRunConfiguration; namespace Internal { class LinuxDeviceDebugSupportPrivate; } class REMOTELINUX_EXPORT LinuxDeviceDebugSupport : public AbstractRemoteLinuxRunSupport { Q_OBJECT public: static Debugger::DebuggerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig); LinuxDeviceDebugSupport(AbstractRemoteLinuxRunConfiguration *runConfig, Debugger::DebuggerEngine *engine); ~LinuxDeviceDebugSupport(); protected: void startExecution(); void handleAdapterSetupFailed(const QString &error); void handleAdapterSetupDone(); private slots: void handleRemoteSetupRequested(); void handleAppRunnerError(const QString &error); void handleRemoteOutput(const QByteArray &output); void handleRemoteErrorOutput(const QByteArray &output); void handleAppRunnerFinished(bool success); void handleProgressReport(const QString &progressOutput); void handleRemoteProcessStarted(); void handleDebuggingFinished(); private: void showMessage(const QString &msg, int channel); Internal::LinuxDeviceDebugSupportPrivate * const d; }; } // namespace RemoteLinux #endif // REMOTELINUXDEBUGSUPPORT_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericdirectuploadstep.cpp0000644000015301777760000001405512321547255032705 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "genericdirectuploadstep.h" #include "genericdirectuploadservice.h" #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { namespace { const char IncrementalKey[] = "RemoteLinux.GenericDirectUploadStep.Incremental"; const char IgnoreMissingFilesKey[] = "RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles"; class ConfigWidget : public SimpleBuildStepConfigWidget { Q_OBJECT public: ConfigWidget(GenericDirectUploadStep *step) : SimpleBuildStepConfigWidget(step) { m_incrementalCheckBox.setText(tr("Incremental deployment")); m_ignoreMissingFilesCheckBox.setText(tr("Ignore missing files")); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setMargin(0); mainLayout->addWidget(&m_incrementalCheckBox); mainLayout->addWidget(&m_ignoreMissingFilesCheckBox); m_incrementalCheckBox.setChecked(step->incrementalDeployment()); m_ignoreMissingFilesCheckBox.setChecked(step->ignoreMissingFiles()); connect(&m_incrementalCheckBox, SIGNAL(toggled(bool)), SLOT(handleIncrementalChanged(bool))); connect(&m_ignoreMissingFilesCheckBox, SIGNAL(toggled(bool)), SLOT(handleIgnoreMissingFilesChanged(bool))); } bool showWidget() const { return true; } private: Q_SLOT void handleIncrementalChanged(bool incremental) { GenericDirectUploadStep *step = qobject_cast(this->step()); step->setIncrementalDeployment(incremental); } Q_SLOT void handleIgnoreMissingFilesChanged(bool ignoreMissingFiles) { GenericDirectUploadStep *step = qobject_cast(this->step()); step->setIgnoreMissingFiles(ignoreMissingFiles); } QCheckBox m_incrementalCheckBox; QCheckBox m_ignoreMissingFilesCheckBox; }; } // anonymous namespace class GenericDirectUploadStepPrivate { public: GenericDirectUploadStepPrivate() : incremental(true), ignoreMissingFiles(false) {} GenericDirectUploadService deployService; bool incremental; bool ignoreMissingFiles; }; } // namespace Internal GenericDirectUploadStep::GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { ctor(); } GenericDirectUploadStep::GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, GenericDirectUploadStep *other) : AbstractRemoteLinuxDeployStep(bsl, other) { ctor(); } GenericDirectUploadStep::~GenericDirectUploadStep() { delete d; } BuildStepConfigWidget *GenericDirectUploadStep::createConfigWidget() { return new Internal::ConfigWidget(this); } bool GenericDirectUploadStep::initInternal(QString *error) { deployService()->setDeployableFiles(target()->deploymentData().allFiles()); deployService()->setIncrementalDeployment(incrementalDeployment()); deployService()->setIgnoreMissingFiles(ignoreMissingFiles()); return deployService()->isDeploymentPossible(error); } GenericDirectUploadService *GenericDirectUploadStep::deployService() const { return &d->deployService; } bool GenericDirectUploadStep::fromMap(const QVariantMap &map) { if (!AbstractRemoteLinuxDeployStep::fromMap(map)) return false; setIncrementalDeployment(map.value(QLatin1String(Internal::IncrementalKey), true).toBool()); setIgnoreMissingFiles(map.value(QLatin1String(Internal::IgnoreMissingFilesKey), false).toBool()); return true; } QVariantMap GenericDirectUploadStep::toMap() const { QVariantMap map = AbstractRemoteLinuxDeployStep::toMap(); map.insert(QLatin1String(Internal::IncrementalKey), incrementalDeployment()); map.insert(QLatin1String(Internal::IgnoreMissingFilesKey), ignoreMissingFiles()); return map; } void GenericDirectUploadStep::ctor() { setDefaultDisplayName(displayName()); d = new Internal::GenericDirectUploadStepPrivate; } void GenericDirectUploadStep::setIncrementalDeployment(bool incremental) { d->incremental = incremental; } bool GenericDirectUploadStep::incrementalDeployment() const { return d->incremental; } void GenericDirectUploadStep::setIgnoreMissingFiles(bool ignoreMissingFiles) { d->ignoreMissingFiles = ignoreMissingFiles; } bool GenericDirectUploadStep::ignoreMissingFiles() const { return d->ignoreMissingFiles; } Core::Id GenericDirectUploadStep::stepId() { return "RemoteLinux.DirectUploadStep"; } QString GenericDirectUploadStep::displayName() { return tr("Upload files via SFTP"); } } //namespace RemoteLinux #include "genericdirectuploadstep.moc" qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxruncontrol.cpp0000644000015301777760000001101112321547255032463 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxruncontrol.h" #include "abstractremotelinuxrunconfiguration.h" #include #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { class RemoteLinuxRunControl::RemoteLinuxRunControlPrivate { public: bool running; ProjectExplorer::DeviceApplicationRunner runner; IDevice::ConstPtr device; QString remoteExecutable; QStringList arguments; Utils::Environment environment; QString workingDir; }; RemoteLinuxRunControl::RemoteLinuxRunControl(RunConfiguration *rc) : RunControl(rc, ProjectExplorer::NormalRunMode), d(new RemoteLinuxRunControlPrivate) { d->running = false; d->device = DeviceKitInformation::device(rc->target()->kit()); const AbstractRemoteLinuxRunConfiguration * const lrc = qobject_cast(rc); d->remoteExecutable = lrc->remoteExecutableFilePath(); d->arguments = lrc->arguments(); d->environment = lrc->environment(); d->workingDir = lrc->workingDirectory(); } RemoteLinuxRunControl::~RemoteLinuxRunControl() { delete d; } void RemoteLinuxRunControl::start() { d->running = true; emit started(); d->runner.disconnect(this); connect(&d->runner, SIGNAL(reportError(QString)), SLOT(handleErrorMessage(QString))); connect(&d->runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteErrorOutput(QByteArray))); connect(&d->runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(&d->runner, SIGNAL(finished(bool)), SLOT(handleRunnerFinished())); connect(&d->runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); d->runner.setEnvironment(d->environment); d->runner.setWorkingDirectory(d->workingDir); d->runner.start(d->device, d->remoteExecutable, d->arguments); } RunControl::StopResult RemoteLinuxRunControl::stop() { d->runner.stop(); return AsynchronousStop; } void RemoteLinuxRunControl::handleErrorMessage(const QString &error) { appendMessage(error, Utils::ErrorMessageFormat); } void RemoteLinuxRunControl::handleRunnerFinished() { setFinished(); } void RemoteLinuxRunControl::handleRemoteOutput(const QByteArray &output) { appendMessage(QString::fromUtf8(output), Utils::StdOutFormatSameLine); } void RemoteLinuxRunControl::handleRemoteErrorOutput(const QByteArray &output) { appendMessage(QString::fromUtf8(output), Utils::StdErrFormatSameLine); } void RemoteLinuxRunControl::handleProgressReport(const QString &progressString) { appendMessage(progressString + QLatin1Char('\n'), Utils::NormalMessageFormat); } bool RemoteLinuxRunControl::isRunning() const { return d->running; } QIcon RemoteLinuxRunControl::icon() const { return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL)); } void RemoteLinuxRunControl::setFinished() { d->runner.disconnect(this); d->running = false; emit finished(); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeploymentdatamodel.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeploymentdatamodel.c0000644000015301777760000000554512321547255033770 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxdeploymentdatamodel.h" using namespace ProjectExplorer; namespace RemoteLinux { RemoteLinuxDeploymentDataModel::RemoteLinuxDeploymentDataModel(QObject *parent) : QAbstractTableModel(parent) { } void RemoteLinuxDeploymentDataModel::setDeploymentData(const DeploymentData &deploymentData) { beginResetModel(); m_deploymentData = deploymentData; endResetModel(); } int RemoteLinuxDeploymentDataModel::rowCount(const QModelIndex &parent) const { return parent.isValid() ? 0 : m_deploymentData.fileCount(); } int RemoteLinuxDeploymentDataModel::columnCount(const QModelIndex &parent) const { return parent.isValid() ? 0 : 2; } QVariant RemoteLinuxDeploymentDataModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Vertical || role != Qt::DisplayRole) return QVariant(); return section == 0 ? tr("Local File Path") : tr("Remote Directory"); } QVariant RemoteLinuxDeploymentDataModel::data(const QModelIndex &index, int role) const { if (!index.isValid() || index.row() >= rowCount() || index.column() >= columnCount()) return QVariant(); const DeployableFile &d = m_deploymentData.fileAt(index.row()); if (index.column() == 0 && role == Qt::DisplayRole) return d.localFilePath().toUserOutput(); if (role == Qt::DisplayRole) return d.remoteDirectory(); return QVariant(); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxrunsupport.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxrunsupport.cp0000644000015301777760000001260712321547255034077 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "abstractremotelinuxrunsupport.h" #include "abstractremotelinuxrunconfiguration.h" #include #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class AbstractRemoteLinuxRunSupportPrivate { public: AbstractRemoteLinuxRunSupportPrivate(const AbstractRemoteLinuxRunConfiguration *runConfig) : state(AbstractRemoteLinuxRunSupport::Inactive), device(DeviceKitInformation::device(runConfig->target()->kit())), remoteFilePath(runConfig->remoteExecutableFilePath()), arguments(runConfig->arguments()), environment(runConfig->environment()), workingDir(runConfig->workingDirectory()) { } AbstractRemoteLinuxRunSupport::State state; DeviceApplicationRunner appRunner; DeviceUsedPortsGatherer portsGatherer; const ProjectExplorer::IDevice::ConstPtr device; Utils::PortList portList; const QString remoteFilePath; const QStringList arguments; const Utils::Environment environment; const QString workingDir; }; } // namespace Internal using namespace Internal; AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(AbstractRemoteLinuxRunConfiguration *runConfig, QObject *parent) : QObject(parent), d(new AbstractRemoteLinuxRunSupportPrivate(runConfig)) { } AbstractRemoteLinuxRunSupport::~AbstractRemoteLinuxRunSupport() { setFinished(); delete d; } void AbstractRemoteLinuxRunSupport::setState(AbstractRemoteLinuxRunSupport::State state) { d->state = state; } AbstractRemoteLinuxRunSupport::State AbstractRemoteLinuxRunSupport::state() const { return d->state; } void AbstractRemoteLinuxRunSupport::handleRemoteSetupRequested() { QTC_ASSERT(d->state == Inactive, return); d->state = GatheringPorts; connect(&d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGathererError(QString))); connect(&d->portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady())); d->portsGatherer.start(d->device); } void AbstractRemoteLinuxRunSupport::handlePortsGathererError(const QString &message) { QTC_ASSERT(d->state == GatheringPorts, return); handleAdapterSetupFailed(message); } void AbstractRemoteLinuxRunSupport::handlePortListReady() { QTC_ASSERT(d->state == GatheringPorts, return); d->portList = d->device->freePorts(); startExecution(); } void AbstractRemoteLinuxRunSupport::handleAdapterSetupFailed(const QString &) { setFinished(); reset(); } void AbstractRemoteLinuxRunSupport::handleAdapterSetupDone() { d->state = Running; } void AbstractRemoteLinuxRunSupport::setFinished() { if (d->state == Inactive) return; if (d->state == Running) d->appRunner.stop(); d->state = Inactive; } bool AbstractRemoteLinuxRunSupport::setPort(int &port) { port = d->portsGatherer.getNextFreePort(&d->portList); if (port == -1) { handleAdapterSetupFailed(tr("Not enough free ports on device for debugging.")); return false; } return true; } QStringList AbstractRemoteLinuxRunSupport::arguments() const { return d->arguments; } QString AbstractRemoteLinuxRunSupport::remoteFilePath() const { return d->remoteFilePath; } Utils::Environment AbstractRemoteLinuxRunSupport::environment() const { return d->environment; } QString AbstractRemoteLinuxRunSupport::workingDirectory() const { return d->workingDir; } const IDevice::ConstPtr AbstractRemoteLinuxRunSupport::device() const { return d->device; } void AbstractRemoteLinuxRunSupport::reset() { d->portsGatherer.disconnect(this); d->appRunner.disconnect(this); d->state = Inactive; } DeviceApplicationRunner *AbstractRemoteLinuxRunSupport::appRunner() const { return &d->appRunner; } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationfactory.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationfacto0000644000015301777760000000542312321547255034120 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXRUNCONFIGURATIONFACTORY_H #define REMOTELINUXRUNCONFIGURATIONFACTORY_H #include namespace RemoteLinux { namespace Internal { class RemoteLinuxRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory { Q_OBJECT public: explicit RemoteLinuxRunConfigurationFactory(QObject *parent = 0); ~RemoteLinuxRunConfigurationFactory(); QString displayNameForId(const Core::Id id) const; QList availableCreationIds(ProjectExplorer::Target *parent) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); private: bool canHandle(const ProjectExplorer::Target *target) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, const QVariantMap &map); }; } // namespace Internal } // namespace RemoteLinux #endif // REMOTELINUXRUNCONFIGURATIONFACTORY_H ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericremotelinuxdeploystepfactory.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericremotelinuxdeploystepfact0000644000015301777760000001330312321547255034066 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "genericremotelinuxdeploystepfactory.h" #include "genericdirectuploadstep.h" #include "remotelinuxcheckforfreediskspacestep.h" #include "remotelinuxdeployconfiguration.h" #include "remotelinuxcustomcommanddeploymentstep.h" #include "tarpackagecreationstep.h" #include "uploadandinstalltarpackagestep.h" using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { GenericRemoteLinuxDeployStepFactory::GenericRemoteLinuxDeployStepFactory(QObject *parent) : IBuildStepFactory(parent) { } QList GenericRemoteLinuxDeployStepFactory::availableCreationIds(BuildStepList *parent) const { QList ids; if (!qobject_cast(parent->parent())) return ids; ids << TarPackageCreationStep::stepId() << UploadAndInstallTarPackageStep::stepId() << GenericDirectUploadStep::stepId() << GenericRemoteLinuxCustomCommandDeploymentStep::stepId() << RemoteLinuxCheckForFreeDiskSpaceStep::stepId(); return ids; } QString GenericRemoteLinuxDeployStepFactory::displayNameForId(const Core::Id id) const { if (id == TarPackageCreationStep::stepId()) return TarPackageCreationStep::displayName(); if (id == UploadAndInstallTarPackageStep::stepId()) return UploadAndInstallTarPackageStep::displayName(); if (id == GenericDirectUploadStep::stepId()) return GenericDirectUploadStep::displayName(); if (id == GenericRemoteLinuxCustomCommandDeploymentStep::stepId()) return GenericRemoteLinuxCustomCommandDeploymentStep::stepDisplayName(); if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId()) return RemoteLinuxCheckForFreeDiskSpaceStep::stepDisplayName(); return QString(); } bool GenericRemoteLinuxDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const { return availableCreationIds(parent).contains(id); } BuildStep *GenericRemoteLinuxDeployStepFactory::create(BuildStepList *parent, const Core::Id id) { Q_ASSERT(canCreate(parent, id)); if (id == TarPackageCreationStep::stepId()) return new TarPackageCreationStep(parent); if (id == UploadAndInstallTarPackageStep::stepId()) return new UploadAndInstallTarPackageStep(parent); if (id == GenericDirectUploadStep::stepId()) return new GenericDirectUploadStep(parent, GenericDirectUploadStep::stepId()); if (id == GenericRemoteLinuxCustomCommandDeploymentStep::stepId()) return new GenericRemoteLinuxCustomCommandDeploymentStep(parent); if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId()) return new RemoteLinuxCheckForFreeDiskSpaceStep(parent); return 0; } bool GenericRemoteLinuxDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, idFromMap(map)); } BuildStep *GenericRemoteLinuxDeployStepFactory::restore(BuildStepList *parent, const QVariantMap &map) { Q_ASSERT(canRestore(parent, map)); BuildStep * const step = create(parent, idFromMap(map)); if (!step->fromMap(map)) { delete step; return 0; } return step; } bool GenericRemoteLinuxDeployStepFactory::canClone(BuildStepList *parent, BuildStep *product) const { return canCreate(parent, product->id()); } BuildStep *GenericRemoteLinuxDeployStepFactory::clone(BuildStepList *parent, BuildStep *product) { if (TarPackageCreationStep * const other = qobject_cast(product)) return new TarPackageCreationStep(parent, other); if (UploadAndInstallTarPackageStep * const other = qobject_cast(product)) return new UploadAndInstallTarPackageStep(parent, other); if (GenericDirectUploadStep * const other = qobject_cast(product)) return new GenericDirectUploadStep(parent, other); if (GenericRemoteLinuxCustomCommandDeploymentStep * const other = qobject_cast(product)) return new GenericRemoteLinuxCustomCommandDeploymentStep(parent, other); if (RemoteLinuxCheckForFreeDiskSpaceStep * const other = qobject_cast(product)) return new RemoteLinuxCheckForFreeDiskSpaceStep(parent, other); return 0; } } // namespace Internal } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxanalyzesupport.cpp0000644000015301777760000001621712321547255033373 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxanalyzesupport.h" #include "remotelinuxrunconfiguration.h" #include #include #include #include #include #include #include #include #include #include using namespace QSsh; using namespace Analyzer; using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class RemoteLinuxAnalyzeSupportPrivate { public: RemoteLinuxAnalyzeSupportPrivate(AnalyzerRunControl *rc, RunMode runMode) : runControl(rc), qmlProfiling(runMode == QmlProfilerRunMode), qmlPort(-1) { } const QPointer runControl; bool qmlProfiling; int qmlPort; QmlDebug::QmlOutputParser outputParser; }; } // namespace Internal using namespace Internal; AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig, RunMode runMode) { AnalyzerStartParameters params; if (runMode == QmlProfilerRunMode) params.startMode = StartLocal; params.runMode = runMode; params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters(); params.displayName = runConfig->displayName(); params.sysroot = SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString(); params.analyzerHost = params.connParams.host; return params; } RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig, AnalyzerRunControl *engine, RunMode runMode) : AbstractRemoteLinuxRunSupport(runConfig, engine), d(new RemoteLinuxAnalyzeSupportPrivate(engine, runMode)) { connect(d->runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)), SLOT(handleRemoteSetupRequested())); connect(&d->outputParser, SIGNAL(waitingForConnectionOnPort(quint16)), SLOT(remoteIsRunning())); } RemoteLinuxAnalyzeSupport::~RemoteLinuxAnalyzeSupport() { delete d; } void RemoteLinuxAnalyzeSupport::showMessage(const QString &msg, Utils::OutputFormat format) { if (state() != Inactive && d->runControl) d->runControl->logApplicationMessage(msg, format); d->outputParser.processOutput(msg); } void RemoteLinuxAnalyzeSupport::handleRemoteSetupRequested() { QTC_ASSERT(state() == Inactive, return); showMessage(tr("Checking available ports...") + QLatin1Char('\n'), Utils::NormalMessageFormat); AbstractRemoteLinuxRunSupport::handleRemoteSetupRequested(); } void RemoteLinuxAnalyzeSupport::startExecution() { QTC_ASSERT(state() == GatheringPorts, return); // Currently we support only QML profiling QTC_ASSERT(d->qmlProfiling, return); if (!setPort(d->qmlPort)) return; setState(StartingRunner); DeviceApplicationRunner *runner = appRunner(); connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteErrorOutput(QByteArray))); connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool))); connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString))); const QStringList args = arguments() << QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(d->qmlPort); runner->setWorkingDirectory(workingDirectory()); runner->setEnvironment(environment()); runner->start(device(), remoteFilePath(), args); } void RemoteLinuxAnalyzeSupport::handleAppRunnerError(const QString &error) { if (state() == Running) showMessage(error, Utils::ErrorMessageFormat); else if (state() != Inactive) handleAdapterSetupFailed(error); } void RemoteLinuxAnalyzeSupport::handleAppRunnerFinished(bool success) { // reset needs to be called first to ensure that the correct state is set. reset(); if (!success) showMessage(tr("Failure running remote process."), Utils::NormalMessageFormat); d->runControl->notifyRemoteFinished(success); } void RemoteLinuxAnalyzeSupport::handleProfilingFinished() { setFinished(); } void RemoteLinuxAnalyzeSupport::remoteIsRunning() { d->runControl->notifyRemoteSetupDone(d->qmlPort); } void RemoteLinuxAnalyzeSupport::handleRemoteOutput(const QByteArray &output) { QTC_ASSERT(state() == Inactive || state() == Running, return); showMessage(QString::fromUtf8(output), Utils::StdOutFormat); } void RemoteLinuxAnalyzeSupport::handleRemoteErrorOutput(const QByteArray &output) { QTC_ASSERT(state() != GatheringPorts, return); if (!d->runControl) return; showMessage(QString::fromUtf8(output), Utils::StdErrFormat); } void RemoteLinuxAnalyzeSupport::handleProgressReport(const QString &progressOutput) { showMessage(progressOutput + QLatin1Char('\n'), Utils::NormalMessageFormat); } void RemoteLinuxAnalyzeSupport::handleAdapterSetupFailed(const QString &error) { AbstractRemoteLinuxRunSupport::handleAdapterSetupFailed(error); showMessage(tr("Initial setup failed: %1").arg(error), Utils::NormalMessageFormat); } void RemoteLinuxAnalyzeSupport::handleRemoteProcessStarted() { QTC_ASSERT(d->qmlProfiling, return); QTC_ASSERT(state() == StartingRunner, return); handleAdapterSetupDone(); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxrunsupport.h0000644000015301777760000000674312321547255033730 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ABSTRACTREMOTELINUXRUNSUPPORT_H #define ABSTRACTREMOTELINUXRUNSUPPORT_H #include "remotelinux_export.h" #include #include namespace ProjectExplorer { class DeviceApplicationRunner; } namespace Utils { class Environment; } namespace RemoteLinux { class AbstractRemoteLinuxRunConfiguration; namespace Internal { class AbstractRemoteLinuxRunSupportPrivate; } class REMOTELINUX_EXPORT AbstractRemoteLinuxRunSupport : public QObject { Q_OBJECT protected: enum State { Inactive, GatheringPorts, StartingRunner, Running }; public: AbstractRemoteLinuxRunSupport(AbstractRemoteLinuxRunConfiguration *runConfig, QObject *parent = 0); ~AbstractRemoteLinuxRunSupport(); protected: void setState(State state); State state() const; ProjectExplorer::DeviceApplicationRunner *appRunner() const; virtual void startExecution() = 0; virtual void handleAdapterSetupFailed(const QString &error); virtual void handleAdapterSetupDone(); void setFinished(); bool setPort(int &port); QStringList arguments() const; QString remoteFilePath() const; Utils::Environment environment() const; QString workingDirectory() const; const ProjectExplorer::IDevice::ConstPtr device() const; void reset(); protected slots: virtual void handleRemoteSetupRequested(); virtual void handleAppRunnerError(const QString &error) = 0; virtual void handleRemoteOutput(const QByteArray &output) = 0; virtual void handleRemoteErrorOutput(const QByteArray &output) = 0; virtual void handleAppRunnerFinished(bool success) = 0; virtual void handleProgressReport(const QString &progressOutput) = 0; private slots: void handlePortsGathererError(const QString &message); void handlePortListReady(); private: friend class Internal::AbstractRemoteLinuxRunSupportPrivate; Internal::AbstractRemoteLinuxRunSupportPrivate * const d; }; } // namespace RemoteLinux #endif // ABSTRACTREMOTELINUXRUNSUPPORT_H ././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwizardsetuppage.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000001227612321547255034052 0ustar pbusernogroup00000000000000 RemoteLinux::Internal::GenericLinuxDeviceConfigurationWizardSetupPage 0 0 564 207 WizardPage The name to identify this configuration: The device's host name or IP address: Qt::Horizontal 40 20 The user name to log into the device: Qt::Horizontal 153 21 The authentication type: Password Key Qt::Horizontal 40 20 The user's password: QLineEdit::Password Qt::Horizontal 40 20 The file containing the user's private key: Qt::Horizontal 40 20 Utils::PathChooser QWidget
utils/pathchooser.h
1 editingFinished() browsingFinished()
././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeployservice.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeployse0000644000015301777760000001112412321547255034120 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxcustomcommanddeployservice.h" #include #include using namespace QSsh; namespace RemoteLinux { namespace Internal { namespace { enum State { Inactive, Running }; } class RemoteLinuxCustomCommandDeployservicePrivate { public: RemoteLinuxCustomCommandDeployservicePrivate() : state(Inactive), runner(0) { } QString commandLine; State state; SshRemoteProcessRunner *runner; }; } // namespace Internal using namespace Internal; RemoteLinuxCustomCommandDeployService::RemoteLinuxCustomCommandDeployService(QObject *parent) : AbstractRemoteLinuxDeployService(parent), d(new RemoteLinuxCustomCommandDeployservicePrivate) { } RemoteLinuxCustomCommandDeployService::~RemoteLinuxCustomCommandDeployService() { delete d; } void RemoteLinuxCustomCommandDeployService::setCommandLine(const QString &commandLine) { QTC_ASSERT(d->state == Inactive, return); d->commandLine = commandLine; } bool RemoteLinuxCustomCommandDeployService::isDeploymentPossible(QString *whyNot) const { QTC_ASSERT(d->state == Inactive, return false); if (!AbstractRemoteLinuxDeployService::isDeploymentPossible(whyNot)) return false; if (d->commandLine.isEmpty()) { if (whyNot) *whyNot = tr("No command line given."); return false; } return true; } void RemoteLinuxCustomCommandDeployService::doDeploy() { QTC_ASSERT(d->state == Inactive, handleDeploymentDone()); if (!d->runner) d->runner = new SshRemoteProcessRunner(this); connect(d->runner, SIGNAL(readyReadStandardOutput()), SLOT(handleStdout())); connect(d->runner, SIGNAL(readyReadStandardError()), SLOT(handleStderr())); connect(d->runner, SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int))); emit progressMessage(tr("Starting remote command '%1'...").arg(d->commandLine)); d->state = Running; d->runner->run(d->commandLine.toUtf8(), deviceConfiguration()->sshParameters()); } void RemoteLinuxCustomCommandDeployService::stopDeployment() { QTC_ASSERT(d->state == Running, return); disconnect(d->runner, 0, this, 0); d->runner->cancel(); d->state = Inactive; handleDeploymentDone(); } void RemoteLinuxCustomCommandDeployService::handleStdout() { emit stdOutData(QString::fromUtf8(d->runner->readAllStandardOutput())); } void RemoteLinuxCustomCommandDeployService::handleStderr() { emit stdErrData(QString::fromUtf8(d->runner->readAllStandardError())); } void RemoteLinuxCustomCommandDeployService::handleProcessClosed(int exitStatus) { QTC_ASSERT(d->state == Running, return); if (exitStatus == SshRemoteProcess::FailedToStart) { emit errorMessage(tr("Remote process failed to start.")); } else if (exitStatus == SshRemoteProcess::CrashExit) { emit errorMessage(tr("Remote process was killed by a signal.")); } else if (d->runner->processExitCode() != 0) { emit errorMessage(tr("Remote process finished with exit code %1.") .arg(d->runner->processExitCode())); } else { emit progressMessage(tr("Remote command finished successfully.")); } stopDeployment(); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractpackagingstep.cpp0000644000015301777760000001300112321547255032327 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "abstractpackagingstep.h" #include #include #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class AbstractPackagingStepPrivate { public: AbstractPackagingStepPrivate() : currentBuildConfiguration(0) { } BuildConfiguration *currentBuildConfiguration; QString cachedPackageFilePath; QString cachedPackageDirectory; bool deploymentDataModified; }; } // namespace Internal AbstractPackagingStep::AbstractPackagingStep(BuildStepList *bsl, const Core::Id id) : BuildStep(bsl, id) { ctor(); } AbstractPackagingStep::AbstractPackagingStep(BuildStepList *bsl, AbstractPackagingStep *other) : BuildStep(bsl, other) { ctor(); } void AbstractPackagingStep::ctor() { d = new Internal::AbstractPackagingStepPrivate; connect(target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), SLOT(handleBuildConfigurationChanged())); handleBuildConfigurationChanged(); connect(target(), SIGNAL(deploymentDataChanged()), SLOT(setDeploymentDataModified())); setDeploymentDataModified(); connect(this, SIGNAL(unmodifyDeploymentData()), this, SLOT(setDeploymentDataUnmodified())); } AbstractPackagingStep::~AbstractPackagingStep() { delete d; } void AbstractPackagingStep::handleBuildConfigurationChanged() { if (d->currentBuildConfiguration) disconnect(d->currentBuildConfiguration, 0, this, 0); d->currentBuildConfiguration = target()->activeBuildConfiguration(); if (d->currentBuildConfiguration) { connect(d->currentBuildConfiguration, SIGNAL(buildDirectoryChanged()), this, SIGNAL(packageFilePathChanged())); } emit packageFilePathChanged(); } QString AbstractPackagingStep::cachedPackageFilePath() const { return d->cachedPackageFilePath; } QString AbstractPackagingStep::packageFilePath() const { if (packageDirectory().isEmpty()) return QString(); return packageDirectory() + QLatin1Char('/') + packageFileName(); } QString AbstractPackagingStep::cachedPackageDirectory() const { return d->cachedPackageDirectory; } QString AbstractPackagingStep::packageDirectory() const { return d->currentBuildConfiguration ? d->currentBuildConfiguration->buildDirectory().toString() : QString(); } bool AbstractPackagingStep::isPackagingNeeded() const { QFileInfo packageInfo(packageFilePath()); if (!packageInfo.exists() || d->deploymentDataModified) return true; const DeploymentData &dd = target()->deploymentData(); for (int i = 0; i < dd.fileCount(); ++i) { if (Utils::FileUtils::isFileNewerThan(dd.fileAt(i).localFilePath(), packageInfo.lastModified())) { return true; } } return false; } bool AbstractPackagingStep::init() { d->cachedPackageDirectory = packageDirectory(); d->cachedPackageFilePath = packageFilePath(); return true; } void AbstractPackagingStep::setPackagingStarted() { } // called in ::run thread void AbstractPackagingStep::setPackagingFinished(bool success) { if (success) emit unmodifyDeploymentData(); } // called in gui thread void AbstractPackagingStep::setDeploymentDataUnmodified() { d->deploymentDataModified = false; } void AbstractPackagingStep::setDeploymentDataModified() { d->deploymentDataModified = true; } void AbstractPackagingStep::raiseError(const QString &errorMessage) { emit addOutput(errorMessage, BuildStep::ErrorOutput); emit addTask(Task(Task::Error, errorMessage, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT)); } void AbstractPackagingStep::raiseWarning(const QString &warningMessage) { emit addOutput(warningMessage, ErrorMessageOutput); emit addTask(Task(Task::Warning, warningMessage, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT)); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationwidget.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationwi0000644000015301777760000000142412321547255034130 0ustar pbusernogroup00000000000000 RemoteLinux::Internal::RemoteLinuxDeployConfigurationWidget 0 0 617 361 Form Files to deploy: ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000002124612321547255034047 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "genericlinuxdeviceconfigurationwidget.h" #include "ui_genericlinuxdeviceconfigurationwidget.h" #include #include #include #include using namespace ProjectExplorer; using namespace RemoteLinux; using namespace QSsh; using namespace Utils; GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( const IDevice::Ptr &deviceConfig, QWidget *parent) : IDeviceWidget(deviceConfig, parent), m_ui(new Ui::GenericLinuxDeviceConfigurationWidget) { m_ui->setupUi(this); connect(m_ui->hostLineEdit, SIGNAL(editingFinished()), this, SLOT(hostNameEditingFinished())); connect(m_ui->userLineEdit, SIGNAL(editingFinished()), this, SLOT(userNameEditingFinished())); connect(m_ui->pwdLineEdit, SIGNAL(editingFinished()), this, SLOT(passwordEditingFinished())); connect(m_ui->passwordButton, SIGNAL(toggled(bool)), this, SLOT(authenticationTypeChanged())); connect(m_ui->keyFileLineEdit, SIGNAL(editingFinished()), this, SLOT(keyFileEditingFinished())); connect(m_ui->keyFileLineEdit, SIGNAL(browsingFinished()), this, SLOT(keyFileEditingFinished())); connect(m_ui->keyButton, SIGNAL(toggled(bool)), this, SLOT(authenticationTypeChanged())); connect(m_ui->timeoutSpinBox, SIGNAL(editingFinished()), this, SLOT(timeoutEditingFinished())); connect(m_ui->timeoutSpinBox, SIGNAL(valueChanged(int)), this, SLOT(timeoutEditingFinished())); connect(m_ui->sshPortSpinBox, SIGNAL(editingFinished()), this, SLOT(sshPortEditingFinished())); connect(m_ui->sshPortSpinBox, SIGNAL(valueChanged(int)), this, SLOT(sshPortEditingFinished())); connect(m_ui->showPasswordCheckBox, SIGNAL(toggled(bool)), this, SLOT(showPassword(bool))); connect(m_ui->portsLineEdit, SIGNAL(editingFinished()), this, SLOT(handleFreePortsChanged())); connect(m_ui->createKeyButton, SIGNAL(clicked()), SLOT(createNewKey())); connect(m_ui->gdbServerLineEdit, SIGNAL(editingFinished()), SLOT(gdbServerEditingFinished())); initGui(); } GenericLinuxDeviceConfigurationWidget::~GenericLinuxDeviceConfigurationWidget() { delete m_ui; } void GenericLinuxDeviceConfigurationWidget::authenticationTypeChanged() { SshConnectionParameters sshParams = device()->sshParameters(); const bool usePassword = m_ui->passwordButton->isChecked(); sshParams.authenticationType = usePassword ? SshConnectionParameters::AuthenticationTypeTryAllPasswordBasedMethods : SshConnectionParameters::AuthenticationTypePublicKey; device()->setSshParameters(sshParams); m_ui->pwdLineEdit->setEnabled(usePassword); m_ui->passwordLabel->setEnabled(usePassword); m_ui->keyFileLineEdit->setEnabled(!usePassword); m_ui->keyLabel->setEnabled(!usePassword); } void GenericLinuxDeviceConfigurationWidget::hostNameEditingFinished() { SshConnectionParameters sshParams = device()->sshParameters(); sshParams.host = m_ui->hostLineEdit->text().trimmed(); device()->setSshParameters(sshParams); } void GenericLinuxDeviceConfigurationWidget::sshPortEditingFinished() { SshConnectionParameters sshParams = device()->sshParameters(); sshParams.port = m_ui->sshPortSpinBox->value(); device()->setSshParameters(sshParams); } void GenericLinuxDeviceConfigurationWidget::timeoutEditingFinished() { SshConnectionParameters sshParams = device()->sshParameters(); sshParams.timeout = m_ui->timeoutSpinBox->value(); device()->setSshParameters(sshParams); } void GenericLinuxDeviceConfigurationWidget::userNameEditingFinished() { SshConnectionParameters sshParams = device()->sshParameters(); sshParams.userName = m_ui->userLineEdit->text(); device()->setSshParameters(sshParams); } void GenericLinuxDeviceConfigurationWidget::passwordEditingFinished() { SshConnectionParameters sshParams = device()->sshParameters(); sshParams.password = m_ui->pwdLineEdit->text(); device()->setSshParameters(sshParams); } void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished() { SshConnectionParameters sshParams = device()->sshParameters(); sshParams.privateKeyFile = m_ui->keyFileLineEdit->path(); device()->setSshParameters(sshParams); } void GenericLinuxDeviceConfigurationWidget::gdbServerEditingFinished() { device()->setDebugServerPath(m_ui->gdbServerLineEdit->text()); } void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged() { device()->setFreePorts(PortList::fromString(m_ui->portsLineEdit->text())); updatePortsWarningLabel(); } void GenericLinuxDeviceConfigurationWidget::showPassword(bool showClearText) { m_ui->pwdLineEdit->setEchoMode(showClearText ? QLineEdit::Normal : QLineEdit::Password); } void GenericLinuxDeviceConfigurationWidget::setPrivateKey(const QString &path) { m_ui->keyFileLineEdit->setPath(path); keyFileEditingFinished(); } void GenericLinuxDeviceConfigurationWidget::createNewKey() { SshKeyCreationDialog dialog(this); if (dialog.exec() == QDialog::Accepted) setPrivateKey(dialog.privateKeyFilePath()); } void GenericLinuxDeviceConfigurationWidget::updateDeviceFromUi() { hostNameEditingFinished(); sshPortEditingFinished(); timeoutEditingFinished(); userNameEditingFinished(); passwordEditingFinished(); keyFileEditingFinished(); handleFreePortsChanged(); gdbServerEditingFinished(); } void GenericLinuxDeviceConfigurationWidget::updatePortsWarningLabel() { m_ui->portsWarningLabel->setVisible(!device()->freePorts().hasMore()); } void GenericLinuxDeviceConfigurationWidget::initGui() { if (device()->machineType() == IDevice::Hardware) m_ui->machineTypeValueLabel->setText(tr("Physical Device")); else m_ui->machineTypeValueLabel->setText(tr("Emulator")); m_ui->portsWarningLabel->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png"))); m_ui->portsWarningLabel->setToolTip(QLatin1String("") + tr("You will need at least one port.") + QLatin1String("")); m_ui->keyFileLineEdit->setExpectedKind(PathChooser::File); m_ui->keyFileLineEdit->lineEdit()->setMinimumWidth(0); QRegExpValidator * const portsValidator = new QRegExpValidator(QRegExp(PortList::regularExpression()), this); m_ui->portsLineEdit->setValidator(portsValidator); const SshConnectionParameters &sshParams = device()->sshParameters(); if (sshParams.authenticationType != SshConnectionParameters::AuthenticationTypePublicKey) m_ui->passwordButton->setChecked(true); else m_ui->keyButton->setChecked(true); m_ui->timeoutSpinBox->setValue(sshParams.timeout); m_ui->hostLineEdit->setEnabled(!device()->isAutoDetected()); m_ui->sshPortSpinBox->setEnabled(!device()->isAutoDetected()); m_ui->hostLineEdit->setText(sshParams.host); m_ui->sshPortSpinBox->setValue(sshParams.port); m_ui->portsLineEdit->setText(device()->freePorts().toString()); m_ui->timeoutSpinBox->setValue(sshParams.timeout); m_ui->userLineEdit->setText(sshParams.userName); m_ui->pwdLineEdit->setText(sshParams.password); m_ui->keyFileLineEdit->setPath(sshParams.privateKeyFile); m_ui->showPasswordCheckBox->setChecked(false); m_ui->gdbServerLineEdit->setText(device()->debugServerPath()); updatePortsWarningLabel(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/RemoteLinux.pluginspec.in0000644000015301777760000000205612321547255032242 0ustar pbusernogroup00000000000000 Digia Plc (C) 2014 Digia Plc Commercial Usage Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Digia. GNU Lesser General Public License Usage Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. Support for deployment to and execution on a remote Linux host. Device Support http://www.qt-project.org $$dependencyList ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfiguration.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfiguration.c0000644000015301777760000000426712321547255034021 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfigurationwidget.h" using namespace ProjectExplorer; namespace RemoteLinux { using namespace Internal; RemoteLinuxDeployConfiguration::RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id, const QString &defaultDisplayName) : DeployConfiguration(target, id) { setDefaultDisplayName(defaultDisplayName); } RemoteLinuxDeployConfiguration::RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, RemoteLinuxDeployConfiguration *source) : DeployConfiguration(target, source) { } NamedWidget *RemoteLinuxDeployConfiguration::createConfigWidget() { return new RemoteLinuxDeployConfigurationWidget(this); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentreader.h0000644000015301777760000000465512321547255033472 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXENVIRONMENTREADER_H #define REMOTELINUXENVIRONMENTREADER_H #include #include namespace ProjectExplorer { class DeviceProcess; class Kit; class RunConfiguration; } namespace RemoteLinux { namespace Internal { class RemoteLinuxEnvironmentReader : public QObject { Q_OBJECT public: RemoteLinuxEnvironmentReader(ProjectExplorer::RunConfiguration *config, QObject *parent = 0); void start(); void stop(); Utils::Environment remoteEnvironment() const { return m_env; } signals: void finished(); void error(const QString &error); private slots: void handleError(); void handleCurrentDeviceConfigChanged(); void remoteProcessFinished(); private: void setFinished(); void destroyProcess(); bool m_stop; Utils::Environment m_env; ProjectExplorer::Kit *m_kit; ProjectExplorer::DeviceProcess *m_deviceProcess; }; } // namespace Internal } // namespace RemoteLinux #endif // REMOTELINUXENVIRONMENTREADER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxdeploystep.h0000644000015301777760000000600612321547255033647 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ABSTRACTREMOTELINUXDEPLOYSTEP_H #define ABSTRACTREMOTELINUXDEPLOYSTEP_H #include "remotelinux_export.h" #include #include namespace RemoteLinux { class AbstractRemoteLinuxDeployService; class RemoteLinuxDeployConfiguration; namespace Internal { class AbstractRemoteLinuxDeployStepPrivate; } class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployStep : public ProjectExplorer::BuildStep { Q_OBJECT public: ~AbstractRemoteLinuxDeployStep(); bool fromMap(const QVariantMap &map); QVariantMap toMap() const; bool init(); void run(QFutureInterface &fi); bool runInGuiThread() const { return true; } void cancel(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); RemoteLinuxDeployConfiguration *deployConfiguration() const; virtual AbstractRemoteLinuxDeployService *deployService() const = 0; protected: AbstractRemoteLinuxDeployStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id); AbstractRemoteLinuxDeployStep(ProjectExplorer::BuildStepList *bsl, AbstractRemoteLinuxDeployStep *other); virtual bool initInternal(QString *error = 0) = 0; private slots: void handleProgressMessage(const QString &message); void handleErrorMessage(const QString &message); void handleWarningMessage(const QString &message); void handleFinished(); void handleStdOutData(const QString &data); void handleStdErrData(const QString &data); private: Internal::AbstractRemoteLinuxDeployStepPrivate *d; }; } // namespace RemoteLinux #endif // ABSTRACTREMOTELINUXDEPLOYSTEP_H ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractuploadandinstallpackageservice.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractuploadandinstallpackages0000644000015301777760000000530512321547255033773 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ABSTRACTUPLOADANDINSTALLPACKAGESERVICE_H #define ABSTRACTUPLOADANDINSTALLPACKAGESERVICE_H #include "abstractremotelinuxdeployservice.h" #include "remotelinux_export.h" namespace RemoteLinux { class AbstractRemoteLinuxPackageInstaller; namespace Internal { class AbstractUploadAndInstallPackageServicePrivate; } class REMOTELINUX_EXPORT AbstractUploadAndInstallPackageService : public AbstractRemoteLinuxDeployService { Q_OBJECT public: void setPackageFilePath(const QString &filePath); protected: explicit AbstractUploadAndInstallPackageService(QObject *parent); ~AbstractUploadAndInstallPackageService(); QString packageFilePath() const; private slots: void handleUploadFinished(const QString &errorMsg); void handleInstallationFinished(const QString &errorMsg); private: virtual AbstractRemoteLinuxPackageInstaller *packageInstaller() const = 0; virtual QString uploadDir() const; // Defaults to remote user's home directory. bool isDeploymentNecessary() const; void doDeviceSetup(); void stopDeviceSetup(); void doDeploy(); void stopDeployment(); void setFinished(); Internal::AbstractUploadAndInstallPackageServicePrivate * const d; }; } // namespace RemoteLinux #endif // ABSTRACTUPLOADANDINSTALLPACKAGESERVICE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/linuxdevicetester.cpp0000644000015301777760000001427112321547255031543 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "linuxdevicetester.h" #include #include #include #include using namespace ProjectExplorer; using namespace QSsh; namespace RemoteLinux { namespace Internal { namespace { enum State { Inactive, Connecting, RunningUname, TestingPorts }; } // anonymous namespace class GenericLinuxDeviceTesterPrivate { public: GenericLinuxDeviceTesterPrivate() : connection(0), state(Inactive) {} IDevice::ConstPtr deviceConfiguration; SshConnection *connection; SshRemoteProcess::Ptr process; DeviceUsedPortsGatherer portsGatherer; State state; }; } // namespace Internal using namespace Internal; GenericLinuxDeviceTester::GenericLinuxDeviceTester(QObject *parent) : DeviceTester(parent), d(new GenericLinuxDeviceTesterPrivate) { } GenericLinuxDeviceTester::~GenericLinuxDeviceTester() { delete d; } void GenericLinuxDeviceTester::testDevice(const IDevice::ConstPtr &deviceConfiguration) { QTC_ASSERT(d->state == Inactive, return); d->deviceConfiguration = deviceConfiguration; d->connection = new SshConnection(deviceConfiguration->sshParameters(), this); connect(d->connection, SIGNAL(connected()), SLOT(handleConnected())); connect(d->connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionFailure())); emit progressMessage(tr("Connecting to host...")); d->state = Connecting; d->connection->connectToHost(); } void GenericLinuxDeviceTester::stopTest() { QTC_ASSERT(d->state != Inactive, return); switch (d->state) { case Connecting: d->connection->disconnectFromHost(); break; case TestingPorts: d->portsGatherer.stop(); break; case RunningUname: d->process->close(); break; case Inactive: break; } setFinished(TestFailure); } DeviceUsedPortsGatherer *GenericLinuxDeviceTester::usedPortsGatherer() const { return &d->portsGatherer; } void GenericLinuxDeviceTester::handleConnected() { QTC_ASSERT(d->state == Connecting, return); d->process = d->connection->createRemoteProcess("uname -rsm"); connect(d->process.data(), SIGNAL(closed(int)), SLOT(handleProcessFinished(int))); emit progressMessage(tr("Checking kernel version...")); d->state = RunningUname; d->process->start(); } void GenericLinuxDeviceTester::handleConnectionFailure() { QTC_ASSERT(d->state != Inactive, return); emit errorMessage(tr("SSH connection failure: %1").arg(d->connection->errorString()) + QLatin1Char('\n')); setFinished(TestFailure); } void GenericLinuxDeviceTester::handleProcessFinished(int exitStatus) { QTC_ASSERT(d->state == RunningUname, return); if (exitStatus != SshRemoteProcess::NormalExit || d->process->exitCode() != 0) { const QByteArray stderrOutput = d->process->readAllStandardError(); if (!stderrOutput.isEmpty()) emit errorMessage(tr("uname failed: %1").arg(QString::fromUtf8(stderrOutput)) + QLatin1Char('\n')); else emit errorMessage(tr("uname failed.") + QLatin1Char('\n')); } else { emit progressMessage(QString::fromUtf8(d->process->readAllStandardOutput())); } connect(&d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGatheringError(QString))); connect(&d->portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady())); emit progressMessage(tr("Checking if specified ports are available...")); d->state = TestingPorts; d->portsGatherer.start(d->deviceConfiguration); } void GenericLinuxDeviceTester::handlePortsGatheringError(const QString &message) { QTC_ASSERT(d->state == TestingPorts, return); emit errorMessage(tr("Error gathering ports: %1").arg(message) + QLatin1Char('\n')); setFinished(TestFailure); } void GenericLinuxDeviceTester::handlePortListReady() { QTC_ASSERT(d->state == TestingPorts, return); if (d->portsGatherer.usedPorts().isEmpty()) { emit progressMessage(tr("All specified ports are available.") + QLatin1Char('\n')); } else { QString portList; foreach (const int port, d->portsGatherer.usedPorts()) portList += QString::number(port) + QLatin1String(", "); portList.remove(portList.count() - 2, 2); emit errorMessage(tr("The following specified ports are currently in use: %1") .arg(portList) + QLatin1Char('\n')); } setFinished(TestSuccess); } void GenericLinuxDeviceTester::setFinished(TestResult result) { d->state = Inactive; disconnect(&d->portsGatherer, 0, this, 0); if (d->connection) { disconnect(d->connection, 0, this, 0); d->connection->deleteLater(); d->connection = 0; } emit finished(result); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinux.qbs0000644000015301777760000001123212321547255030345 0ustar pbusernogroup00000000000000import qbs.base 1.0 import QtcPlugin QtcPlugin { name: "RemoteLinux" Depends { name: "Qt.widgets" } Depends { name: "AnalyzerBase" } Depends { name: "Core" } Depends { name: "Debugger" } Depends { name: "ProjectExplorer" } Depends { name: "QmlDebug" } Depends { name: "QtSupport" } Depends { name: "QtcSsh" } files: [ "abstractpackagingstep.cpp", "abstractpackagingstep.h", "abstractremotelinuxdeployservice.cpp", "abstractremotelinuxdeployservice.h", "abstractremotelinuxdeploystep.cpp", "abstractremotelinuxdeploystep.h", "abstractremotelinuxrunsupport.cpp", "abstractremotelinuxrunsupport.h", "abstractuploadandinstallpackageservice.cpp", "abstractuploadandinstallpackageservice.h", "embeddedlinuxqtversion.cpp", "embeddedlinuxqtversion.h", "embeddedlinuxqtversionfactory.cpp", "embeddedlinuxqtversionfactory.h", "genericdirectuploadservice.cpp", "genericdirectuploadservice.h", "genericdirectuploadstep.cpp", "genericdirectuploadstep.h", "genericlinuxdeviceconfigurationfactory.cpp", "genericlinuxdeviceconfigurationfactory.h", "genericlinuxdeviceconfigurationwidget.cpp", "genericlinuxdeviceconfigurationwidget.h", "genericlinuxdeviceconfigurationwidget.ui", "genericlinuxdeviceconfigurationwizard.cpp", "genericlinuxdeviceconfigurationwizard.h", "genericlinuxdeviceconfigurationwizardpages.cpp", "genericlinuxdeviceconfigurationwizardpages.h", "genericlinuxdeviceconfigurationwizardsetuppage.ui", "genericremotelinuxdeploystepfactory.cpp", "genericremotelinuxdeploystepfactory.h", "linuxdevice.cpp", "linuxdevice.h", "linuxdeviceprocess.cpp", "linuxdeviceprocess.h", "linuxdevicetester.cpp", "linuxdevicetester.h", "packageuploader.cpp", "packageuploader.h", "publickeydeploymentdialog.cpp", "publickeydeploymentdialog.h", "remotelinux.qrc", "remotelinux_constants.h", "remotelinux_export.h", "remotelinuxanalyzesupport.cpp", "remotelinuxanalyzesupport.h", "remotelinuxcheckforfreediskspaceservice.cpp", "remotelinuxcheckforfreediskspaceservice.h", "remotelinuxcheckforfreediskspacestep.cpp", "remotelinuxcheckforfreediskspacestep.h", "remotelinuxcheckforfreediskspacestepwidget.ui", "remotelinuxcustomcommanddeploymentstep.cpp", "remotelinuxcustomcommanddeploymentstep.h", "remotelinuxcustomcommanddeployservice.cpp", "remotelinuxcustomcommanddeployservice.h", "remotelinuxdebugsupport.cpp", "remotelinuxdebugsupport.h", "remotelinuxdeployconfiguration.cpp", "remotelinuxdeployconfiguration.h", "remotelinuxdeployconfigurationfactory.cpp", "remotelinuxdeployconfigurationfactory.h", "remotelinuxdeployconfigurationwidget.cpp", "remotelinuxdeployconfigurationwidget.h", "remotelinuxdeployconfigurationwidget.ui", "remotelinuxdeploymentdatamodel.cpp", "remotelinuxdeploymentdatamodel.h", "remotelinuxenvironmentaspect.cpp", "remotelinuxenvironmentaspect.h", "remotelinuxenvironmentaspectwidget.cpp", "remotelinuxenvironmentaspectwidget.h", "remotelinuxenvironmentreader.cpp", "remotelinuxenvironmentreader.h", "remotelinuxpackageinstaller.cpp", "remotelinuxpackageinstaller.h", "remotelinuxplugin.cpp", "remotelinuxplugin.h", "remotelinuxrunconfiguration.cpp", "remotelinuxrunconfiguration.h", "remotelinuxrunconfigurationfactory.cpp", "remotelinuxrunconfigurationfactory.h", "remotelinuxrunconfigurationwidget.cpp", "remotelinuxrunconfigurationwidget.h", "remotelinuxruncontrol.cpp", "remotelinuxruncontrol.h", "remotelinuxruncontrolfactory.cpp", "remotelinuxruncontrolfactory.h", "remotelinuxsignaloperation.cpp", "remotelinuxsignaloperation.h", "remotelinuxutils.cpp", "remotelinuxutils.h", "sshkeydeployer.cpp", "sshkeydeployer.h", "tarpackagecreationstep.cpp", "tarpackagecreationstep.h", "typespecificdeviceconfigurationlistmodel.cpp", "typespecificdeviceconfigurationlistmodel.h", "uploadandinstalltarpackagestep.cpp", "uploadandinstalltarpackagestep.h", "images/embeddedtarget.png", ] Export { Depends { name: "AnalyzerBase" } Depends { name: "Core" } Depends { name: "QtcSsh" } } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdebugsupport.cpp0000644000015301777760000002262712321547255033020 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxdebugsupport.h" #include "remotelinuxrunconfiguration.h" #include #include #include #include #include #include #include #include #include #include #include using namespace QSsh; using namespace Debugger; using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class LinuxDeviceDebugSupportPrivate { public: LinuxDeviceDebugSupportPrivate(const AbstractRemoteLinuxRunConfiguration *runConfig, DebuggerEngine *engine) : engine(engine), qmlDebugging(runConfig->extraAspect()->useQmlDebugger()), cppDebugging(runConfig->extraAspect()->useCppDebugger()), gdbServerPort(-1), qmlPort(-1) { } const QPointer engine; bool qmlDebugging; bool cppDebugging; QByteArray gdbserverOutput; int gdbServerPort; int qmlPort; }; } // namespace Internal using namespace Internal; DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig) { DebuggerStartParameters params; Target *target = runConfig->target(); Kit *k = target->kit(); const IDevice::ConstPtr device = DeviceKitInformation::device(k); QTC_ASSERT(device, return params); params.sysRoot = SysRootKitInformation::sysRoot(k).toString(); params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString(); if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) params.toolChainAbi = tc->targetAbi(); Debugger::DebuggerRunConfigurationAspect *aspect = runConfig->extraAspect(); if (aspect->useQmlDebugger()) { params.languages |= QmlLanguage; params.qmlServerAddress = device->sshParameters().host; params.qmlServerPort = 0; // port is selected later on } if (aspect->useCppDebugger()) { params.languages |= CppLanguage; params.processArgs = runConfig->arguments().join(QLatin1String(" ")); params.startMode = AttachToRemoteServer; params.executable = runConfig->localExecutableFilePath(); params.remoteChannel = device->sshParameters().host + QLatin1String(":-1"); } else { params.startMode = AttachToRemoteServer; } params.remoteSetupNeeded = true; params.displayName = runConfig->displayName(); if (const Project *project = target->project()) { params.projectSourceDirectory = project->projectDirectory(); if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration()) params.projectBuildDirectory = buildConfig->buildDirectory().toString(); params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles); } return params; } LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(AbstractRemoteLinuxRunConfiguration *runConfig, DebuggerEngine *engine) : AbstractRemoteLinuxRunSupport(runConfig, engine), d(new LinuxDeviceDebugSupportPrivate(static_cast(runConfig), engine)) { connect(d->engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleRemoteSetupRequested())); } LinuxDeviceDebugSupport::~LinuxDeviceDebugSupport() { delete d; } void LinuxDeviceDebugSupport::showMessage(const QString &msg, int channel) { if (state() != Inactive && d->engine) d->engine->showMessage(msg, channel); } void LinuxDeviceDebugSupport::handleRemoteSetupRequested() { QTC_ASSERT(state() == Inactive, return); showMessage(tr("Checking available ports...") + QLatin1Char('\n'), LogStatus); AbstractRemoteLinuxRunSupport::handleRemoteSetupRequested(); } void LinuxDeviceDebugSupport::startExecution() { QTC_ASSERT(state() == GatheringPorts, return); if (d->cppDebugging && !setPort(d->gdbServerPort)) return; if (d->qmlDebugging && !setPort(d->qmlPort)) return; setState(StartingRunner); d->gdbserverOutput.clear(); DeviceApplicationRunner *runner = appRunner(); connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteErrorOutput(QByteArray))); connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); if (d->qmlDebugging && !d->cppDebugging) connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); QStringList args = arguments(); QString command; if (d->qmlDebugging) args.prepend(QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(d->qmlPort)); if (d->qmlDebugging && !d->cppDebugging) { command = remoteFilePath(); } else { command = device()->debugServerPath(); if (command.isEmpty()) command = QLatin1String("gdbserver"); args.prepend(remoteFilePath()); args.prepend(QString::fromLatin1(":%1").arg(d->gdbServerPort)); } connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool))); connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString))); runner->setEnvironment(environment()); runner->setWorkingDirectory(workingDirectory()); runner->start(device(), command, args); } void LinuxDeviceDebugSupport::handleAppRunnerError(const QString &error) { if (state() == Running) { showMessage(error, AppError); if (d->engine) d->engine->notifyInferiorIll(); } else if (state() != Inactive) { handleAdapterSetupFailed(error); } } void LinuxDeviceDebugSupport::handleAppRunnerFinished(bool success) { if (!d->engine || state() == Inactive) return; if (state() == Running) { // The QML engine does not realize on its own that the application has finished. if (d->qmlDebugging && !d->cppDebugging) d->engine->quitDebugger(); else if (!success) d->engine->notifyInferiorIll(); } else if (state() == StartingRunner){ d->engine->notifyEngineRemoteSetupFailed(tr("Debugging failed.")); } reset(); } void LinuxDeviceDebugSupport::handleDebuggingFinished() { setFinished(); reset(); } void LinuxDeviceDebugSupport::handleRemoteOutput(const QByteArray &output) { QTC_ASSERT(state() == Inactive || state() == Running, return); showMessage(QString::fromUtf8(output), AppOutput); } void LinuxDeviceDebugSupport::handleRemoteErrorOutput(const QByteArray &output) { QTC_ASSERT(state() != GatheringPorts, return); if (!d->engine) return; showMessage(QString::fromUtf8(output), AppError); if (state() == StartingRunner && d->cppDebugging) { d->gdbserverOutput += output; if (d->gdbserverOutput.contains("Listening on port")) { handleAdapterSetupDone(); d->gdbserverOutput.clear(); } } } void LinuxDeviceDebugSupport::handleProgressReport(const QString &progressOutput) { showMessage(progressOutput + QLatin1Char('\n'), LogStatus); } void LinuxDeviceDebugSupport::handleAdapterSetupFailed(const QString &error) { AbstractRemoteLinuxRunSupport::handleAdapterSetupFailed(error); d->engine->notifyEngineRemoteSetupFailed(tr("Initial setup failed: %1").arg(error)); } void LinuxDeviceDebugSupport::handleAdapterSetupDone() { AbstractRemoteLinuxRunSupport::handleAdapterSetupDone(); d->engine->notifyEngineRemoteSetupDone(d->gdbServerPort, d->qmlPort); } void LinuxDeviceDebugSupport::handleRemoteProcessStarted() { QTC_ASSERT(d->qmlDebugging && !d->cppDebugging, return); QTC_ASSERT(state() == StartingRunner, return); handleAdapterSetupDone(); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxrunconfiguration.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxrunconfigurat0000644000015301777760000000411212321547273034113 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Canonical Ltd. ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "abstractremotelinuxrunconfiguration.h" namespace RemoteLinux { AbstractRemoteLinuxRunConfiguration::AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id) : RunConfiguration(parent, id) { } AbstractRemoteLinuxRunConfiguration::~AbstractRemoteLinuxRunConfiguration() { } AbstractRemoteLinuxRunConfiguration::AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, AbstractRemoteLinuxRunConfiguration *source) : RunConfiguration(parent, source) { } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericdirectuploadservice.h0000644000015301777760000000601212321547255033031 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef GERNERICDIRECTDEVICEUPLOADSERVICE_H #define GERNERICDIRECTDEVICEUPLOADSERVICE_H #include "abstractremotelinuxdeployservice.h" #include "remotelinux_export.h" #include #include QT_FORWARD_DECLARE_CLASS(QString) namespace ProjectExplorer { class DeployableFile; } namespace RemoteLinux { namespace Internal { class GenericDirectUploadServicePrivate; } class REMOTELINUX_EXPORT GenericDirectUploadService : public AbstractRemoteLinuxDeployService { Q_OBJECT public: GenericDirectUploadService(QObject *parent = 0); ~GenericDirectUploadService(); void setDeployableFiles(const QList &deployableFiles); void setIncrementalDeployment(bool incremental); void setIgnoreMissingFiles(bool ignoreMissingFiles); protected: bool isDeploymentNecessary() const; void doDeviceSetup(); void stopDeviceSetup(); void doDeploy(); void stopDeployment(); private slots: void handleSftpInitialized(); void handleSftpInitializationFailed(const QString &errorMessage); void handleUploadFinished(QSsh::SftpJobId jobId, const QString &errorMsg); void handleMkdirFinished(int exitStatus); void handleLnFinished(int exitStatus); void handleChmodFinished(int exitStatus); void handleStdOutData(); void handleStdErrData(); private: void checkDeploymentNeeded(const ProjectExplorer::DeployableFile &file) const; void setFinished(); void uploadNextFile(); Internal::GenericDirectUploadServicePrivate * const d; }; } //namespace RemoteLinux #endif // GERNERICDIRECTDEVICEUPLOADSERVICE_H ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationfactory.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationfa0000644000015301777760000000517512321547255034106 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXDEPLOYCONFIGURATIONFACTORY_H #define REMOTELINUXDEPLOYCONFIGURATIONFACTORY_H #include namespace RemoteLinux { namespace Internal { class RemoteLinuxDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory { Q_OBJECT public: explicit RemoteLinuxDeployConfigurationFactory(QObject *parent = 0); QList availableCreationIds(ProjectExplorer::Target *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id); bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *product); static Core::Id genericDeployConfigurationId(); }; } // namespace Internal } // namespace RemoteLinux #endif // REMOTELINUXDEPLOYCONFIGURATIONFACTORY_H ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwizard.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000000712712321547255034051 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "genericlinuxdeviceconfigurationwizard.h" #include "genericlinuxdeviceconfigurationwizardpages.h" #include "linuxdevice.h" #include "remotelinux_constants.h" #include using namespace ProjectExplorer; using namespace QSsh; namespace RemoteLinux { namespace Internal { namespace { enum PageId { SetupPageId, FinalPageId }; } // anonymous namespace class GenericLinuxDeviceConfigurationWizardPrivate { public: GenericLinuxDeviceConfigurationWizardPrivate(QWidget *parent) : setupPage(parent), finalPage(parent) { } GenericLinuxDeviceConfigurationWizardSetupPage setupPage; GenericLinuxDeviceConfigurationWizardFinalPage finalPage; }; } // namespace Internal GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard(QWidget *parent) : Utils::Wizard(parent), d(new Internal::GenericLinuxDeviceConfigurationWizardPrivate(this)) { setWindowTitle(tr("New Generic Linux Device Configuration Setup")); setPage(Internal::SetupPageId, &d->setupPage); setPage(Internal::FinalPageId, &d->finalPage); d->finalPage.setCommitPage(true); } GenericLinuxDeviceConfigurationWizard::~GenericLinuxDeviceConfigurationWizard() { delete d; } IDevice::Ptr GenericLinuxDeviceConfigurationWizard::device() { QSsh::SshConnectionParameters sshParams; sshParams.options &= ~SshConnectionOptions(SshEnableStrictConformanceChecks); // For older SSH servers. sshParams.host = d->setupPage.hostName(); sshParams.userName = d->setupPage.userName(); sshParams.port = 22; sshParams.timeout = 10; sshParams.authenticationType = d->setupPage.authenticationType(); if (sshParams.authenticationType != SshConnectionParameters::AuthenticationTypePublicKey) sshParams.password = d->setupPage.password(); else sshParams.privateKeyFile = d->setupPage.privateKeyFilePath(); IDevice::Ptr device = LinuxDevice::create(d->setupPage.configurationName(), Core::Id(Constants::GenericLinuxOsType), IDevice::Hardware); device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100"))); device->setSshParameters(sshParams); return device; } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/typespecificdeviceconfigurationlistmodel.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/typespecificdeviceconfigurationl0000644000015301777760000000474512321547255034034 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H #define TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H #include #include namespace ProjectExplorer { class Target; } namespace RemoteLinux { namespace Internal { class TypeSpecificDeviceConfigurationListModel : public QAbstractListModel { Q_OBJECT public: explicit TypeSpecificDeviceConfigurationListModel(ProjectExplorer::Target *target); int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; private: int indexForId(Core::Id id) const; ProjectExplorer::IDevice::ConstPtr deviceAt(int idx) const; ProjectExplorer::IDevice::ConstPtr defaultDeviceConfig() const; ProjectExplorer::IDevice::ConstPtr find(Core::Id id) const; ProjectExplorer::Target *target() const; bool deviceMatches(ProjectExplorer::IDevice::ConstPtr dev) const; }; } // namespace Internal } // namespace RemoteLinux #endif // TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractpackagingstep.h0000644000015301777760000000545012321547255032005 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ABSTRACTPACKAGINGSTEP_H #define ABSTRACTPACKAGINGSTEP_H #include "remotelinux_export.h" #include namespace RemoteLinux { class RemoteLinuxDeployConfiguration; namespace Internal { class AbstractPackagingStepPrivate; } class REMOTELINUX_EXPORT AbstractPackagingStep : public ProjectExplorer::BuildStep { Q_OBJECT public: AbstractPackagingStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id); AbstractPackagingStep(ProjectExplorer::BuildStepList *bsl, AbstractPackagingStep *other); ~AbstractPackagingStep(); QString packageFilePath() const; QString cachedPackageFilePath() const; bool init(); signals: void packageFilePathChanged(); void unmodifyDeploymentData(); protected: void setPackagingStarted(); void setPackagingFinished(bool success); void raiseError(const QString &errorMessage); void raiseWarning(const QString &warningMessage); QString cachedPackageDirectory() const; QString packageDirectory() const; virtual bool isPackagingNeeded() const; private slots: void handleBuildConfigurationChanged(); void setDeploymentDataUnmodified(); void setDeploymentDataModified(); private: virtual QString packageFileName() const = 0; void ctor(); Internal::AbstractPackagingStepPrivate *d; }; } // namespace RemoteLinux #endif // ABSTRACTPACKAGINGSTEP_H ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentaspectwidget.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentaspectwidg0000644000015301777760000000447712321547255034136 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXENVIRONMENTASPECTWIDGET_H #define REMOTELINUXENVIRONMENTASPECTWIDGET_H #include "remotelinuxenvironmentaspect.h" #include QT_FORWARD_DECLARE_CLASS(QPushButton) namespace RemoteLinux { namespace Internal { class RemoteLinuxEnvironmentReader; } class RemoteLinuxEnvironmentAspectWidget : public ProjectExplorer::EnvironmentAspectWidget { Q_OBJECT public: RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect); RemoteLinuxEnvironmentAspect *aspect() const; QPushButton *fetchButton() const; private slots: void fetchEnvironment(); void fetchEnvironmentFinished(); void fetchEnvironmentError(const QString &error); void stopFetchEnvironment(); private: Internal::RemoteLinuxEnvironmentReader *deviceEnvReader; }; } // namespace RemoteLinux #endif // REMOTELINUXENVIRONMENTASPECTWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/images/0000755000015301777760000000000012321547742026532 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/images/embeddedtarget.png0000644000015301777760000000203212321547255032174 0ustar pbusernogroup00000000000000PNG  IHDR szztEXtSoftwareAdobe ImageReadyqe<IDATxڼW;kA]=,H! IZ:U@ _HޤM &i7n=ng;w:=RX'խt;|oZ {[{Wg^nu}}}Z[[[puu7770qل}8::G 9| 'O5(k0Yt lG|.x3GPC(6(sm o%#3 cr@#Dt7$`8rݧ+zjGD32Α<@{h@Y`?10rc4* $ SD H"uG]" 0!"fE`& U1y )ʄH32UP ˌJpٞ&iO@ @iHPN2DdD.M]Y@crYb&lH`g !Z"IZ̅} e g%( @ByHa,X.A+,p HZ˃Тc.$9ᜳjXԐ+.O*2D"#&!G_ AL>FUʁoEJ-|fhe p#R~7WQ\|N3씫^3Uh41#լ@z|CЊf;6 yj5you][ˉˑ/x;?ڱ_>(w &4X2>Iw V===}rNsaY$s&?~ρN0<ꃃe5@d: }柬˦///y]94D+V_ͧ:P?Ģ(O mQÓJ>KtwDdM,6+'HǮ ~}BvoZJUed}XKU RemoteLinuxCheckForFreeDiskSpaceStepWidget 0 0 420 74 Form Remote path to check for free space: Required disk space: 0 0 ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspaceservice.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspace0000644000015301777760000000503612321547255034024 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXCHECKFORFREEDISKSPACESERVICE_H #define REMOTELINUXCHECKFORFREEDISKSPACESERVICE_H #include "abstractremotelinuxdeployservice.h" namespace RemoteLinux { namespace Internal { class RemoteLinuxCheckForFreeDiskSpaceServicePrivate; } class REMOTELINUX_EXPORT RemoteLinuxCheckForFreeDiskSpaceService : public AbstractRemoteLinuxDeployService { Q_OBJECT public: RemoteLinuxCheckForFreeDiskSpaceService(QObject *parent = 0); ~RemoteLinuxCheckForFreeDiskSpaceService(); void setPathToCheck(const QString &path); void setRequiredSpaceInBytes(quint64 sizeInBytes); private slots: void handleStdErr(); void handleProcessFinished(); private: bool isDeploymentNecessary() const { return true; } void doDeviceSetup() { handleDeviceSetupDone(true); } void stopDeviceSetup() { handleDeviceSetupDone(false); } bool isDeploymentPossible(QString *whyNot) const; void doDeploy(); void stopDeployment(); void cleanup(); Internal::RemoteLinuxCheckForFreeDiskSpaceServicePrivate * const d; }; } // namespace RemoteLinux #endif // REMOTELINUXCHECKFORFREEDISKSPACESERVICE_H ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeploymentstep.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeployme0000644000015301777760000000667212321547255034126 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXCUSTOMCOMMANDDEPLOYMENTSTEP_H #define REMOTELINUXCUSTOMCOMMANDDEPLOYMENTSTEP_H #include "abstractremotelinuxdeploystep.h" #include "remotelinuxcustomcommanddeployservice.h" namespace RemoteLinux { namespace Internal { class AbstractRemoteLinuxCustomCommandDeploymentStepPrivate; class GenericRemoteLinuxCustomCommandDeploymentStepPrivate; } // namespace Internal class REMOTELINUX_EXPORT AbstractRemoteLinuxCustomCommandDeploymentStep : public AbstractRemoteLinuxDeployStep { Q_OBJECT public: ~AbstractRemoteLinuxCustomCommandDeploymentStep(); bool fromMap(const QVariantMap &map); QVariantMap toMap() const; void setCommandLine(const QString &commandLine); QString commandLine() const; protected: AbstractRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id); AbstractRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl, AbstractRemoteLinuxCustomCommandDeploymentStep *other); bool initInternal(QString *error = 0); private: void ctor(); RemoteLinuxCustomCommandDeployService *deployService() const = 0; ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); Internal::AbstractRemoteLinuxCustomCommandDeploymentStepPrivate *d; }; class REMOTELINUX_EXPORT GenericRemoteLinuxCustomCommandDeploymentStep : public AbstractRemoteLinuxCustomCommandDeploymentStep { Q_OBJECT public: GenericRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl); GenericRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl, GenericRemoteLinuxCustomCommandDeploymentStep *other); ~GenericRemoteLinuxCustomCommandDeploymentStep(); static Core::Id stepId(); static QString stepDisplayName(); private: RemoteLinuxCustomCommandDeployService *deployService() const; void ctor(); Internal::GenericRemoteLinuxCustomCommandDeploymentStepPrivate *d; }; } // namespace RemoteLinux #endif // REMOTELINUXCUSTOMCOMMANDDEPLOYMENTSTEP_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericdirectuploadservice.cpp0000644000015301777760000003210212321547255033363 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "genericdirectuploadservice.h" #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace QSsh; namespace RemoteLinux { namespace Internal { namespace { enum State { Inactive, InitializingSftp, Uploading }; } // anonymous namespace class GenericDirectUploadServicePrivate { public: GenericDirectUploadServicePrivate() : incremental(false), ignoreMissingFiles(false), stopRequested(false), state(Inactive) {} bool incremental; bool ignoreMissingFiles; bool stopRequested; State state; QList filesToUpload; SftpChannel::Ptr uploader; SshRemoteProcess::Ptr mkdirProc; SshRemoteProcess::Ptr lnProc; SshRemoteProcess::Ptr chmodProc; QList deployableFiles; }; } // namespace Internal using namespace Internal; GenericDirectUploadService::GenericDirectUploadService(QObject *parent) : AbstractRemoteLinuxDeployService(parent), d(new GenericDirectUploadServicePrivate) { } GenericDirectUploadService::~GenericDirectUploadService() { delete d; } void GenericDirectUploadService::setDeployableFiles(const QList &deployableFiles) { d->deployableFiles = deployableFiles; } void GenericDirectUploadService::setIncrementalDeployment(bool incremental) { d->incremental = incremental; } void GenericDirectUploadService::setIgnoreMissingFiles(bool ignoreMissingFiles) { d->ignoreMissingFiles = ignoreMissingFiles; } bool GenericDirectUploadService::isDeploymentNecessary() const { d->filesToUpload.clear(); for (int i = 0; i < d->deployableFiles.count(); ++i) checkDeploymentNeeded(d->deployableFiles.at(i)); return !d->filesToUpload.isEmpty(); } void GenericDirectUploadService::doDeviceSetup() { QTC_ASSERT(d->state == Inactive, return); handleDeviceSetupDone(true); } void GenericDirectUploadService::stopDeviceSetup() { QTC_ASSERT(d->state == Inactive, return); handleDeviceSetupDone(false); } void GenericDirectUploadService::doDeploy() { QTC_ASSERT(d->state == Inactive, setFinished(); return); d->uploader = connection()->createSftpChannel(); connect(d->uploader.data(), SIGNAL(initialized()), SLOT(handleSftpInitialized())); connect(d->uploader.data(), SIGNAL(initializationFailed(QString)), SLOT(handleSftpInitializationFailed(QString))); d->uploader->initialize(); d->state = InitializingSftp; } void GenericDirectUploadService::handleSftpInitialized() { QTC_ASSERT(d->state == InitializingSftp, setFinished(); return); if (d->stopRequested) { setFinished(); handleDeploymentDone(); return; } Q_ASSERT(!d->filesToUpload.isEmpty()); connect(d->uploader.data(), SIGNAL(finished(QSsh::SftpJobId,QString)), SLOT(handleUploadFinished(QSsh::SftpJobId,QString))); d->state = Uploading; uploadNextFile(); } void GenericDirectUploadService::handleSftpInitializationFailed(const QString &message) { QTC_ASSERT(d->state == InitializingSftp, setFinished(); return); emit errorMessage(tr("SFTP initialization failed: %1").arg(message)); setFinished(); handleDeploymentDone(); } void GenericDirectUploadService::handleUploadFinished(QSsh::SftpJobId jobId, const QString &errorMsg) { Q_UNUSED(jobId); QTC_ASSERT(d->state == Uploading, setFinished(); return); if (d->stopRequested) { setFinished(); handleDeploymentDone(); } const DeployableFile df = d->filesToUpload.takeFirst(); if (!errorMsg.isEmpty()) { QString errorString = tr("Upload of file '%1' failed. The server said: '%2'.") .arg(df.localFilePath().toUserOutput(), errorMsg); if (errorMsg == QLatin1String("Failure") && df.remoteDirectory().contains(QLatin1String("/bin"))) { errorString += QLatin1Char(' ') + tr("If '%1' is currently running " "on the remote host, you might need to stop it first.").arg(df.remoteFilePath()); } emit errorMessage(errorString); setFinished(); handleDeploymentDone(); } else { saveDeploymentTimeStamp(df); // This is done for Windows. if (df.isExecutable()) { const QString command = QLatin1String("chmod a+x ") + df.remoteFilePath(); d->chmodProc = connection()->createRemoteProcess(command.toUtf8()); connect(d->chmodProc.data(), SIGNAL(closed(int)), SLOT(handleChmodFinished(int))); connect(d->chmodProc.data(), SIGNAL(readyReadStandardOutput()), SLOT(handleStdOutData())); connect(d->chmodProc.data(), SIGNAL(readyReadStandardError()), SLOT(handleStdErrData())); d->chmodProc->start(); } else { uploadNextFile(); } } } void GenericDirectUploadService::handleLnFinished(int exitStatus) { QTC_ASSERT(d->state == Uploading, setFinished(); return); if (d->stopRequested) { setFinished(); handleDeploymentDone(); } const DeployableFile df = d->filesToUpload.takeFirst(); const QString nativePath = df.localFilePath().toUserOutput(); if (exitStatus != SshRemoteProcess::NormalExit || d->lnProc->exitCode() != 0) { emit errorMessage(tr("Failed to upload file '%1'.").arg(nativePath)); setFinished(); handleDeploymentDone(); return; } else { saveDeploymentTimeStamp(df); uploadNextFile(); } } void GenericDirectUploadService::handleChmodFinished(int exitStatus) { QTC_ASSERT(d->state == Uploading, setFinished(); return); if (d->stopRequested) { setFinished(); handleDeploymentDone(); return; } if (exitStatus != SshRemoteProcess::NormalExit || d->chmodProc->exitCode() != 0) { emit errorMessage(tr("Failed to set executable flag.")); setFinished(); handleDeploymentDone(); return; } uploadNextFile(); } void GenericDirectUploadService::handleMkdirFinished(int exitStatus) { QTC_ASSERT(d->state == Uploading, setFinished(); return); if (d->stopRequested) { setFinished(); handleDeploymentDone(); } const DeployableFile &df = d->filesToUpload.first(); QFileInfo fi = df.localFilePath().toFileInfo(); const QString nativePath = df.localFilePath().toUserOutput(); if (exitStatus != SshRemoteProcess::NormalExit || d->mkdirProc->exitCode() != 0) { emit errorMessage(tr("Failed to upload file '%1'.").arg(nativePath)); setFinished(); handleDeploymentDone(); } else if (fi.isDir()) { saveDeploymentTimeStamp(df); d->filesToUpload.removeFirst(); uploadNextFile(); } else { const QString remoteFilePath = df.remoteDirectory() + QLatin1Char('/') + fi.fileName(); if (fi.isSymLink()) { const QString target = fi.dir().relativeFilePath(fi.symLinkTarget()); // see QTBUG-5817. const QString command = QLatin1String("ln -sf ") + target + QLatin1Char(' ') + remoteFilePath; // See comment in SftpChannel::createLink as to why we can't use it. d->lnProc = connection()->createRemoteProcess(command.toUtf8()); connect(d->lnProc.data(), SIGNAL(closed(int)), SLOT(handleLnFinished(int))); connect(d->lnProc.data(), SIGNAL(readyReadStandardOutput()), SLOT(handleStdOutData())); connect(d->lnProc.data(), SIGNAL(readyReadStandardError()), SLOT(handleStdErrData())); d->lnProc->start(); } else { const SftpJobId job = d->uploader->uploadFile(df.localFilePath().toString(), remoteFilePath, SftpOverwriteExisting); if (job == SftpInvalidJob) { const QString message = tr("Failed to upload file '%1': " "Could not open for reading.").arg(nativePath); if (d->ignoreMissingFiles) { emit warningMessage(message); d->filesToUpload.removeFirst(); uploadNextFile(); } else { emit errorMessage(message); setFinished(); handleDeploymentDone(); } } } } } void GenericDirectUploadService::handleStdOutData() { SshRemoteProcess * const process = qobject_cast(sender()); if (process) emit stdOutData(QString::fromUtf8(process->readAllStandardOutput())); } void GenericDirectUploadService::handleStdErrData() { SshRemoteProcess * const process = qobject_cast(sender()); if (process) emit stdErrData(QString::fromUtf8(process->readAllStandardError())); } void GenericDirectUploadService::stopDeployment() { QTC_ASSERT(d->state == InitializingSftp || d->state == Uploading, setFinished(); return); setFinished(); handleDeploymentDone(); } void GenericDirectUploadService::checkDeploymentNeeded(const DeployableFile &deployable) const { QFileInfo fileInfo = deployable.localFilePath().toFileInfo(); if (fileInfo.isDir()) { const QStringList files = QDir(deployable.localFilePath().toString()) .entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot); if (files.isEmpty() && (!d->incremental || hasChangedSinceLastDeployment(deployable))) d->filesToUpload << deployable; foreach (const QString &fileName, files) { const QString localFilePath = deployable.localFilePath().toString() + QLatin1Char('/') + fileName; const QString remoteDir = deployable.remoteDirectory() + QLatin1Char('/') + fileInfo.fileName(); checkDeploymentNeeded(DeployableFile(localFilePath, remoteDir)); } } else if (!d->incremental || hasChangedSinceLastDeployment(deployable)) { d->filesToUpload << deployable; } } void GenericDirectUploadService::setFinished() { d->stopRequested = false; d->state = Inactive; if (d->mkdirProc) disconnect(d->mkdirProc.data(), 0, this, 0); if (d->lnProc) disconnect(d->lnProc.data(), 0, this, 0); if (d->uploader) { disconnect(d->uploader.data(), 0, this, 0); d->uploader->closeChannel(); } } void GenericDirectUploadService::uploadNextFile() { if (d->filesToUpload.isEmpty()) { emit progressMessage(tr("All files successfully deployed.")); setFinished(); handleDeploymentDone(); return; } const DeployableFile &df = d->filesToUpload.first(); QString dirToCreate = df.remoteDirectory(); if (dirToCreate.isEmpty()) { emit warningMessage(tr("Warning: No remote path set for local file '%1'. Skipping upload.") .arg(df.localFilePath().toUserOutput())); d->filesToUpload.takeFirst(); uploadNextFile(); return; } QFileInfo fi = df.localFilePath().toFileInfo(); if (fi.isDir()) dirToCreate += QLatin1Char('/') + fi.fileName(); const QString command = QLatin1String("mkdir -p ") + dirToCreate; d->mkdirProc = connection()->createRemoteProcess(command.toUtf8()); connect(d->mkdirProc.data(), SIGNAL(closed(int)), SLOT(handleMkdirFinished(int))); connect(d->mkdirProc.data(), SIGNAL(readyReadStandardOutput()), SLOT(handleStdOutData())); connect(d->mkdirProc.data(), SIGNAL(readyReadStandardError()), SLOT(handleStdErrData())); emit progressMessage(tr("Uploading file '%1'...") .arg(df.localFilePath().toUserOutput())); d->mkdirProc->start(); } } //namespace RemoteLinux ././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspaceservice.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspace0000644000015301777760000001247612321547255034032 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxcheckforfreediskspaceservice.h" #include namespace RemoteLinux { namespace Internal { class RemoteLinuxCheckForFreeDiskSpaceServicePrivate { public: QString pathToCheck; quint64 requiredSpaceInBytes; QSsh::SshRemoteProcessRunner *processRunner; }; } // namespace Internal RemoteLinuxCheckForFreeDiskSpaceService::RemoteLinuxCheckForFreeDiskSpaceService(QObject *parent) : AbstractRemoteLinuxDeployService(parent), d(new Internal::RemoteLinuxCheckForFreeDiskSpaceServicePrivate) { d->processRunner = 0; d->requiredSpaceInBytes = 0; } RemoteLinuxCheckForFreeDiskSpaceService::~RemoteLinuxCheckForFreeDiskSpaceService() { cleanup(); delete d; } void RemoteLinuxCheckForFreeDiskSpaceService::setPathToCheck(const QString &path) { d->pathToCheck = path; } void RemoteLinuxCheckForFreeDiskSpaceService::setRequiredSpaceInBytes(quint64 sizeInBytes) { d->requiredSpaceInBytes = sizeInBytes; } void RemoteLinuxCheckForFreeDiskSpaceService::handleStdErr() { emit stdErrData(QString::fromUtf8(d->processRunner->readAllStandardError())); } void RemoteLinuxCheckForFreeDiskSpaceService::handleProcessFinished() { switch (d->processRunner->processExitStatus()) { case QSsh::SshRemoteProcess::FailedToStart: emit errorMessage(tr("Remote process failed to start.")); stopDeployment(); return; case QSsh::SshRemoteProcess::CrashExit: emit errorMessage(tr("Remote process crashed.")); stopDeployment(); return; case QSsh::SshRemoteProcess::NormalExit: break; } bool isNumber; QByteArray processOutput = d->processRunner->readAllStandardOutput(); processOutput.chop(1); // newline quint64 freeSpace = processOutput.toULongLong(&isNumber); quint64 requiredSpaceInMegaBytes = d->requiredSpaceInBytes / (1024 * 1024); if (!isNumber) { emit errorMessage(tr("Unexpected output from remote process: '%1'.") .arg(QString::fromUtf8(processOutput))); stopDeployment(); return; } freeSpace /= 1024; // convert kilobyte to megabyte if (freeSpace < requiredSpaceInMegaBytes) { emit errorMessage(tr("The remote file system has only %n megabytes of free space, " "but %1 megabytes are required.", 0, freeSpace).arg(requiredSpaceInMegaBytes)); stopDeployment(); return; } emit progressMessage(tr("The remote file system has %n megabytes of free space, going ahead.", 0, freeSpace)); stopDeployment(); } bool RemoteLinuxCheckForFreeDiskSpaceService::isDeploymentPossible(QString *whyNot) const { if (!AbstractRemoteLinuxDeployService::isDeploymentPossible(whyNot)) return false; if (!d->pathToCheck.startsWith(QLatin1Char('/'))) { if (whyNot) { *whyNot = tr("Cannot check for free disk space: '%1' is not an absolute path.") .arg(d->pathToCheck); } return false; } return true; } void RemoteLinuxCheckForFreeDiskSpaceService::doDeploy() { d->processRunner = new QSsh::SshRemoteProcessRunner; connect(d->processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished())); connect(d->processRunner, SIGNAL(readyReadStandardError()), SLOT(handleStdErr())); const QString command = QString::fromLatin1("df -k %1 |tail -n 1 |sed 's/ */ /g' " "|cut -d ' ' -f 4").arg(d->pathToCheck); d->processRunner->run(command.toUtf8(), deviceConfiguration()->sshParameters()); } void RemoteLinuxCheckForFreeDiskSpaceService::stopDeployment() { cleanup(); handleDeploymentDone(); } void RemoteLinuxCheckForFreeDiskSpaceService::cleanup() { if (d->processRunner) { disconnect(d->processRunner, 0, this, 0); d->processRunner->cancel(); delete d->processRunner; d->processRunner = 0; } } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/linuxdeviceprocess.cpp0000644000015301777760000000633012321547255031710 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "linuxdeviceprocess.h" #include #include namespace RemoteLinux { static QString quote(const QString &s) { return Utils::QtcProcess::quoteArgUnix(s); } LinuxDeviceProcess::LinuxDeviceProcess(const QSharedPointer &device, QObject *parent) : ProjectExplorer::SshDeviceProcess(device, parent) { setEnvironment(Utils::Environment(Utils::OsTypeLinux)); } void LinuxDeviceProcess::setRcFilesToSource(const QStringList &filePaths) { m_rcFilesToSource = filePaths; } void LinuxDeviceProcess::setWorkingDirectory(const QString &directory) { m_workingDir = directory; } QString LinuxDeviceProcess::fullCommandLine() const { QString fullCommandLine; foreach (const QString &filePath, rcFilesToSource()) fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath); if (!m_workingDir.isEmpty()) { fullCommandLine.append(QLatin1String("cd ")).append(quote(m_workingDir)) .append(QLatin1String(" && ")); } const QString envString = environment().toStringList().join(QLatin1String(" ")); if (!envString.isEmpty()) fullCommandLine.append(QLatin1Char(' ')).append(envString); if (!fullCommandLine.isEmpty()) fullCommandLine += QLatin1Char(' '); fullCommandLine.append(quote(executable())); if (!arguments().isEmpty()) { fullCommandLine.append(QLatin1Char(' ')); fullCommandLine.append(Utils::QtcProcess::joinArgsUnix(arguments())); } return fullCommandLine; } QStringList LinuxDeviceProcess::rcFilesToSource() const { if (!m_rcFilesToSource.isEmpty()) return m_rcFilesToSource; return QStringList() << QLatin1String("/etc/profile") << QLatin1String("$HOME/.profile"); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentaspect.cpp0000644000015301777760000000751712321547255034042 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxenvironmentaspect.h" #include "remotelinuxenvironmentaspectwidget.h" namespace RemoteLinux { // -------------------------------------------------------------------- // RemoteLinuxEnvironmentAspect: // -------------------------------------------------------------------- RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect(ProjectExplorer::RunConfiguration *rc) : ProjectExplorer::EnvironmentAspect(rc) { } RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspect::create(ProjectExplorer::RunConfiguration *parent) const { return new RemoteLinuxEnvironmentAspect(parent); } ProjectExplorer::RunConfigWidget *RemoteLinuxEnvironmentAspect::createConfigurationWidget() { return new RemoteLinuxEnvironmentAspectWidget(this); } QList RemoteLinuxEnvironmentAspect::possibleBaseEnvironments() const { return QList() << static_cast(RemoteBaseEnvironment) << static_cast(CleanBaseEnvironment); } QString RemoteLinuxEnvironmentAspect::baseEnvironmentDisplayName(int base) const { if (base == static_cast(CleanBaseEnvironment)) return tr("Clean Environment"); else if (base == static_cast(RemoteBaseEnvironment)) return tr("System Environment"); return QString(); } Utils::Environment RemoteLinuxEnvironmentAspect::baseEnvironment() const { if (baseEnvironmentBase() == static_cast(RemoteBaseEnvironment)) return m_remoteEnvironment; return Utils::Environment(); } AbstractRemoteLinuxRunConfiguration *RemoteLinuxEnvironmentAspect::runConfiguration() const { return qobject_cast(EnvironmentAspect::runConfiguration()); } Utils::Environment RemoteLinuxEnvironmentAspect::remoteEnvironment() const { return m_remoteEnvironment; } void RemoteLinuxEnvironmentAspect::setRemoteEnvironment(const Utils::Environment &env) { if (env != m_remoteEnvironment) { m_remoteEnvironment = env; if (baseEnvironmentBase() == static_cast(RemoteBaseEnvironment)) emit environmentChanged(); } } QString RemoteLinuxEnvironmentAspect::userEnvironmentChangesAsString() const { QString env; QString placeHolder = QLatin1String("%1=%2 "); foreach (const Utils::EnvironmentItem &item, userEnvironmentChanges()) env.append(placeHolder.arg(item.name, item.value)); return env.mid(0, env.size() - 1); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/uploadandinstalltarpackagestep.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/uploadandinstalltarpackagestep.c0000644000015301777760000000702012321547255033704 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "uploadandinstalltarpackagestep.h" #include "remotelinuxdeployconfiguration.h" #include "remotelinuxpackageinstaller.h" #include "tarpackagecreationstep.h" using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class UploadAndInstallTarPackageServicePrivate { public: RemoteLinuxTarPackageInstaller installer; }; } // namespace Internal using namespace Internal; UploadAndInstallTarPackageService::UploadAndInstallTarPackageService(QObject *parent) : AbstractUploadAndInstallPackageService(parent), d(new UploadAndInstallTarPackageServicePrivate) { } UploadAndInstallTarPackageService::~UploadAndInstallTarPackageService() { delete d; } AbstractRemoteLinuxPackageInstaller *UploadAndInstallTarPackageService::packageInstaller() const { return &d->installer; } UploadAndInstallTarPackageStep::UploadAndInstallTarPackageStep(BuildStepList *bsl) : AbstractRemoteLinuxDeployStep(bsl, stepId()) { ctor(); } UploadAndInstallTarPackageStep::UploadAndInstallTarPackageStep(BuildStepList *bsl, UploadAndInstallTarPackageStep *other) : AbstractRemoteLinuxDeployStep(bsl, other) { ctor(); } void UploadAndInstallTarPackageStep::ctor() { m_deployService = new UploadAndInstallTarPackageService(this); setDefaultDisplayName(displayName()); } bool UploadAndInstallTarPackageStep::initInternal(QString *error) { const TarPackageCreationStep * const pStep = deployConfiguration()->earlierBuildStep(this); if (!pStep) { if (error) *error = tr("No tarball creation step found."); return false; } m_deployService->setPackageFilePath(pStep->packageFilePath()); return m_deployService->isDeploymentPossible(error); } BuildStepConfigWidget *UploadAndInstallTarPackageStep::createConfigWidget() { return new SimpleBuildStepConfigWidget(this); } Core::Id UploadAndInstallTarPackageStep::stepId() { return "MaemoUploadAndInstallTarPackageStep"; } QString UploadAndInstallTarPackageStep::displayName() { return tr("Deploy tarball via SFTP upload"); } } //namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeploymentdatamodel.h0000644000015301777760000000443612321547255033773 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXDEPLOYMENTDATAMODEL_H #define REMOTELINUXDEPLOYMENTDATAMODEL_H #include #include namespace RemoteLinux { class RemoteLinuxDeploymentDataModel : public QAbstractTableModel { Q_OBJECT public: explicit RemoteLinuxDeploymentDataModel(QObject *parent = 0); void setDeploymentData(const ProjectExplorer::DeploymentData &deploymentData); private: int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; ProjectExplorer::DeploymentData m_deploymentData; }; } // namespace RemoteLinux #endif // REMOTELINUXDEPLOYMENTDATAMODEL_H ././@LongLink0000000000000000000000000000016300000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwizardpages.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000001452612321547255034052 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "genericlinuxdeviceconfigurationwizardpages.h" #include "ui_genericlinuxdeviceconfigurationwizardsetuppage.h" #include namespace RemoteLinux { namespace Internal { class GenericLinuxDeviceConfigurationWizardSetupPagePrivate { public: Ui::GenericLinuxDeviceConfigurationWizardSetupPage ui; }; class GenericLinuxDeviceConfigurationWizardFinalPagePrivate { public: QLabel infoLabel; }; } // namespace Internal using namespace QSsh; using namespace Utils; GenericLinuxDeviceConfigurationWizardSetupPage::GenericLinuxDeviceConfigurationWizardSetupPage(QWidget *parent) : QWizardPage(parent), d(new Internal::GenericLinuxDeviceConfigurationWizardSetupPagePrivate) { d->ui.setupUi(this); setTitle(tr("Connection")); setSubTitle(QLatin1String(" ")); // For Qt bug (background color) d->ui.privateKeyPathChooser->setExpectedKind(PathChooser::File); d->ui.privateKeyPathChooser->setPromptDialogTitle(tr("Choose a Private Key File")); connect(d->ui.nameLineEdit, SIGNAL(textChanged(QString)), SIGNAL(completeChanged())); connect(d->ui.hostNameLineEdit, SIGNAL(textChanged(QString)), SIGNAL(completeChanged())); connect(d->ui.userNameLineEdit, SIGNAL(textChanged(QString)), SIGNAL(completeChanged())); connect(d->ui.privateKeyPathChooser, SIGNAL(validChanged()), SIGNAL(completeChanged())); connect(d->ui.passwordButton, SIGNAL(toggled(bool)), SLOT(handleAuthTypeChanged())); } GenericLinuxDeviceConfigurationWizardSetupPage::~GenericLinuxDeviceConfigurationWizardSetupPage() { delete d; } void GenericLinuxDeviceConfigurationWizardSetupPage::initializePage() { d->ui.nameLineEdit->setText(defaultConfigurationName()); d->ui.hostNameLineEdit->setText(defaultHostName()); d->ui.userNameLineEdit->setText(defaultUserName()); d->ui.passwordButton->setChecked(true); d->ui.passwordLineEdit->setText(defaultPassWord()); d->ui.privateKeyPathChooser->setPath(ProjectExplorer::IDevice::defaultPrivateKeyFilePath()); handleAuthTypeChanged(); } bool GenericLinuxDeviceConfigurationWizardSetupPage::isComplete() const { return !configurationName().isEmpty() && !hostName().isEmpty() && !userName().isEmpty() && (authenticationType() != SshConnectionParameters::AuthenticationTypePublicKey || d->ui.privateKeyPathChooser->isValid()); } QString GenericLinuxDeviceConfigurationWizardSetupPage::configurationName() const { return d->ui.nameLineEdit->text().trimmed(); } QString GenericLinuxDeviceConfigurationWizardSetupPage::hostName() const { return d->ui.hostNameLineEdit->text().trimmed(); } QString GenericLinuxDeviceConfigurationWizardSetupPage::userName() const { return d->ui.userNameLineEdit->text().trimmed(); } SshConnectionParameters::AuthenticationType GenericLinuxDeviceConfigurationWizardSetupPage::authenticationType() const { return d->ui.passwordButton->isChecked() ? SshConnectionParameters::AuthenticationTypeTryAllPasswordBasedMethods : SshConnectionParameters::AuthenticationTypePublicKey; } QString GenericLinuxDeviceConfigurationWizardSetupPage::password() const { return d->ui.passwordLineEdit->text(); } QString GenericLinuxDeviceConfigurationWizardSetupPage::privateKeyFilePath() const { return d->ui.privateKeyPathChooser->path(); } QString GenericLinuxDeviceConfigurationWizardSetupPage::defaultConfigurationName() const { return tr("Generic Linux Device"); } QString GenericLinuxDeviceConfigurationWizardSetupPage::defaultHostName() const { return QString(); } QString GenericLinuxDeviceConfigurationWizardSetupPage::defaultUserName() const { return QString(); } QString GenericLinuxDeviceConfigurationWizardSetupPage::defaultPassWord() const { return QString(); } void GenericLinuxDeviceConfigurationWizardSetupPage::handleAuthTypeChanged() { d->ui.passwordLineEdit->setEnabled(authenticationType() != SshConnectionParameters::AuthenticationTypePublicKey); d->ui.privateKeyPathChooser->setEnabled(!d->ui.passwordLineEdit->isEnabled()); emit completeChanged(); } GenericLinuxDeviceConfigurationWizardFinalPage::GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent) : QWizardPage(parent), d(new Internal::GenericLinuxDeviceConfigurationWizardFinalPagePrivate) { setTitle(tr("Summary")); setSubTitle(QLatin1String(" ")); // For Qt bug (background color) d->infoLabel.setWordWrap(true); QVBoxLayout * const layout = new QVBoxLayout(this); layout->addWidget(&d->infoLabel); } GenericLinuxDeviceConfigurationWizardFinalPage::~GenericLinuxDeviceConfigurationWizardFinalPage() { delete d; } void GenericLinuxDeviceConfigurationWizardFinalPage::initializePage() { d->infoLabel.setText(infoText()); } QString GenericLinuxDeviceConfigurationWizardFinalPage::infoText() const { return tr("The new device configuration will now be created.\n" "In addition, device connectivity will be tested."); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxrunconfiguration.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxrunconfigurat0000644000015301777760000000524412321547273034122 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Canonical Ltd. ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H #define REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H #include "remotelinux_export.h" #include #include #include namespace RemoteLinux { class REMOTELINUX_EXPORT AbstractRemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration { Q_OBJECT Q_DISABLE_COPY(AbstractRemoteLinuxRunConfiguration) public: AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id); ~AbstractRemoteLinuxRunConfiguration(); virtual QString localExecutableFilePath() const = 0; virtual QString remoteExecutableFilePath() const = 0; virtual QStringList arguments() const = 0; virtual QString workingDirectory() const = 0; virtual QString alternateRemoteExecutable() const = 0; virtual bool useAlternateExecutable() const = 0; virtual Utils::Environment environment() const = 0; signals: void deploySpecsChanged(); void targetInformationChanged() const; protected: AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, AbstractRemoteLinuxRunConfiguration *source); }; } // namespace RemoteLinux #endif // REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxruncontrol.h0000644000015301777760000000460712321547255032145 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXRUNCONTROL_H #define REMOTELINUXRUNCONTROL_H #include "remotelinux_export.h" #include namespace RemoteLinux { class REMOTELINUX_EXPORT RemoteLinuxRunControl : public ProjectExplorer::RunControl { Q_OBJECT public: explicit RemoteLinuxRunControl(ProjectExplorer::RunConfiguration *runConfig); virtual ~RemoteLinuxRunControl(); virtual void start(); virtual StopResult stop(); virtual bool isRunning() const; virtual QIcon icon() const; private slots: void handleErrorMessage(const QString &error); void handleRunnerFinished(); void handleRemoteOutput(const QByteArray &output); void handleRemoteErrorOutput(const QByteArray &output); void handleProgressReport(const QString &progressString); private: void setFinished(); class RemoteLinuxRunControlPrivate; RemoteLinuxRunControlPrivate * const d; }; } // namespace RemoteLinux #endif // REMOTELINUXRUNCONTROL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/tarpackagecreationstep.h0000644000015301777760000000550112321547255032161 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef TARPACKAGECREATIONSTEP_H #define TARPACKAGECREATIONSTEP_H #include "abstractpackagingstep.h" #include "remotelinux_export.h" #include QT_BEGIN_NAMESPACE class QFile; class QFileInfo; QT_END_NAMESPACE namespace RemoteLinux { class REMOTELINUX_EXPORT TarPackageCreationStep : public AbstractPackagingStep { Q_OBJECT public: TarPackageCreationStep(ProjectExplorer::BuildStepList *bsl); TarPackageCreationStep(ProjectExplorer::BuildStepList *bsl, TarPackageCreationStep *other); static Core::Id stepId(); static QString displayName(); bool init(); void run(QFutureInterface &fi); void setIgnoreMissingFiles(bool ignoreMissingFiles); bool ignoreMissingFiles() const; private: ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); bool fromMap(const QVariantMap &map); QVariantMap toMap() const; QString packageFileName() const; void ctor(); bool doPackage(QFutureInterface &fi); bool appendFile(QFile &tarFile, const QFileInfo &fileInfo, const QString &remoteFilePath, const QFutureInterface &fi); bool writeHeader(QFile &tarFile, const QFileInfo &fileInfo, const QString &remoteFilePath); bool m_ignoreMissingFiles; bool m_packagingNeeded; QList m_files; }; } // namespace RemoteLinux #endif // TARPACKAGECREATIONSTEP_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxanalyzesupport.h0000644000015301777760000000606612321547255033041 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXANALYZESUPPORT_H #define REMOTELINUXANALYZESUPPORT_H #include "abstractremotelinuxrunsupport.h" #include #include namespace Analyzer { class AnalyzerStartParameters; class AnalyzerRunControl; } namespace RemoteLinux { class AbstractRemoteLinuxRunConfiguration; namespace Internal { class RemoteLinuxAnalyzeSupportPrivate; } class REMOTELINUX_EXPORT RemoteLinuxAnalyzeSupport : public AbstractRemoteLinuxRunSupport { Q_OBJECT public: static Analyzer::AnalyzerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig, ProjectExplorer::RunMode runMode); RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig, Analyzer::AnalyzerRunControl *engine, ProjectExplorer::RunMode runMode); ~RemoteLinuxAnalyzeSupport(); protected: void startExecution(); void handleAdapterSetupFailed(const QString &error); private slots: void handleRemoteSetupRequested(); void handleAppRunnerError(const QString &error); void handleRemoteOutput(const QByteArray &output); void handleRemoteErrorOutput(const QByteArray &output); void handleAppRunnerFinished(bool success); void handleProgressReport(const QString &progressOutput); void handleRemoteProcessStarted(); void handleProfilingFinished(); void remoteIsRunning(); private: void showMessage(const QString &, Utils::OutputFormat); Internal::RemoteLinuxAnalyzeSupportPrivate * const d; }; } // namespace RemoteLinux #endif // REMOTELINUXANALYZESUPPORT_H ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxdeployservice.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxdeployservice0000644000015301777760000000720012321547255034103 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef ABSTRACTREMOTELINUXDEPLOYSERVICE_H #define ABSTRACTREMOTELINUXDEPLOYSERVICE_H #include "remotelinux_export.h" #include #include #include namespace QSsh { class SshConnection; } namespace ProjectExplorer { class DeployableFile; class Kit; class Target; } namespace RemoteLinux { namespace Internal { class AbstractRemoteLinuxDeployServicePrivate; } class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployService : public QObject { Q_OBJECT Q_DISABLE_COPY(AbstractRemoteLinuxDeployService) public: explicit AbstractRemoteLinuxDeployService(QObject *parent = 0); ~AbstractRemoteLinuxDeployService(); void setTarget(ProjectExplorer::Target *bc); void start(); void stop(); QVariantMap exportDeployTimes() const; void importDeployTimes(const QVariantMap &map); virtual bool isDeploymentPossible(QString *whyNot = 0) const; signals: void errorMessage(const QString &message); void progressMessage(const QString &message); void warningMessage(const QString &message); void stdOutData(const QString &data); void stdErrData(const QString &data); protected: const ProjectExplorer::Target *target() const; const ProjectExplorer::Kit *profile() const; ProjectExplorer::IDevice::ConstPtr deviceConfiguration() const; QSsh::SshConnection *connection() const; void saveDeploymentTimeStamp(const ProjectExplorer::DeployableFile &deployableFile); bool hasChangedSinceLastDeployment(const ProjectExplorer::DeployableFile &deployableFile) const; void handleDeviceSetupDone(bool success); void handleDeploymentDone(); private slots: void handleConnected(); void handleConnectionFailure(); private: Q_SIGNAL void finished(); virtual bool isDeploymentNecessary() const = 0; // Should do things needed *before* connecting. Call handleDeviceSetupDone() afterwards. virtual void doDeviceSetup() = 0; virtual void stopDeviceSetup() = 0; virtual void doDeploy() = 0; virtual void stopDeployment() = 0; void setFinished(); Internal::AbstractRemoteLinuxDeployServicePrivate * const d; }; } // namespace RemoteLinux #endif // ABSTRACTREMOTELINUXDEPLOYSERVICE_H ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericremotelinuxdeploystepfactory.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericremotelinuxdeploystepfact0000644000015301777760000000516112321547255034071 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef GENERICREMOTELINUXDEPLOYSTEPFACTORY_H #define GENERICREMOTELINUXDEPLOYSTEPFACTORY_H #include namespace RemoteLinux { namespace Internal { class GenericRemoteLinuxDeployStepFactory : public ProjectExplorer::IBuildStepFactory { Q_OBJECT public: GenericRemoteLinuxDeployStepFactory(QObject *parent = 0); QList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product); }; } // namespace Internal } // namespace RemoteLinux #endif // GENERICREMOTELINUXDEPLOYSTEPFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinux_constants.h0000644000015301777760000000347112321547255032111 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUX_CONSTANTS_H #define REMOTELINUX_CONSTANTS_H namespace RemoteLinux { namespace Constants { const char GenericLinuxOsType[] = "GenericLinuxOsType"; const char GenericDeployKeyToDeviceActionId[] = "RemoteLinux.GenericDeployKeyToDeviceAction"; const char EMBEDDED_LINUX_QT[] = "RemoteLinux.EmbeddedLinuxQt"; } // Constants } // RemoteLinux #endif // REMOTELINUX_CONSTANTS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/publickeydeploymentdialog.h0000644000015301777760000000503612321547255032711 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef PUBLICKEYDEPLOYMENTDIALOG_H #define PUBLICKEYDEPLOYMENTDIALOG_H #include "remotelinux_export.h" #include #include namespace RemoteLinux { namespace Internal { class PublicKeyDeploymentDialogPrivate; } // namespace Internal class REMOTELINUX_EXPORT PublicKeyDeploymentDialog : public QProgressDialog { Q_OBJECT public: // Asks for public key and returns null if the file dialog is canceled. static PublicKeyDeploymentDialog *createDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfig, QWidget *parent = 0); ~PublicKeyDeploymentDialog(); private slots: void handleDeploymentError(const QString &errorMsg); void handleDeploymentSuccess(); void handleCanceled(); private: explicit PublicKeyDeploymentDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfig, const QString &publicKeyFileName, QWidget *parent = 0); void handleDeploymentFinished(const QString &errorMsg); Internal::PublicKeyDeploymentDialogPrivate * const d; }; } // namespace RemoteLinux #endif // PUBLICKEYDEPLOYMENTDIALOG_H ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxdeployconfigurationwi0000644000015301777760000000604412321547255034133 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxdeployconfigurationwidget.h" #include "ui_remotelinuxdeployconfigurationwidget.h" #include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeploymentdatamodel.h" #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class RemoteLinuxDeployConfigurationWidgetPrivate { public: Ui::RemoteLinuxDeployConfigurationWidget ui; RemoteLinuxDeployConfiguration *deployConfiguration; RemoteLinuxDeploymentDataModel deploymentDataModel; }; } // namespace Internal using namespace Internal; RemoteLinuxDeployConfigurationWidget::RemoteLinuxDeployConfigurationWidget(RemoteLinuxDeployConfiguration *dc, QWidget *parent) : NamedWidget(parent), d(new RemoteLinuxDeployConfigurationWidgetPrivate) { d->ui.setupUi(this); d->ui.deploymentDataView->setTextElideMode(Qt::ElideMiddle); d->ui.deploymentDataView->setWordWrap(false); d->ui.deploymentDataView->setUniformRowHeights(true); d->ui.deploymentDataView->setModel(&d->deploymentDataModel); d->deployConfiguration = dc; connect(dc->target(), SIGNAL(deploymentDataChanged()), SLOT(updateDeploymentDataModel())); updateDeploymentDataModel(); } RemoteLinuxDeployConfigurationWidget::~RemoteLinuxDeployConfigurationWidget() { delete d; } void RemoteLinuxDeployConfigurationWidget::updateDeploymentDataModel() { d->deploymentDataModel.setDeploymentData(d->deployConfiguration->target()->deploymentData()); d->ui.deploymentDataView->resizeColumnToContents(0); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxruncontrolfactory.h0000644000015301777760000000427612321547255033537 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXRUNCONTROLFACTORY_H #define REMOTELINUXRUNCONTROLFACTORY_H #include namespace RemoteLinux { namespace Internal { class RemoteLinuxRunControlFactory : public ProjectExplorer::IRunControlFactory { Q_OBJECT public: explicit RemoteLinuxRunControlFactory(QObject *parent = 0); ~RemoteLinuxRunControlFactory(); bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, QString *errorMessage); }; } // namespace Internal } // namespace RemoteLinux #endif // REMOTELINUXRUNCONTROLFACTORY_H ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeployservice.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeployse0000644000015301777760000000503112321547255034120 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXCUSTOMCOMMANDDEPLOYSERVICE_H #define REMOTELINUXCUSTOMCOMMANDDEPLOYSERVICE_H #include "abstractremotelinuxdeployservice.h" namespace RemoteLinux { namespace Internal { class RemoteLinuxCustomCommandDeployservicePrivate; } // namespace Internal class REMOTELINUX_EXPORT RemoteLinuxCustomCommandDeployService : public AbstractRemoteLinuxDeployService { Q_OBJECT public: explicit RemoteLinuxCustomCommandDeployService(QObject *parent = 0); ~RemoteLinuxCustomCommandDeployService(); void setCommandLine(const QString &commandLine); bool isDeploymentNecessary() const { return true; } bool isDeploymentPossible(QString *whyNot = 0) const; protected: void doDeviceSetup() { handleDeviceSetupDone(true); } void stopDeviceSetup() { handleDeviceSetupDone(false); } void doDeploy(); void stopDeployment(); private slots: void handleStdout(); void handleStderr(); void handleProcessClosed(int exitStatus); private: Internal::RemoteLinuxCustomCommandDeployservicePrivate *d; }; } // namespace RemoteLinux #endif // REMOTELINUXCUSTOMCOMMANDDEPLOYSERVICE_H ././@LongLink0000000000000000000000000000016100000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwizardpages.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000000623012321547255034043 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef GENERICLINUXDEVICECONFIGURATIONWIZARDPAGES_H #define GENERICLINUXDEVICECONFIGURATIONWIZARDPAGES_H #include "remotelinux_export.h" #include #include namespace RemoteLinux { namespace Internal { class GenericLinuxDeviceConfigurationWizardSetupPagePrivate; class GenericLinuxDeviceConfigurationWizardFinalPagePrivate; } // namespace Internal class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardSetupPage : public QWizardPage { Q_OBJECT public: explicit GenericLinuxDeviceConfigurationWizardSetupPage(QWidget *parent = 0); ~GenericLinuxDeviceConfigurationWizardSetupPage(); void initializePage(); bool isComplete() const; QString configurationName() const; QString hostName() const; QString userName() const; QSsh::SshConnectionParameters::AuthenticationType authenticationType() const; QString password() const; QString privateKeyFilePath() const; virtual QString defaultConfigurationName() const; virtual QString defaultHostName() const; virtual QString defaultUserName() const; virtual QString defaultPassWord() const; private: Q_SLOT void handleAuthTypeChanged(); Internal::GenericLinuxDeviceConfigurationWizardSetupPagePrivate * const d; }; class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardFinalPage : public QWizardPage { Q_OBJECT public: GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent); ~GenericLinuxDeviceConfigurationWizardFinalPage(); void initializePage(); protected: virtual QString infoText() const; private: Internal::GenericLinuxDeviceConfigurationWizardFinalPagePrivate * const d; }; } // namespace RemoteLinux #endif // GENERICLINUXDEVICECONFIGURATIONWIZARDPAGES_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxplugin.h0000644000015301777760000000373212321547255031234 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXPLUGIN_H #define REMOTELINUXPLUGIN_H #include namespace RemoteLinux { namespace Internal { class RemoteLinuxPlugin : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "RemoteLinux.json") public: RemoteLinuxPlugin(); ~RemoteLinuxPlugin(); bool initialize(const QStringList &arguments, QString *errorMessage); void extensionsInitialized(); }; } // namespace Internal } // namespace RemoteLinux #endif // REMOTELINUXPLUGIN_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/linuxdeviceprocess.h0000644000015301777760000000444312321547255031360 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QTC_LINUXDEVICEPROCESS_H #define QTC_LINUXDEVICEPROCESS_H #include "remotelinux_export.h" #include #include namespace RemoteLinux { class REMOTELINUX_EXPORT LinuxDeviceProcess : public ProjectExplorer::SshDeviceProcess { Q_OBJECT public: explicit LinuxDeviceProcess(const QSharedPointer &device, QObject *parent = 0); // Files to source before executing the command (if they exist). Overrides the default. void setRcFilesToSource(const QStringList &filePaths); void setWorkingDirectory(const QString &directory); private: QString fullCommandLine() const; QStringList rcFilesToSource() const; QStringList m_rcFilesToSource; QString m_workingDir; }; } // namespace RemoteLinux #endif // Include guard. ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwidget.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000000531512321547255034046 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUX_GENERICLINUXDEVICECONFIGURATIONWIDGET_H #define REMOTELINUX_GENERICLINUXDEVICECONFIGURATIONWIDGET_H #include #include "remotelinux_export.h" namespace RemoteLinux { namespace Ui { class GenericLinuxDeviceConfigurationWidget; } class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWidget : public ProjectExplorer::IDeviceWidget { Q_OBJECT public: explicit GenericLinuxDeviceConfigurationWidget( const ProjectExplorer::IDevice::Ptr &deviceConfig, QWidget *parent = 0); ~GenericLinuxDeviceConfigurationWidget(); private slots: void authenticationTypeChanged(); void hostNameEditingFinished(); void sshPortEditingFinished(); void timeoutEditingFinished(); void userNameEditingFinished(); void passwordEditingFinished(); void keyFileEditingFinished(); void gdbServerEditingFinished(); void showPassword(bool showClearText); void handleFreePortsChanged(); void setPrivateKey(const QString &path); void createNewKey(); private: void updateDeviceFromUi(); void updatePortsWarningLabel(); void initGui(); Ui::GenericLinuxDeviceConfigurationWidget *m_ui; }; } // namespace RemoteLinux #endif // REMOTELINUX_GENERICLINUXDEVICECONFIGURATIONWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentreader.cpp0000644000015301777760000001067412321547255034023 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxenvironmentreader.h" #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(RunConfiguration *config, QObject *parent) : QObject(parent) , m_stop(false) , m_env(Utils::OsTypeLinux) , m_kit(config->target()->kit()) , m_deviceProcess(0) { connect(config->target(), SIGNAL(kitChanged()), this, SLOT(handleCurrentDeviceConfigChanged())); } void RemoteLinuxEnvironmentReader::start() { IDevice::ConstPtr device = DeviceKitInformation::device(m_kit); if (!device) return; m_stop = false; m_deviceProcess = device->createProcess(this); connect(m_deviceProcess, SIGNAL(error(QProcess::ProcessError)), SLOT(handleError())); connect(m_deviceProcess, SIGNAL(finished()), SLOT(remoteProcessFinished())); m_deviceProcess->start(QLatin1String("env")); } void RemoteLinuxEnvironmentReader::stop() { m_stop = true; destroyProcess(); } void RemoteLinuxEnvironmentReader::handleError() { if (m_stop) return; emit error(tr("Error: %1").arg(m_deviceProcess->errorString())); setFinished(); } void RemoteLinuxEnvironmentReader::handleCurrentDeviceConfigChanged() { m_env.clear(); setFinished(); } void RemoteLinuxEnvironmentReader::remoteProcessFinished() { if (m_stop) return; m_env.clear(); QString errorMessage; if (m_deviceProcess->exitStatus() != QProcess::NormalExit) { errorMessage = m_deviceProcess->errorString(); } else if (m_deviceProcess->exitCode() != 0) { errorMessage = tr("Process exited with code %1.") .arg(m_deviceProcess->exitCode()); } if (!errorMessage.isEmpty()) { errorMessage = tr("Error running 'env': %1").arg(errorMessage); const QString remoteStderr = QString::fromUtf8(m_deviceProcess->readAllStandardError()).trimmed(); if (!remoteStderr.isEmpty()) errorMessage += tr("\nRemote stderr was: '%1'").arg(remoteStderr); emit error(errorMessage); } else { QString remoteOutput = QString::fromUtf8(m_deviceProcess->readAllStandardOutput()); if (!remoteOutput.isEmpty()) { m_env = Utils::Environment(remoteOutput.split(QLatin1Char('\n'), QString::SkipEmptyParts), Utils::OsTypeLinux); } } setFinished(); } void RemoteLinuxEnvironmentReader::setFinished() { stop(); emit finished(); } void RemoteLinuxEnvironmentReader::destroyProcess() { if (!m_deviceProcess) return; m_deviceProcess->disconnect(this); if (m_deviceProcess->state() != QProcess::NotRunning) m_deviceProcess->terminate(); m_deviceProcess->deleteLater(); m_deviceProcess = 0; } } // namespace Internal } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspacestep.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspace0000644000015301777760000000534012321547255034022 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXCHECKFORFREEDISKSPACESTEP_H #define REMOTELINUXCHECKFORFREEDISKSPACESTEP_H #include "abstractremotelinuxdeploystep.h" namespace RemoteLinux { namespace Internal { class RemoteLinuxCheckForFreeDiskSpaceStepPrivate; } class REMOTELINUX_EXPORT RemoteLinuxCheckForFreeDiskSpaceStep : public AbstractRemoteLinuxDeployStep { Q_OBJECT public: explicit RemoteLinuxCheckForFreeDiskSpaceStep(ProjectExplorer::BuildStepList *bsl, Core::Id id = stepId()); RemoteLinuxCheckForFreeDiskSpaceStep(ProjectExplorer::BuildStepList *bsl, RemoteLinuxCheckForFreeDiskSpaceStep *other); ~RemoteLinuxCheckForFreeDiskSpaceStep(); void setPathToCheck(const QString &path); QString pathToCheck() const; void setRequiredSpaceInBytes(quint64 space); quint64 requiredSpaceInBytes() const; static Core::Id stepId(); static QString stepDisplayName(); protected: bool fromMap(const QVariantMap &map); QVariantMap toMap() const; ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); bool initInternal(QString *error); AbstractRemoteLinuxDeployService *deployService() const; private: void ctor(); Internal::RemoteLinuxCheckForFreeDiskSpaceStepPrivate *d; }; } // namespace RemoteLinux #endif // REMOTELINUXCHECKFORFREEDISKSPACESTEP_H ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfigurationwidge0000644000015301777760000002007612321547255034124 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxrunconfigurationwidget.h" #include "remotelinuxrunconfiguration.h" #include #include #include #include #include #include #include #include #include #include #include namespace RemoteLinux { namespace Internal { class RemoteLinuxRunConfigurationWidgetPrivate { public: RemoteLinuxRunConfigurationWidgetPrivate(RemoteLinuxRunConfiguration *runConfig) : runConfiguration(runConfig), ignoreChange(false) { } RemoteLinuxRunConfiguration * const runConfiguration; bool ignoreChange; QWidget topWidget; QLabel disabledIcon; QLabel disabledReason; QLineEdit argsLineEdit; QLineEdit workingDirLineEdit; QLabel localExecutableLabel; QLabel remoteExecutableLabel; QCheckBox useAlternateCommandBox; QLineEdit alternateCommand; QLabel devConfLabel; QFormLayout genericWidgetsLayout; }; } // namespace Internal using namespace Internal; RemoteLinuxRunConfigurationWidget::RemoteLinuxRunConfigurationWidget(RemoteLinuxRunConfiguration *runConfiguration, QWidget *parent) : QWidget(parent), d(new RemoteLinuxRunConfigurationWidgetPrivate(runConfiguration)) { QVBoxLayout *topLayout = new QVBoxLayout(this); topLayout->setMargin(0); addDisabledLabel(topLayout); topLayout->addWidget(&d->topWidget); QVBoxLayout *mainLayout = new QVBoxLayout(&d->topWidget); mainLayout->setMargin(0); addGenericWidgets(mainLayout); connect(d->runConfiguration, SIGNAL(enabledChanged()), SLOT(runConfigurationEnabledChange())); runConfigurationEnabledChange(); } RemoteLinuxRunConfigurationWidget::~RemoteLinuxRunConfigurationWidget() { delete d; } void RemoteLinuxRunConfigurationWidget::addFormLayoutRow(QWidget *label, QWidget *field) { d->genericWidgetsLayout.addRow(label, field); } void RemoteLinuxRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout) { QHBoxLayout * const hl = new QHBoxLayout; hl->addStretch(); d->disabledIcon.setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png"))); hl->addWidget(&d->disabledIcon); d->disabledReason.setVisible(false); hl->addWidget(&d->disabledReason); hl->addStretch(); topLayout->addLayout(hl); } void RemoteLinuxRunConfigurationWidget::runConfigurationEnabledChange() { bool enabled = d->runConfiguration->isEnabled(); d->topWidget.setEnabled(enabled); d->disabledIcon.setVisible(!enabled); d->disabledReason.setVisible(!enabled); d->disabledReason.setText(d->runConfiguration->disabledReason()); } void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout) { Utils::DetailsWidget *detailsContainer = new Utils::DetailsWidget(this); detailsContainer->setState(Utils::DetailsWidget::NoSummary); QWidget *details = new QWidget(this); details->setLayout(&d->genericWidgetsLayout); detailsContainer->setWidget(details); mainLayout->addWidget(detailsContainer); d->genericWidgetsLayout.setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter); d->localExecutableLabel.setText(d->runConfiguration->localExecutableFilePath()); d->genericWidgetsLayout.addRow(tr("Executable on host:"), &d->localExecutableLabel); d->genericWidgetsLayout.addRow(tr("Executable on device:"), &d->remoteExecutableLabel); QWidget * const altRemoteExeWidget = new QWidget; QHBoxLayout * const altRemoteExeLayout = new QHBoxLayout(altRemoteExeWidget); altRemoteExeLayout->setContentsMargins(0, 0, 0, 0); d->alternateCommand.setText(d->runConfiguration->alternateRemoteExecutable()); altRemoteExeLayout->addWidget(&d->alternateCommand); d->useAlternateCommandBox.setText(tr("Use this command instead")); d->useAlternateCommandBox.setChecked(d->runConfiguration->useAlternateExecutable()); altRemoteExeLayout->addWidget(&d->useAlternateCommandBox); d->genericWidgetsLayout.addRow(tr("Alternate executable on device:"), altRemoteExeWidget); d->argsLineEdit.setText(d->runConfiguration->arguments().join(QLatin1String(" "))); d->genericWidgetsLayout.addRow(tr("Arguments:"), &d->argsLineEdit); d->workingDirLineEdit.setPlaceholderText(tr("")); d->workingDirLineEdit.setText(d->runConfiguration->workingDirectory()); d->genericWidgetsLayout.addRow(tr("Working directory:"), &d->workingDirLineEdit); connect(&d->argsLineEdit, SIGNAL(textEdited(QString)), SLOT(argumentsEdited(QString))); connect(d->runConfiguration, SIGNAL(targetInformationChanged()), this, SLOT(updateTargetInformation())); connect(d->runConfiguration, SIGNAL(deploySpecsChanged()), SLOT(handleDeploySpecsChanged())); connect(&d->useAlternateCommandBox, SIGNAL(toggled(bool)), SLOT(handleUseAlternateCommandChanged())); connect(&d->alternateCommand, SIGNAL(textEdited(QString)), SLOT(handleAlternateCommandChanged())); connect(&d->workingDirLineEdit, SIGNAL(textEdited(QString)), SLOT(handleWorkingDirectoryChanged())); handleDeploySpecsChanged(); handleUseAlternateCommandChanged(); } void RemoteLinuxRunConfigurationWidget::argumentsEdited(const QString &text) { d->runConfiguration->setArguments(text); } void RemoteLinuxRunConfigurationWidget::updateTargetInformation() { setLabelText(d->localExecutableLabel, QDir::toNativeSeparators(d->runConfiguration->localExecutableFilePath()), tr("Unknown")); } void RemoteLinuxRunConfigurationWidget::handleDeploySpecsChanged() { setLabelText(d->remoteExecutableLabel, d->runConfiguration->defaultRemoteExecutableFilePath(), tr("Remote path not set")); } void RemoteLinuxRunConfigurationWidget::setLabelText(QLabel &label, const QString ®ularText, const QString &errorText) { const QString errorMessage = QLatin1String("") + errorText + QLatin1String(""); label.setText(regularText.isEmpty() ? errorMessage : regularText); } void RemoteLinuxRunConfigurationWidget::handleUseAlternateCommandChanged() { const bool useAltExe = d->useAlternateCommandBox.isChecked(); d->remoteExecutableLabel.setEnabled(!useAltExe); d->alternateCommand.setEnabled(useAltExe); d->runConfiguration->setUseAlternateExecutable(useAltExe); } void RemoteLinuxRunConfigurationWidget::handleAlternateCommandChanged() { d->runConfiguration->setAlternateRemoteExecutable(d->alternateCommand.text().trimmed()); } void RemoteLinuxRunConfigurationWidget::handleWorkingDirectoryChanged() { d->runConfiguration->setWorkingDirectory(d->workingDirLineEdit.text().trimmed()); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinux_dependencies.pri0000644000015301777760000000021512321547255033057 0ustar pbusernogroup00000000000000QTC_PLUGIN_NAME = RemoteLinux QTC_PLUGIN_DEPENDS += \ coreplugin \ debugger \ projectexplorer \ qtsupport \ analyzerbase qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxsignaloperation.h0000644000015301777760000000520212321547255033126 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXSIGNALOPERATION_H #define REMOTELINUXSIGNALOPERATION_H #include "remotelinux_export.h" #include #include namespace QSsh { class SshConnectionParameters; class SshRemoteProcessRunner; } namespace RemoteLinux { class REMOTELINUX_EXPORT RemoteLinuxSignalOperation : public ProjectExplorer::DeviceProcessSignalOperation { Q_OBJECT public: virtual ~RemoteLinuxSignalOperation(); void killProcess(int pid); void killProcess(const QString &filePath); void interruptProcess(int pid); void interruptProcess(const QString &filePath); protected: RemoteLinuxSignalOperation(const QSsh::SshConnectionParameters sshParameters); private slots: void runnerProcessFinished(); void runnerConnectionError(); private: virtual QString killProcessByNameCommandLine(const QString &filePath) const; virtual QString interruptProcessByNameCommandLine(const QString &filePath) const; void run(const QString command); void finish(); const QSsh::SshConnectionParameters m_sshParameters; QSsh::SshRemoteProcessRunner *m_runner; friend class LinuxDevice; }; } #endif // REMOTELINUXSIGNALOPERATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinux_export.h0000644000015301777760000000324612321547255031416 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTE_LINUX_EXPORT_H #define REMOTE_LINUX_EXPORT_H #include #if defined(REMOTELINUX_LIBRARY) # define REMOTELINUX_EXPORT Q_DECL_EXPORT #else # define REMOTELINUX_EXPORT Q_DECL_IMPORT #endif #endif // REMOTE_LINUX_EXPORT_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/packageuploader.h0000644000015301777760000000532412321547255030570 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef PACKAGEUPLOADER_H #define PACKAGEUPLOADER_H #include #include #include #include namespace QSsh { class SftpChannel; class SshConnection; } namespace RemoteLinux { namespace Internal { class PackageUploader : public QObject { Q_OBJECT public: explicit PackageUploader(QObject *parent = 0); ~PackageUploader(); // Connection has to be established already. void uploadPackage(QSsh::SshConnection *connection, const QString &localFilePath, const QString &remoteFilePath); void cancelUpload(); signals: void progress(const QString &message); void uploadFinished(const QString &errorMsg = QString()); private slots: void handleConnectionFailure(); void handleSftpChannelInitialized(); void handleSftpChannelInitializationFailed(const QString &error); void handleSftpJobFinished(QSsh::SftpJobId job, const QString &error); private: enum State { InitializingSftp, Uploading, Inactive }; void cleanup(); void setState(State newState); State m_state; QSsh::SshConnection *m_connection; QSharedPointer m_uploader; QString m_localFilePath; QString m_remoteFilePath; }; } // namespace Internal } // namespace RemoteLinux #endif // PACKAGEUPLOADER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxutils.h0000644000015301777760000000321712321547255031074 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXUTILS_H #define REMOTELINUXUTILS_H #include "remotelinux_export.h" namespace RemoteLinux { class REMOTELINUX_EXPORT RemoteLinuxUtils { public: }; } // namespace RemoteLinux #endif // REMOTELINUXUTILS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinux.qrc0000644000015301777760000000016312321547255030346 0ustar pbusernogroup00000000000000 images/embeddedtarget.png qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinux.pro0000644000015301777760000000756212321547255030373 0ustar pbusernogroup00000000000000QT += network include(../../qtcreatorplugin.pri) HEADERS += \ embeddedlinuxqtversion.h \ embeddedlinuxqtversionfactory.h \ remotelinuxenvironmentaspect.h \ remotelinuxenvironmentaspectwidget.h \ remotelinuxplugin.h \ remotelinux_export.h \ linuxdevice.h \ abstractremotelinuxrunconfiguration.h \ remotelinuxrunconfiguration.h \ publickeydeploymentdialog.h \ genericlinuxdeviceconfigurationwizard.h \ genericlinuxdeviceconfigurationfactory.h \ remotelinuxrunconfigurationwidget.h \ remotelinuxrunconfigurationfactory.h \ remotelinuxruncontrol.h \ remotelinuxruncontrolfactory.h \ remotelinuxdebugsupport.h \ genericlinuxdeviceconfigurationwizardpages.h \ abstractremotelinuxdeploystep.h \ genericdirectuploadstep.h \ uploadandinstalltarpackagestep.h \ abstractremotelinuxdeployservice.h \ abstractuploadandinstallpackageservice.h \ genericdirectuploadservice.h \ remotelinuxdeployconfiguration.h \ remotelinuxdeployconfigurationfactory.h \ genericremotelinuxdeploystepfactory.h \ abstractpackagingstep.h \ tarpackagecreationstep.h \ remotelinuxpackageinstaller.h \ packageuploader.h \ linuxdevicetester.h \ remotelinux_constants.h \ remotelinuxenvironmentreader.h \ sshkeydeployer.h \ typespecificdeviceconfigurationlistmodel.h \ remotelinuxutils.h \ remotelinuxdeployconfigurationwidget.h \ remotelinuxcustomcommanddeployservice.h \ remotelinuxcustomcommanddeploymentstep.h \ genericlinuxdeviceconfigurationwidget.h \ remotelinuxcheckforfreediskspaceservice.h \ remotelinuxcheckforfreediskspacestep.h \ remotelinuxdeploymentdatamodel.h \ remotelinuxanalyzesupport.h \ abstractremotelinuxrunsupport.h \ linuxdeviceprocess.h \ remotelinuxsignaloperation.h SOURCES += \ embeddedlinuxqtversion.cpp \ embeddedlinuxqtversionfactory.cpp \ remotelinuxenvironmentaspect.cpp \ remotelinuxenvironmentaspectwidget.cpp \ remotelinuxplugin.cpp \ linuxdevice.cpp \ abstractremotelinuxrunconfiguration.cpp \ remotelinuxrunconfiguration.cpp \ publickeydeploymentdialog.cpp \ genericlinuxdeviceconfigurationwizard.cpp \ genericlinuxdeviceconfigurationfactory.cpp \ remotelinuxrunconfigurationwidget.cpp \ remotelinuxrunconfigurationfactory.cpp \ remotelinuxruncontrol.cpp \ remotelinuxruncontrolfactory.cpp \ remotelinuxdebugsupport.cpp \ genericlinuxdeviceconfigurationwizardpages.cpp \ abstractremotelinuxdeploystep.cpp \ genericdirectuploadstep.cpp \ uploadandinstalltarpackagestep.cpp \ abstractremotelinuxdeployservice.cpp \ abstractuploadandinstallpackageservice.cpp \ genericdirectuploadservice.cpp \ remotelinuxdeployconfiguration.cpp \ remotelinuxdeployconfigurationfactory.cpp \ genericremotelinuxdeploystepfactory.cpp \ abstractpackagingstep.cpp \ tarpackagecreationstep.cpp \ remotelinuxpackageinstaller.cpp \ packageuploader.cpp \ linuxdevicetester.cpp \ remotelinuxenvironmentreader.cpp \ sshkeydeployer.cpp \ typespecificdeviceconfigurationlistmodel.cpp \ remotelinuxutils.cpp \ remotelinuxdeployconfigurationwidget.cpp \ remotelinuxcustomcommanddeployservice.cpp \ remotelinuxcustomcommanddeploymentstep.cpp \ genericlinuxdeviceconfigurationwidget.cpp \ remotelinuxcheckforfreediskspaceservice.cpp \ remotelinuxcheckforfreediskspacestep.cpp \ remotelinuxdeploymentdatamodel.cpp \ remotelinuxanalyzesupport.cpp \ abstractremotelinuxrunsupport.cpp \ linuxdeviceprocess.cpp \ remotelinuxsignaloperation.cpp FORMS += \ genericlinuxdeviceconfigurationwizardsetuppage.ui \ remotelinuxdeployconfigurationwidget.ui \ genericlinuxdeviceconfigurationwidget.ui \ remotelinuxcheckforfreediskspacestepwidget.ui RESOURCES += remotelinux.qrc DEFINES += REMOTELINUX_LIBRARY qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxrunconfiguration.cpp0000644000015301777760000002224212321547255033662 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxrunconfiguration.h" #include "remotelinuxenvironmentaspect.h" #include "remotelinuxrunconfigurationwidget.h" #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace Utils; namespace RemoteLinux { namespace Internal { namespace { const char ArgumentsKey[] = "Qt4ProjectManager.MaemoRunConfiguration.Arguments"; const char ProFileKey[] = "Qt4ProjectManager.MaemoRunConfiguration.ProFile"; const char UseAlternateExeKey[] = "RemoteLinux.RunConfig.UseAlternateRemoteExecutable"; const char AlternateExeKey[] = "RemoteLinux.RunConfig.AlternateRemoteExecutable"; const char WorkingDirectoryKey[] = "RemoteLinux.RunConfig.WorkingDirectory"; } // anonymous namespace class RemoteLinuxRunConfigurationPrivate { public: RemoteLinuxRunConfigurationPrivate(const QString &projectFilePath) : projectFilePath(projectFilePath), useAlternateRemoteExecutable(false) { } RemoteLinuxRunConfigurationPrivate(const RemoteLinuxRunConfigurationPrivate *other) : projectFilePath(other->projectFilePath), gdbPath(other->gdbPath), arguments(other->arguments), useAlternateRemoteExecutable(other->useAlternateRemoteExecutable), alternateRemoteExecutable(other->alternateRemoteExecutable), workingDirectory(other->workingDirectory) { } QString projectFilePath; QString gdbPath; QStringList arguments; QString disabledReason; bool useAlternateRemoteExecutable; QString alternateRemoteExecutable; QString workingDirectory; }; } // namespace Internal using namespace Internal; RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *parent, const Core::Id id, const QString &proFilePath) : AbstractRemoteLinuxRunConfiguration(parent, id), d(new RemoteLinuxRunConfigurationPrivate(proFilePath)) { init(); } RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, RemoteLinuxRunConfiguration *source) : AbstractRemoteLinuxRunConfiguration(parent, source), d(new RemoteLinuxRunConfigurationPrivate(source->d)) { init(); } RemoteLinuxRunConfiguration::~RemoteLinuxRunConfiguration() { delete d; } void RemoteLinuxRunConfiguration::init() { setDefaultDisplayName(defaultDisplayName()); addExtraAspect(new RemoteLinuxEnvironmentAspect(this)); connect(target(), SIGNAL(deploymentDataChanged()), SLOT(handleBuildSystemDataUpdated())); connect(target(), SIGNAL(applicationTargetsChanged()), SLOT(handleBuildSystemDataUpdated())); connect(target(), SIGNAL(kitChanged()), this, SLOT(handleBuildSystemDataUpdated())); // Handles device changes, etc. } bool RemoteLinuxRunConfiguration::isEnabled() const { return true; } QString RemoteLinuxRunConfiguration::disabledReason() const { return d->disabledReason; } QWidget *RemoteLinuxRunConfiguration::createConfigurationWidget() { return new RemoteLinuxRunConfigurationWidget(this); } OutputFormatter *RemoteLinuxRunConfiguration::createOutputFormatter() const { return new QtSupport::QtOutputFormatter(target()->project()); } QVariantMap RemoteLinuxRunConfiguration::toMap() const { QVariantMap map(RunConfiguration::toMap()); map.insert(QLatin1String(ArgumentsKey), d->arguments); const QDir dir = QDir(target()->project()->projectDirectory()); map.insert(QLatin1String(ProFileKey), dir.relativeFilePath(d->projectFilePath)); map.insert(QLatin1String(UseAlternateExeKey), d->useAlternateRemoteExecutable); map.insert(QLatin1String(AlternateExeKey), d->alternateRemoteExecutable); map.insert(QLatin1String(WorkingDirectoryKey), d->workingDirectory); return map; } bool RemoteLinuxRunConfiguration::fromMap(const QVariantMap &map) { if (!RunConfiguration::fromMap(map)) return false; d->arguments = map.value(QLatin1String(ArgumentsKey)).toStringList(); const QDir dir = QDir(target()->project()->projectDirectory()); d->projectFilePath = QDir::cleanPath(dir.filePath(map.value(QLatin1String(ProFileKey)).toString())); d->useAlternateRemoteExecutable = map.value(QLatin1String(UseAlternateExeKey), false).toBool(); d->alternateRemoteExecutable = map.value(QLatin1String(AlternateExeKey)).toString(); d->workingDirectory = map.value(QLatin1String(WorkingDirectoryKey)).toString(); setDefaultDisplayName(defaultDisplayName()); return true; } QString RemoteLinuxRunConfiguration::defaultDisplayName() { if (!d->projectFilePath.isEmpty()) //: %1 is the name of a project which is being run on remote Linux return tr("%1 (on Remote Device)").arg(QFileInfo(d->projectFilePath).completeBaseName()); //: Remote Linux run configuration default display name return tr("Run on Remote Device"); } QStringList RemoteLinuxRunConfiguration::arguments() const { return d->arguments; } Environment RemoteLinuxRunConfiguration::environment() const { RemoteLinuxEnvironmentAspect *aspect = extraAspect(); QTC_ASSERT(aspect, return Environment()); Environment env(OsTypeLinux); env.modify(aspect->userEnvironmentChanges()); const QString displayKey = QLatin1String("DISPLAY"); if (!env.hasKey(displayKey)) env.appendOrSet(displayKey, QLatin1String(":0.0")); return env; } QString RemoteLinuxRunConfiguration::localExecutableFilePath() const { return target()->applicationTargets() .targetForProject(Utils::FileName::fromString(d->projectFilePath)).toString(); } QString RemoteLinuxRunConfiguration::defaultRemoteExecutableFilePath() const { return target()->deploymentData().deployableForLocalFile(localExecutableFilePath()) .remoteFilePath(); } QString RemoteLinuxRunConfiguration::remoteExecutableFilePath() const { return d->useAlternateRemoteExecutable ? alternateRemoteExecutable() : defaultRemoteExecutableFilePath(); } void RemoteLinuxRunConfiguration::setArguments(const QString &args) { d->arguments = QtcProcess::splitArgs(args); // TODO: Widget should be list-based. } QString RemoteLinuxRunConfiguration::workingDirectory() const { return d->workingDirectory; } void RemoteLinuxRunConfiguration::setWorkingDirectory(const QString &wd) { d->workingDirectory = wd; } void RemoteLinuxRunConfiguration::setUseAlternateExecutable(bool useAlternate) { d->useAlternateRemoteExecutable = useAlternate; } bool RemoteLinuxRunConfiguration::useAlternateExecutable() const { return d->useAlternateRemoteExecutable; } void RemoteLinuxRunConfiguration::setAlternateRemoteExecutable(const QString &exe) { d->alternateRemoteExecutable = exe; } QString RemoteLinuxRunConfiguration::alternateRemoteExecutable() const { return d->alternateRemoteExecutable; } int RemoteLinuxRunConfiguration::portsUsedByDebuggers() const { int ports = 0; Debugger::DebuggerRunConfigurationAspect *aspect = extraAspect(); if (aspect->useQmlDebugger()) ++ports; if (aspect->useCppDebugger()) ++ports; return ports; } void RemoteLinuxRunConfiguration::handleBuildSystemDataUpdated() { emit deploySpecsChanged(); emit targetInformationChanged(); updateEnabledState(); } QString RemoteLinuxRunConfiguration::projectFilePath() const { return d->projectFilePath; } void RemoteLinuxRunConfiguration::setDisabledReason(const QString &reason) const { d->disabledReason = reason; } const char *RemoteLinuxRunConfiguration::IdPrefix = "RemoteLinuxRunConfiguration:"; } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxpackageinstaller.h0000644000015301777760000000631012321547255033242 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXPACKAGEINSTALLER_H #define REMOTELINUXPACKAGEINSTALLER_H #include "remotelinux_export.h" #include namespace RemoteLinux { namespace Internal { class AbstractRemoteLinuxPackageInstallerPrivate; } // namespace Internal class REMOTELINUX_EXPORT AbstractRemoteLinuxPackageInstaller : public QObject { Q_OBJECT Q_DISABLE_COPY(AbstractRemoteLinuxPackageInstaller) public: ~AbstractRemoteLinuxPackageInstaller(); void installPackage(const ProjectExplorer::IDevice::ConstPtr &deviceConfig, const QString &packageFilePath, bool removePackageFile); void cancelInstallation(); signals: void stdoutData(const QString &output); void stderrData(const QString &output); void finished(const QString &errorMsg = QString()); protected: explicit AbstractRemoteLinuxPackageInstaller(QObject *parent = 0); private slots: void handleConnectionError(); void handleInstallationFinished(int exitStatus); void handleInstallerOutput(); void handleInstallerErrorOutput(); private: virtual QString installCommandLine(const QString &packageFilePath) const = 0; virtual QString cancelInstallationCommandLine() const = 0; virtual void prepareInstallation() {} virtual QString errorString() const { return QString(); } void setFinished(); Internal::AbstractRemoteLinuxPackageInstallerPrivate * const d; }; class REMOTELINUX_EXPORT RemoteLinuxTarPackageInstaller : public AbstractRemoteLinuxPackageInstaller { Q_OBJECT public: RemoteLinuxTarPackageInstaller(QObject *parent = 0); private: QString installCommandLine(const QString &packageFilePath) const; QString cancelInstallationCommandLine() const; }; } // namespace RemoteLinux #endif // REMOTELINUXPACKAGEINSTALLER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/linuxdevice.cpp0000644000015301777760000002100012321547255030300 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "linuxdevice.h" #include "genericlinuxdeviceconfigurationwidget.h" #include "linuxdeviceprocess.h" #include "linuxdevicetester.h" #include "publickeydeploymentdialog.h" #include "remotelinux_constants.h" #include "remotelinuxsignaloperation.h" #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { const char Delimiter0[] = "x--"; const char Delimiter1[] = "---"; static QString visualizeNull(QString s) { return s.replace(QLatin1Char('\0'), QLatin1String("")); } class LinuxDeviceProcessList : public SshDeviceProcessList { public: LinuxDeviceProcessList(const IDevice::ConstPtr &device, QObject *parent) : SshDeviceProcessList(device, parent) { } private: QString listProcessesCommandLine() const { return QString::fromLatin1( "for dir in `ls -d /proc/[0123456789]*`; do " "test -d $dir || continue;" // Decrease the likelihood of a race condition. "echo $dir;" "cat $dir/cmdline;echo;" // cmdline does not end in newline "cat $dir/stat;" "readlink $dir/exe;" "printf '%1''%2';" "done").arg(QLatin1String(Delimiter0)).arg(QLatin1String(Delimiter1)); } QList buildProcessList(const QString &listProcessesReply) const { QList processes; const QStringList lines = listProcessesReply.split(QString::fromLatin1(Delimiter0) + QString::fromLatin1(Delimiter1), QString::SkipEmptyParts); foreach (const QString &line, lines) { const QStringList elements = line.split(QLatin1Char('\n')); if (elements.count() < 4) { qDebug("%s: Expected four list elements, got %d. Line was '%s'.", Q_FUNC_INFO, elements.count(), qPrintable(visualizeNull(line))); continue; } bool ok; const int pid = elements.first().mid(6).toInt(&ok); if (!ok) { qDebug("%s: Expected number in %s. Line was '%s'.", Q_FUNC_INFO, qPrintable(elements.first()), qPrintable(visualizeNull(line))); continue; } QString command = elements.at(1); command.replace(QLatin1Char('\0'), QLatin1Char(' ')); if (command.isEmpty()) { const QString &statString = elements.at(2); const int openParenPos = statString.indexOf(QLatin1Char('(')); const int closedParenPos = statString.indexOf(QLatin1Char(')'), openParenPos); if (openParenPos == -1 || closedParenPos == -1) continue; command = QLatin1Char('[') + statString.mid(openParenPos + 1, closedParenPos - openParenPos - 1) + QLatin1Char(']'); } DeviceProcessItem process; process.pid = pid; process.cmdLine = command; process.exe = elements.at(3); processes.append(process); } qSort(processes); return processes; } }; class LinuxPortsGatheringMethod : public ProjectExplorer::PortsGatheringMethod { QByteArray commandLine(QAbstractSocket::NetworkLayerProtocol protocol) const { QString procFilePath; int addressLength; if (protocol == QAbstractSocket::IPv4Protocol) { procFilePath = QLatin1String("/proc/net/tcp"); addressLength = 8; } else { procFilePath = QLatin1String("/proc/net/tcp6"); addressLength = 32; } return QString::fromLatin1("sed " "'s/.*: [[:xdigit:]]\\{%1\\}:\\([[:xdigit:]]\\{4\\}\\).*/\\1/g' %2") .arg(addressLength).arg(procFilePath).toUtf8(); } QList usedPorts(const QByteArray &output) const { QList ports; QList portStrings = output.split('\n'); portStrings.removeFirst(); foreach (const QByteArray &portString, portStrings) { if (portString.isEmpty()) continue; bool ok; const int port = portString.toInt(&ok, 16); if (ok) { if (!ports.contains(port)) ports << port; } else { qWarning("%s: Unexpected string '%s' is not a port.", Q_FUNC_INFO, portString.data()); } } return ports; } }; LinuxDevice::Ptr LinuxDevice::create(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id) { return Ptr(new LinuxDevice(name, type, machineType, origin, id)); } QString LinuxDevice::displayType() const { return tr("Generic Linux"); } ProjectExplorer::IDeviceWidget *LinuxDevice::createWidget() { return new GenericLinuxDeviceConfigurationWidget(sharedFromThis()); } QList LinuxDevice::actionIds() const { return QList() << Core::Id(Constants::GenericDeployKeyToDeviceActionId); } QString LinuxDevice::displayNameForActionId(Core::Id actionId) const { QTC_ASSERT(actionIds().contains(actionId), return QString()); if (actionId == Constants::GenericDeployKeyToDeviceActionId) return tr("Deploy Public Key..."); return QString(); // Can't happen. } void LinuxDevice::executeAction(Core::Id actionId, QWidget *parent) { QTC_ASSERT(actionIds().contains(actionId), return); QDialog *d = 0; const LinuxDevice::ConstPtr device = sharedFromThis().staticCast(); if (actionId == Constants::GenericDeployKeyToDeviceActionId) d = PublicKeyDeploymentDialog::createDialog(device, parent); if (d) d->exec(); delete d; } LinuxDevice::LinuxDevice(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id) : IDevice(type, origin, machineType, id) { setDisplayName(name); } LinuxDevice::LinuxDevice(const LinuxDevice &other) : IDevice(other) { } LinuxDevice::Ptr LinuxDevice::create() { return Ptr(new LinuxDevice); } ProjectExplorer::IDevice::Ptr LinuxDevice::clone() const { return Ptr(new LinuxDevice(*this)); } DeviceProcess *LinuxDevice::createProcess(QObject *parent) const { return new LinuxDeviceProcess(sharedFromThis(), parent); } bool LinuxDevice::canAutoDetectPorts() const { return true; } PortsGatheringMethod::Ptr LinuxDevice::portsGatheringMethod() const { return LinuxPortsGatheringMethod::Ptr(new LinuxPortsGatheringMethod); } DeviceProcessList *LinuxDevice::createProcessListModel(QObject *parent) const { return new LinuxDeviceProcessList(sharedFromThis(), parent); } DeviceTester *LinuxDevice::createDeviceTester() const { return new GenericLinuxDeviceTester; } DeviceProcessSignalOperation::Ptr LinuxDevice::signalOperation() const { return DeviceProcessSignalOperation::Ptr(new RemoteLinuxSignalOperation(sshParameters())); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/uploadandinstalltarpackagestep.h0000644000015301777760000000552012321547255033714 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef UPLOADANDINSTALLTARPACKAGESTEP_H #define UPLOADANDINSTALLTARPACKAGESTEP_H #include "abstractuploadandinstallpackageservice.h" #include "abstractremotelinuxdeploystep.h" namespace RemoteLinux { class AbstractRemoteLinuxPackageInstaller; namespace Internal { class UploadAndInstallTarPackageServicePrivate; } class REMOTELINUX_EXPORT UploadAndInstallTarPackageService : public AbstractUploadAndInstallPackageService { Q_OBJECT public: explicit UploadAndInstallTarPackageService(QObject *parent); ~UploadAndInstallTarPackageService(); private: AbstractRemoteLinuxPackageInstaller *packageInstaller() const; Internal::UploadAndInstallTarPackageServicePrivate *d; }; class REMOTELINUX_EXPORT UploadAndInstallTarPackageStep : public AbstractRemoteLinuxDeployStep { Q_OBJECT public: explicit UploadAndInstallTarPackageStep(ProjectExplorer::BuildStepList *bsl); UploadAndInstallTarPackageStep(ProjectExplorer::BuildStepList *bsl, UploadAndInstallTarPackageStep *other); bool initInternal(QString *error = 0); ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); static Core::Id stepId(); static QString displayName(); private: AbstractRemoteLinuxDeployService *deployService() const { return m_deployService; } void ctor(); UploadAndInstallTarPackageService *m_deployService; }; } //namespace RemoteLinux #endif // UPLOADANDINSTALLTARPACKAGESTEP_H ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxdeploystep.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractremotelinuxdeploystep.cp0000644000015301777760000001270712321547255034027 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "abstractremotelinuxdeploystep.h" #include "abstractremotelinuxdeployservice.h" #include "remotelinuxdeployconfiguration.h" #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { class AbstractRemoteLinuxDeployStepPrivate { public: bool hasError; QFutureInterface future; }; } // namespace Internal AbstractRemoteLinuxDeployStep::AbstractRemoteLinuxDeployStep(BuildStepList *bsl, const Core::Id id) : BuildStep(bsl, id), d(new Internal::AbstractRemoteLinuxDeployStepPrivate) { } AbstractRemoteLinuxDeployStep::AbstractRemoteLinuxDeployStep(BuildStepList *bsl, AbstractRemoteLinuxDeployStep *other) : BuildStep(bsl, other), d(new Internal::AbstractRemoteLinuxDeployStepPrivate) { } AbstractRemoteLinuxDeployStep::~AbstractRemoteLinuxDeployStep() { delete d; } bool AbstractRemoteLinuxDeployStep::fromMap(const QVariantMap &map) { if (!BuildStep::fromMap(map)) return false; deployService()->importDeployTimes(map); return true; } QVariantMap AbstractRemoteLinuxDeployStep::toMap() const { return BuildStep::toMap().unite(deployService()->exportDeployTimes()); } bool AbstractRemoteLinuxDeployStep::init() { QString error; deployService()->setTarget(target()); const bool canDeploy = initInternal(&error); if (!canDeploy) emit addOutput(tr("Cannot deploy: %1").arg(error), ErrorMessageOutput); return canDeploy; } void AbstractRemoteLinuxDeployStep::run(QFutureInterface &fi) { connect(deployService(), SIGNAL(errorMessage(QString)), SLOT(handleErrorMessage(QString))); connect(deployService(), SIGNAL(progressMessage(QString)), SLOT(handleProgressMessage(QString))); connect(deployService(), SIGNAL(warningMessage(QString)), SLOT(handleWarningMessage(QString))); connect(deployService(), SIGNAL(stdOutData(QString)), SLOT(handleStdOutData(QString))); connect(deployService(), SIGNAL(stdErrData(QString)), SLOT(handleStdErrData(QString))); connect(deployService(), SIGNAL(finished()), SLOT(handleFinished())); d->hasError = false; d->future = fi; deployService()->start(); } void AbstractRemoteLinuxDeployStep::cancel() { if (d->hasError) return; emit addOutput(tr("User requests deployment to stop; cleaning up."), MessageOutput); d->hasError = true; deployService()->stop(); } BuildStepConfigWidget *AbstractRemoteLinuxDeployStep::createConfigWidget() { return new SimpleBuildStepConfigWidget(this); } RemoteLinuxDeployConfiguration *AbstractRemoteLinuxDeployStep::deployConfiguration() const { return qobject_cast(BuildStep::deployConfiguration()); } void AbstractRemoteLinuxDeployStep::handleProgressMessage(const QString &message) { emit addOutput(message, MessageOutput); } void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message) { emit addOutput(message, ErrorMessageOutput); emit addTask(Task(Task::Error, message, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT)); d->hasError = true; } void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message) { emit addOutput(message, ErrorMessageOutput); emit addTask(Task(Task::Warning, message, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT)); } void AbstractRemoteLinuxDeployStep::handleFinished() { if (d->hasError) emit addOutput(tr("Deploy step failed."), ErrorMessageOutput); else emit addOutput(tr("Deploy step finished."), MessageOutput); disconnect(deployService(), 0, this, 0); d->future.reportResult(!d->hasError); emit finished(); } void AbstractRemoteLinuxDeployStep::handleStdOutData(const QString &data) { emit addOutput(data, NormalOutput, DontAppendNewline); } void AbstractRemoteLinuxDeployStep::handleStdErrData(const QString &data) { emit addOutput(data, ErrorOutput, DontAppendNewline); } } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeploymentstep.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcustomcommanddeployme0000644000015301777760000001406012321547255034114 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxcustomcommanddeploymentstep.h" #include #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { namespace { const char CommandLineKey[] = "RemoteLinuxCustomCommandDeploymentStep.CommandLine"; class ConfigWidget : public SimpleBuildStepConfigWidget { Q_OBJECT public: ConfigWidget(AbstractRemoteLinuxCustomCommandDeploymentStep *step) : SimpleBuildStepConfigWidget(step) { QVBoxLayout * const mainLayout = new QVBoxLayout(this); mainLayout->setMargin(0); QHBoxLayout * const commandLineLayout = new QHBoxLayout; mainLayout->addLayout(commandLineLayout); QLabel * const commandLineLabel = new QLabel(tr("Command line:")); commandLineLayout->addWidget(commandLineLabel); m_commandLineEdit.setText(step->commandLine()); commandLineLayout->addWidget(&m_commandLineEdit); connect(&m_commandLineEdit, SIGNAL(textEdited(QString)), SLOT(handleCommandLineEdited())); } bool showWidget() const { return true; } private: Q_SLOT void handleCommandLineEdited() { AbstractRemoteLinuxCustomCommandDeploymentStep *step = qobject_cast(this->step()); step->setCommandLine(m_commandLineEdit.text().trimmed()); } QLineEdit m_commandLineEdit; }; } // anonymous namespace class AbstractRemoteLinuxCustomCommandDeploymentStepPrivate { public: QString commandLine; }; class GenericRemoteLinuxCustomCommandDeploymentStepPrivate { public: RemoteLinuxCustomCommandDeployService service; }; } // namespace Internal using namespace Internal; AbstractRemoteLinuxCustomCommandDeploymentStep::AbstractRemoteLinuxCustomCommandDeploymentStep(BuildStepList *bsl, const Core::Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { ctor(); } AbstractRemoteLinuxCustomCommandDeploymentStep::AbstractRemoteLinuxCustomCommandDeploymentStep(BuildStepList *bsl, AbstractRemoteLinuxCustomCommandDeploymentStep *other) : AbstractRemoteLinuxDeployStep(bsl, other) { ctor(); } AbstractRemoteLinuxCustomCommandDeploymentStep::~AbstractRemoteLinuxCustomCommandDeploymentStep() { delete d; } void AbstractRemoteLinuxCustomCommandDeploymentStep::ctor() { d = new AbstractRemoteLinuxCustomCommandDeploymentStepPrivate; } bool AbstractRemoteLinuxCustomCommandDeploymentStep::fromMap(const QVariantMap &map) { if (!AbstractRemoteLinuxDeployStep::fromMap(map)) return false; d->commandLine = map.value(QLatin1String(CommandLineKey)).toString(); return true; } QVariantMap AbstractRemoteLinuxCustomCommandDeploymentStep::toMap() const { QVariantMap map = AbstractRemoteLinuxDeployStep::toMap(); map.insert(QLatin1String(CommandLineKey), d->commandLine); return map; } void AbstractRemoteLinuxCustomCommandDeploymentStep::setCommandLine(const QString &commandLine) { d->commandLine = commandLine; } QString AbstractRemoteLinuxCustomCommandDeploymentStep::commandLine() const { return d->commandLine; } bool AbstractRemoteLinuxCustomCommandDeploymentStep::initInternal(QString *error) { deployService()->setCommandLine(d->commandLine); return deployService()->isDeploymentPossible(error); } BuildStepConfigWidget *AbstractRemoteLinuxCustomCommandDeploymentStep::createConfigWidget() { return new ConfigWidget(this); } GenericRemoteLinuxCustomCommandDeploymentStep::GenericRemoteLinuxCustomCommandDeploymentStep(BuildStepList *bsl) : AbstractRemoteLinuxCustomCommandDeploymentStep(bsl, stepId()) { ctor(); } GenericRemoteLinuxCustomCommandDeploymentStep::GenericRemoteLinuxCustomCommandDeploymentStep(BuildStepList *bsl, GenericRemoteLinuxCustomCommandDeploymentStep *other) : AbstractRemoteLinuxCustomCommandDeploymentStep(bsl, other) { ctor(); } GenericRemoteLinuxCustomCommandDeploymentStep::~GenericRemoteLinuxCustomCommandDeploymentStep() { delete d; } void GenericRemoteLinuxCustomCommandDeploymentStep::ctor() { d = new GenericRemoteLinuxCustomCommandDeploymentStepPrivate; setDefaultDisplayName(stepDisplayName()); } RemoteLinuxCustomCommandDeployService *GenericRemoteLinuxCustomCommandDeploymentStep::deployService() const { return &d->service; } Core::Id GenericRemoteLinuxCustomCommandDeploymentStep::stepId() { return "RemoteLinux.GenericRemoteLinuxCustomCommandDeploymentStep"; } QString GenericRemoteLinuxCustomCommandDeploymentStep::stepDisplayName() { return tr("Run custom remote command"); } } // namespace RemoteLinux #include "remotelinuxcustomcommanddeploymentstep.moc" qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/sshkeydeployer.h0000644000015301777760000000443612321547255030516 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef SSHKEYDEPLOYER_H #define SSHKEYDEPLOYER_H #include "remotelinux_export.h" #include namespace QSsh { class SshConnectionParameters; } namespace RemoteLinux { namespace Internal { class SshKeyDeployerPrivate; } class REMOTELINUX_EXPORT SshKeyDeployer : public QObject { Q_OBJECT Q_DISABLE_COPY(SshKeyDeployer) public: explicit SshKeyDeployer(QObject *parent = 0); ~SshKeyDeployer(); void deployPublicKey(const QSsh::SshConnectionParameters &sshParams, const QString &keyFilePath); void stopDeployment(); signals: void error(const QString &errorMsg); void finishedSuccessfully(); private slots: void handleConnectionFailure(); void handleKeyUploadFinished(int exitStatus); private: void cleanup(); Internal::SshKeyDeployerPrivate * const d; }; } // namespace RemoteLinux #endif // SSHKEYDEPLOYER_H ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationfactory.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationf0000644000015301777760000000427612321547255034032 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef GENERICLINUXDEVICECONFIGURATIONFACTORY_H #define GENERICLINUXDEVICECONFIGURATIONFACTORY_H #include "remotelinux_export.h" #include namespace RemoteLinux { class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationFactory : public ProjectExplorer::IDeviceFactory { Q_OBJECT public: GenericLinuxDeviceConfigurationFactory(QObject *parent = 0); QString displayNameForId(Core::Id type) const; QList availableCreationIds() const; ProjectExplorer::IDevice::Ptr create(Core::Id id) const; bool canRestore(const QVariantMap &map) const; ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const; }; } // namespace RemoteLinux #endif // GENERICLINUXDEVICECONFIGURATIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxenvironmentaspect.h0000644000015301777760000000527512321547255033506 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef REMOTELINUXENVIRONMENTASPECT_H #define REMOTELINUXENVIRONMENTASPECT_H #include "abstractremotelinuxrunconfiguration.h" #include "remotelinux_export.h" #include namespace RemoteLinux { class RemoteLinuxEnvironmentAspectWidget; class AbstractRemoteLinuxRunConfiguration; class REMOTELINUX_EXPORT RemoteLinuxEnvironmentAspect : public ProjectExplorer::EnvironmentAspect { Q_OBJECT public: RemoteLinuxEnvironmentAspect(ProjectExplorer::RunConfiguration *rc); RemoteLinuxEnvironmentAspect *create(ProjectExplorer::RunConfiguration *parent) const; ProjectExplorer::RunConfigWidget *createConfigurationWidget(); QList possibleBaseEnvironments() const; QString baseEnvironmentDisplayName(int base) const; Utils::Environment baseEnvironment() const; AbstractRemoteLinuxRunConfiguration *runConfiguration() const; Utils::Environment remoteEnvironment() const; void setRemoteEnvironment(const Utils::Environment &env); QString userEnvironmentChangesAsString() const; private: enum BaseEnvironmentBase { CleanBaseEnvironment = 0, RemoteBaseEnvironment = 1 }; Utils::Environment m_remoteEnvironment; }; } // namespace RemoteLinux #endif // REMOTELINUXENVIRONMENTASPECT_H ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationwizard.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/genericlinuxdeviceconfigurationw0000644000015301777760000000424212321547255034044 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef GENERICLINUXDEVICECONFIGURATIONWIZARD_H #define GENERICLINUXDEVICECONFIGURATIONWIZARD_H #include "remotelinux_export.h" #include #include namespace RemoteLinux { namespace Internal { class GenericLinuxDeviceConfigurationWizardPrivate; } // namespace Internal class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizard : public Utils::Wizard { Q_OBJECT public: GenericLinuxDeviceConfigurationWizard(QWidget *parent = 0); ~GenericLinuxDeviceConfigurationWizard(); ProjectExplorer::IDevice::Ptr device(); private: Internal::GenericLinuxDeviceConfigurationWizardPrivate * const d; }; } // namespace RemoteLinux #endif // GENERICLINUXDEVICECONFIGURATIONWIZARD_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/linuxdevicetester.h0000644000015301777760000000513712321547255031211 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef LINUXDEVICETESTER_H #define LINUXDEVICETESTER_H #include "remotelinux_export.h" #include namespace ProjectExplorer { class DeviceUsedPortsGatherer; } namespace QSsh { class SshConnection; } namespace ProjectExplorer { class DeviceUsedPortsGatherer; } namespace RemoteLinux { namespace Internal { class GenericLinuxDeviceTesterPrivate; } class REMOTELINUX_EXPORT GenericLinuxDeviceTester : public ProjectExplorer::DeviceTester { Q_OBJECT public: explicit GenericLinuxDeviceTester(QObject *parent = 0); ~GenericLinuxDeviceTester(); void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration); void stopTest(); ProjectExplorer::DeviceUsedPortsGatherer *usedPortsGatherer() const; private slots: void handleConnected(); void handleConnectionFailure(); void handleProcessFinished(int exitStatus); void handlePortsGatheringError(const QString &message); void handlePortListReady(); private: void setFinished(ProjectExplorer::DeviceTester::TestResult result); Internal::GenericLinuxDeviceTesterPrivate * const d; }; } // namespace RemoteLinux #endif // LINUXDEVICETESTER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/packageuploader.cpp0000644000015301777760000001137212321547255031123 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "packageuploader.h" #include #include #include using namespace QSsh; namespace RemoteLinux { namespace Internal { PackageUploader::PackageUploader(QObject *parent) : QObject(parent), m_state(Inactive), m_connection(0) { } PackageUploader::~PackageUploader() { } void PackageUploader::uploadPackage(SshConnection *connection, const QString &localFilePath, const QString &remoteFilePath) { QTC_ASSERT(m_state == Inactive, return); setState(InitializingSftp); emit progress(tr("Preparing SFTP connection...")); m_localFilePath = localFilePath; m_remoteFilePath = remoteFilePath; m_connection = connection; connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionFailure())); m_uploader = m_connection->createSftpChannel(); connect(m_uploader.data(), SIGNAL(initialized()), this, SLOT(handleSftpChannelInitialized())); connect(m_uploader.data(), SIGNAL(initializationFailed(QString)), this, SLOT(handleSftpChannelInitializationFailed(QString))); connect(m_uploader.data(), SIGNAL(finished(QSsh::SftpJobId,QString)), this, SLOT(handleSftpJobFinished(QSsh::SftpJobId,QString))); m_uploader->initialize(); } void PackageUploader::cancelUpload() { QTC_ASSERT(m_state == InitializingSftp || m_state == Uploading, return); cleanup(); } void PackageUploader::handleConnectionFailure() { if (m_state == Inactive) return; const QString errorMsg = m_connection->errorString(); setState(Inactive); emit uploadFinished(tr("Connection failed: %1").arg(errorMsg)); } void PackageUploader::handleSftpChannelInitializationFailed(const QString &errorMsg) { QTC_ASSERT(m_state == InitializingSftp || m_state == Inactive, return); if (m_state == Inactive) return; setState(Inactive); emit uploadFinished(tr("SFTP error: %1").arg(errorMsg)); } void PackageUploader::handleSftpChannelInitialized() { QTC_ASSERT(m_state == InitializingSftp || m_state == Inactive, return); if (m_state == Inactive) return; const SftpJobId job = m_uploader->uploadFile(m_localFilePath, m_remoteFilePath, SftpOverwriteExisting); if (job == SftpInvalidJob) { setState(Inactive); emit uploadFinished(tr("Package upload failed: Could not open file.")); } else { emit progress(tr("Starting upload...")); setState(Uploading); } } void PackageUploader::handleSftpJobFinished(SftpJobId, const QString &errorMsg) { QTC_ASSERT(m_state == Uploading || m_state == Inactive, return); if (m_state == Inactive) return; if (!errorMsg.isEmpty()) emit uploadFinished(tr("Failed to upload package: %2").arg(errorMsg)); else emit uploadFinished(); cleanup(); } void PackageUploader::cleanup() { m_uploader->closeChannel(); setState(Inactive); } void PackageUploader::setState(State newState) { if (m_state == newState) return; if (newState == Inactive) { if (m_uploader) { disconnect(m_uploader.data(), 0, this, 0); m_uploader.clear(); } if (m_connection) { disconnect(m_connection, 0, this, 0); m_connection = 0; } } m_state = newState; } } // namespace Internal } // namespace RemoteLinux ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspacestep.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/remotelinuxcheckforfreediskspace0000644000015301777760000001431412321547255034023 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "remotelinuxcheckforfreediskspacestep.h" #include "ui_remotelinuxcheckforfreediskspacestepwidget.h" #include "remotelinuxcheckforfreediskspaceservice.h" #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { namespace { class RemoteLinuxCheckForFreeDiskSpaceStepWidget : public BuildStepConfigWidget { Q_OBJECT public: explicit RemoteLinuxCheckForFreeDiskSpaceStepWidget(RemoteLinuxCheckForFreeDiskSpaceStep &step) : m_step(step) { m_ui.setupUi(this); m_ui.requiredSpaceSpinBox->setSuffix(tr("MB")); m_ui.requiredSpaceSpinBox->setMinimum(1); m_ui.requiredSpaceSpinBox->setMaximum(std::numeric_limits::max()); m_ui.pathLineEdit->setText(m_step.pathToCheck()); m_ui.requiredSpaceSpinBox->setValue(m_step.requiredSpaceInBytes()/multiplier); connect(m_ui.pathLineEdit, SIGNAL(textChanged(QString)), SLOT(handlePathChanged())); connect(m_ui.requiredSpaceSpinBox, SIGNAL(valueChanged(int)), SLOT(handleRequiredSpaceChanged())); } private: Q_SLOT void handlePathChanged() { m_step.setPathToCheck(m_ui.pathLineEdit->text().trimmed()); } Q_SLOT void handleRequiredSpaceChanged() { m_step.setRequiredSpaceInBytes(quint64(m_ui.requiredSpaceSpinBox->value())*multiplier); } QString displayName() const { return QLatin1String("") + m_step.displayName() + QLatin1String(""); } QString summaryText() const { return displayName(); } static const int multiplier = 1024*1024; Ui::RemoteLinuxCheckForFreeDiskSpaceStepWidget m_ui; RemoteLinuxCheckForFreeDiskSpaceStep &m_step; }; } // anonymous namespace const char PathToCheckKey[] = "RemoteLinux.CheckForFreeDiskSpaceStep.PathToCheck"; const char RequiredSpaceKey[] = "RemoteLinux.CheckForFreeDiskSpaceStep.RequiredSpace"; class RemoteLinuxCheckForFreeDiskSpaceStepPrivate { public: RemoteLinuxCheckForFreeDiskSpaceService deployService; QString pathToCheck; quint64 requiredSpaceInBytes; }; } // namespace Internal RemoteLinuxCheckForFreeDiskSpaceStep::RemoteLinuxCheckForFreeDiskSpaceStep(BuildStepList *bsl, Core::Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { ctor(); setPathToCheck(QLatin1String("/")); setRequiredSpaceInBytes(5*1024*1024); } RemoteLinuxCheckForFreeDiskSpaceStep::RemoteLinuxCheckForFreeDiskSpaceStep(BuildStepList *bsl, RemoteLinuxCheckForFreeDiskSpaceStep *other) : AbstractRemoteLinuxDeployStep(bsl, other) { ctor(); setPathToCheck(other->pathToCheck()); setRequiredSpaceInBytes(other->requiredSpaceInBytes()); } RemoteLinuxCheckForFreeDiskSpaceStep::~RemoteLinuxCheckForFreeDiskSpaceStep() { delete d; } void RemoteLinuxCheckForFreeDiskSpaceStep::ctor() { d = new Internal::RemoteLinuxCheckForFreeDiskSpaceStepPrivate; setDefaultDisplayName(stepDisplayName()); } void RemoteLinuxCheckForFreeDiskSpaceStep::setPathToCheck(const QString &path) { d->pathToCheck = path; } QString RemoteLinuxCheckForFreeDiskSpaceStep::pathToCheck() const { return d->pathToCheck; } void RemoteLinuxCheckForFreeDiskSpaceStep::setRequiredSpaceInBytes(quint64 space) { d->requiredSpaceInBytes = space; } quint64 RemoteLinuxCheckForFreeDiskSpaceStep::requiredSpaceInBytes() const { return d->requiredSpaceInBytes; } bool RemoteLinuxCheckForFreeDiskSpaceStep::fromMap(const QVariantMap &map) { if (!AbstractRemoteLinuxDeployStep::fromMap(map)) return false; d->pathToCheck = map.value(QLatin1String(Internal::PathToCheckKey)).toString(); d->requiredSpaceInBytes = map.value(QLatin1String(Internal::RequiredSpaceKey)).toULongLong(); return true; } QVariantMap RemoteLinuxCheckForFreeDiskSpaceStep::toMap() const { QVariantMap map = AbstractRemoteLinuxDeployStep::toMap(); map.insert(QLatin1String(Internal::PathToCheckKey), d->pathToCheck); map.insert(QLatin1String(Internal::RequiredSpaceKey), d->requiredSpaceInBytes); return map; } BuildStepConfigWidget *RemoteLinuxCheckForFreeDiskSpaceStep::createConfigWidget() { return new Internal::RemoteLinuxCheckForFreeDiskSpaceStepWidget(*this); } bool RemoteLinuxCheckForFreeDiskSpaceStep::initInternal(QString *error) { Q_UNUSED(error); d->deployService.setPathToCheck(d->pathToCheck); d->deployService.setRequiredSpaceInBytes(d->requiredSpaceInBytes); return true; } AbstractRemoteLinuxDeployService *RemoteLinuxCheckForFreeDiskSpaceStep::deployService() const { return &d->deployService; } Core::Id RemoteLinuxCheckForFreeDiskSpaceStep::stepId() { return "RemoteLinux.CheckForFreeDiskSpaceStep"; } QString RemoteLinuxCheckForFreeDiskSpaceStep::stepDisplayName() { return tr("Check for free disk space"); } } // namespace RemoteLinux #include "remotelinuxcheckforfreediskspacestep.moc" qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/embeddedlinuxqtversionfactory.h0000644000015301777760000000436512321547255033621 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef EMBEDDEDLINUXQTVERSIONFACTORY_H #define EMBEDDEDLINUXQTVERSIONFACTORY_H #include namespace RemoteLinux { namespace Internal { class EmbeddedLinuxQtVersionFactory : public QtSupport::QtVersionFactory { public: explicit EmbeddedLinuxQtVersionFactory(QObject *parent = 0); ~EmbeddedLinuxQtVersionFactory(); bool canRestore(const QString &type); QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data); int priority() const; QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); }; } // Internal } // RemoteLinux #endif // EMBEDDEDLINUXQTVERSIONFACTORY_H ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractuploadandinstallpackageservice.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/remotelinux/abstractuploadandinstallpackages0000644000015301777760000001334012321547255033771 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "abstractuploadandinstallpackageservice.h" #include "packageuploader.h" #include "remotelinuxpackageinstaller.h" #include #include #include #include using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { namespace { enum State { Inactive, Uploading, Installing }; } // anonymous namespace class AbstractUploadAndInstallPackageServicePrivate { public: AbstractUploadAndInstallPackageServicePrivate() : state(Inactive), uploader(new PackageUploader) { } ~AbstractUploadAndInstallPackageServicePrivate() { delete uploader; } State state; PackageUploader * const uploader; QString packageFilePath; }; } // namespace Internal using namespace Internal; AbstractUploadAndInstallPackageService::AbstractUploadAndInstallPackageService(QObject *parent) : AbstractRemoteLinuxDeployService(parent), d(new AbstractUploadAndInstallPackageServicePrivate) { } AbstractUploadAndInstallPackageService::~AbstractUploadAndInstallPackageService() { delete d; } void AbstractUploadAndInstallPackageService::setPackageFilePath(const QString &filePath) { d->packageFilePath = filePath; } QString AbstractUploadAndInstallPackageService::packageFilePath() const { return d->packageFilePath; } QString AbstractUploadAndInstallPackageService::uploadDir() const { return QLatin1String("/tmp"); } bool AbstractUploadAndInstallPackageService::isDeploymentNecessary() const { return hasChangedSinceLastDeployment(DeployableFile(packageFilePath(), QString())); } void AbstractUploadAndInstallPackageService::doDeviceSetup() { QTC_ASSERT(d->state == Inactive, return); handleDeviceSetupDone(true); } void AbstractUploadAndInstallPackageService::stopDeviceSetup() { QTC_ASSERT(d->state == Inactive, return); handleDeviceSetupDone(false); } void AbstractUploadAndInstallPackageService::doDeploy() { QTC_ASSERT(d->state == Inactive, return); d->state = Uploading; const QString fileName = QFileInfo(packageFilePath()).fileName(); const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName; connect(d->uploader, SIGNAL(progress(QString)), SIGNAL(progressMessage(QString))); connect(d->uploader, SIGNAL(uploadFinished(QString)), SLOT(handleUploadFinished(QString))); d->uploader->uploadPackage(connection(), packageFilePath(), remoteFilePath); } void AbstractUploadAndInstallPackageService::stopDeployment() { switch (d->state) { case Inactive: qWarning("%s: Unexpected state 'Inactive'.", Q_FUNC_INFO); break; case Uploading: d->uploader->cancelUpload(); setFinished(); break; case Installing: packageInstaller()->cancelInstallation(); setFinished(); break; } } void AbstractUploadAndInstallPackageService::handleUploadFinished(const QString &errorMsg) { QTC_ASSERT(d->state == Uploading, return); if (!errorMsg.isEmpty()) { emit errorMessage(errorMsg); setFinished(); return; } emit progressMessage(tr("Successfully uploaded package file.")); const QString remoteFilePath = uploadDir() + QLatin1Char('/') + QFileInfo(packageFilePath()).fileName(); d->state = Installing; emit progressMessage(tr("Installing package to device...")); connect(packageInstaller(), SIGNAL(stdoutData(QString)), SIGNAL(stdOutData(QString))); connect(packageInstaller(), SIGNAL(stderrData(QString)), SIGNAL(stdErrData(QString))); connect(packageInstaller(), SIGNAL(finished(QString)), SLOT(handleInstallationFinished(QString))); packageInstaller()->installPackage(deviceConfiguration(), remoteFilePath, true); } void AbstractUploadAndInstallPackageService::handleInstallationFinished(const QString &errorMsg) { QTC_ASSERT(d->state == Installing, return); if (errorMsg.isEmpty()) { saveDeploymentTimeStamp(DeployableFile(packageFilePath(), QString())); emit progressMessage(tr("Package installed.")); } else { emit errorMessage(errorMsg); } setFinished(); } void AbstractUploadAndInstallPackageService::setFinished() { d->state = Inactive; disconnect(d->uploader, 0, this, 0); disconnect(packageInstaller(), 0, this, 0); handleDeploymentDone(); } } // namespace RemoteLinux qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/0000755000015301777760000000000012321547742023520 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdevicetester.cpp0000644000015301777760000001353012321547255027442 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdevicetester.h" #include "qnxdeviceconfiguration.h" #include #include using namespace Qnx; using namespace Qnx::Internal; QnxDeviceTester::QnxDeviceTester(QObject *parent) : ProjectExplorer::DeviceTester(parent) , m_result(TestSuccess) , m_state(Inactive) , m_currentCommandIndex(-1) { m_genericTester = new RemoteLinux::GenericLinuxDeviceTester(this); connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString))); connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString))); connect(m_genericTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)), SLOT(handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult))); m_processRunner = new QSsh::SshRemoteProcessRunner(this); connect(m_processRunner, SIGNAL(connectionError()), SLOT(handleConnectionError())); connect(m_processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int))); m_commandsToTest << QLatin1String("awk") << QLatin1String("grep") << QLatin1String("kill") << QLatin1String("netstat") << QLatin1String("print") << QLatin1String("printf") << QLatin1String("ps") << QLatin1String("read") << QLatin1String("sed") << QLatin1String("sleep") << QLatin1String("uname"); } void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration) { QTC_ASSERT(m_state == Inactive, return); m_deviceConfiguration = deviceConfiguration; m_state = GenericTest; m_genericTester->testDevice(deviceConfiguration); } void QnxDeviceTester::stopTest() { QTC_ASSERT(m_state != Inactive, return); switch (m_state) { case Inactive: break; case GenericTest: m_genericTester->stopTest(); break; case CommandsTest: m_processRunner->cancel(); break; } m_result = TestFailure; setFinished(); } void QnxDeviceTester::handleGenericTestFinished(TestResult result) { QTC_ASSERT(m_state == GenericTest, return); if (result == TestFailure) { m_result = TestFailure; setFinished(); return; } m_state = CommandsTest; QnxDeviceConfiguration::ConstPtr qnxDevice = m_deviceConfiguration.dynamicCast(); m_commandsToTest.append(versionSpecificCommandsToTest(qnxDevice->qnxVersion())); testNextCommand(); } void QnxDeviceTester::handleProcessFinished(int exitStatus) { QTC_ASSERT(m_state == CommandsTest, return); const QString command = m_commandsToTest[m_currentCommandIndex]; if (exitStatus == QSsh::SshRemoteProcess::NormalExit) { if (m_processRunner->processExitCode() == 0) { emit progressMessage(tr("%1 found.").arg(command) + QLatin1Char('\n')); } else { emit errorMessage(tr("%1 not found.").arg(command) + QLatin1Char('\n')); m_result = TestFailure; } } else { emit errorMessage(tr("An error occurred checking for %1.").arg(command) + QLatin1Char('\n')); m_result = TestFailure; } testNextCommand(); } void QnxDeviceTester::handleConnectionError() { QTC_ASSERT(m_state == CommandsTest, return); m_result = TestFailure; emit errorMessage(tr("SSH connection error: %1").arg(m_processRunner->lastConnectionErrorString()) + QLatin1Char('\n')); setFinished(); } void QnxDeviceTester::testNextCommand() { ++m_currentCommandIndex; if (m_currentCommandIndex >= m_commandsToTest.size()) { setFinished(); return; } QString command = m_commandsToTest[m_currentCommandIndex]; emit progressMessage(tr("Checking for %1...").arg(command)); m_processRunner->run("command -v " + command.toLatin1(), m_deviceConfiguration->sshParameters()); } void QnxDeviceTester::setFinished() { m_state = Inactive; disconnect(m_genericTester, 0, this, 0); if (m_processRunner) disconnect(m_processRunner, 0, this, 0); emit finished(m_result); } QStringList QnxDeviceTester::versionSpecificCommandsToTest(int versionNumber) const { QStringList result; if (versionNumber > 0x060500) result << QLatin1String("slog2info"); return result; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryrunconfiguration.cpp0000644000015301777760000001162712321547255031667 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryrunconfiguration.h" #include "qnxconstants.h" #include "blackberrydeployconfiguration.h" #include "blackberryrunconfigurationwidget.h" #include "blackberrydeployinformation.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryRunConfiguration::BlackBerryRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &path) : ProjectExplorer::RunConfiguration(parent, id) , m_proFilePath(path) { init(); } BlackBerryRunConfiguration::BlackBerryRunConfiguration(ProjectExplorer::Target *parent, BlackBerryRunConfiguration *source) : ProjectExplorer::RunConfiguration(parent, source) , m_proFilePath(source->m_proFilePath) { init(); } void BlackBerryRunConfiguration::init() { updateDisplayName(); connect(deployConfiguration()->deploymentInfo(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(targetInformationChanged())); connect(deployConfiguration()->deploymentInfo(), SIGNAL(modelReset()), this, SIGNAL(targetInformationChanged())); } void BlackBerryRunConfiguration::updateDisplayName() { if (!m_proFilePath.isEmpty()) setDefaultDisplayName(QFileInfo(m_proFilePath).completeBaseName()); else setDefaultDisplayName(tr("Run on BlackBerry device")); } QWidget *BlackBerryRunConfiguration::createConfigurationWidget() { return new BlackBerryRunConfigurationWidget(this); } QString BlackBerryRunConfiguration::proFilePath() const { return m_proFilePath; } QString BlackBerryRunConfiguration::deviceName() const { BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit()); if (!device) return QString(); return device->displayName(); } QString BlackBerryRunConfiguration::barPackage() const { BlackBerryDeployConfiguration *dc = deployConfiguration(); if (!dc) return QString(); QList packages = dc->deploymentInfo()->enabledPackages(); foreach (const BarPackageDeployInformation package, packages) { if (package.proFilePath == proFilePath()) return package.packagePath(); } return QString(); } QString BlackBerryRunConfiguration::localExecutableFilePath() const { return target()->applicationTargets() .targetForProject(Utils::FileName::fromString(m_proFilePath)).toString(); } bool BlackBerryRunConfiguration::fromMap(const QVariantMap &map) { if (!ProjectExplorer::RunConfiguration::fromMap(map)) return false; m_proFilePath = map.value(QLatin1String(Constants::QNX_PROFILEPATH_KEY)).toString(); if (m_proFilePath.isEmpty() || !QFileInfo(m_proFilePath).exists()) return false; init(); return true; } QVariantMap BlackBerryRunConfiguration::toMap() const { QVariantMap map(ProjectExplorer::RunConfiguration::toMap()); map.insert(QLatin1String(Constants::QNX_PROFILEPATH_KEY), m_proFilePath); return map; } BlackBerryDeployConfiguration *BlackBerryRunConfiguration::deployConfiguration() const { return qobject_cast(target()->activeDeployConfiguration()); } QString BlackBerryRunConfiguration::key() const { return barPackage() + QLatin1Char('_') + BlackBerryDeviceConfiguration::device(target()->kit())->sshParameters().host; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryndksettingspage.cpp0000644000015301777760000000531012321547255031455 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryndksettingspage.h" #include "blackberryndksettingswidget.h" #include "blackberryconfiguration.h" #include "qnxconstants.h" #include #include namespace Qnx { namespace Internal { BlackBerryNDKSettingsPage::BlackBerryNDKSettingsPage(QObject *parent) : Core::IOptionsPage(parent) { setId(Core::Id(Constants::QNX_BB_NDK_SETTINGS_ID)); setDisplayName(tr("NDK")); setCategory(Constants::QNX_BB_CATEGORY); setDisplayCategory(QCoreApplication::translate("BlackBerry", Constants::QNX_BB_CATEGORY_TR)); setCategoryIcon(QLatin1String(Constants::QNX_BB_CATEGORY_ICON)); } QWidget *BlackBerryNDKSettingsPage::createPage(QWidget *parent) { m_widget = new BlackBerryNDKSettingsWidget(parent); return m_widget; } void BlackBerryNDKSettingsPage::apply() { foreach (BlackBerryConfiguration* config, m_widget->activatedTargets()) { if (!config->isActive()) config->activate(); } foreach (BlackBerryConfiguration* config, m_widget->deactivatedTargets()) { if (config->isActive()) config->deactivate(); } } void BlackBerryNDKSettingsPage::finish() { } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/pathchooserdelegate.h0000644000015301777760000000513412321547255027705 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_PATHCHOOSERDELEGATE_H #define QNX_INTERNAL_PATHCHOOSERDELEGATE_H #include #include namespace Qnx { namespace Internal { // TODO: This whole class should probably go into utils class PathChooserDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit PathChooserDelegate(QObject *parent = 0); void setExpectedKind(Utils::PathChooser::Kind kind); void setPromptDialogFilter(const QString &filter); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; private slots: void emitCommitData(); private: Utils::PathChooser::Kind m_kind; QString m_filter; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_PATHCHOOSERDELEGATE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorgeneralwidget.h0000644000015301777760000000467712321547255032522 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORGENERALWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORGENERALWIDGET_H #include "bardescriptoreditorabstractpanelwidget.h" namespace Qnx { namespace Internal { namespace Ui { class BarDescriptorEditorGeneralWidget; } class BarDescriptorEditorGeneralWidget : public BarDescriptorEditorAbstractPanelWidget { Q_OBJECT public: explicit BarDescriptorEditorGeneralWidget(QWidget *parent = 0); ~BarDescriptorEditorGeneralWidget(); void clear(); QString orientation() const; void setOrientation(const QString &orientation); QString chrome() const; void setChrome(const QString &chrome); bool transparent() const; void setTransparent(bool transparent); void appendApplicationArgument(const QString &argument); QStringList applicationArguments() const; private: Ui::BarDescriptorEditorGeneralWidget *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORGENERALWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconnection.h0000644000015301777760000000512112321547255031247 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONNECTION_H #define QNX_INTERNAL_BLACKBERRYDEVICECONNECTION_H #include #include #include QT_BEGIN_NAMESPACE class QProcess; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BlackBerryDeviceConnection : public QObject { Q_OBJECT public: enum State { Disconnected, Connecting, Connected }; explicit BlackBerryDeviceConnection(); void connectDevice(const ProjectExplorer::IDevice::ConstPtr &device); void disconnectDevice(); QString host() const; State connectionState(); QString messageLog() const; signals: void deviceAboutToConnect(); void deviceConnected(); void deviceDisconnected(); void processOutput(const QString &output); private slots: void processFinished(); void readStandardOutput(); void readStandardError(); private: QString m_host; State m_connectionState; QString m_messageLog; QProcess *m_process; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICECONNECTION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptordocument.cpp0000644000015301777760000002203412321547255030626 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptordocument.h" #include "qnxconstants.h" #include "bardescriptoreditor.h" #include "bardescriptoreditorwidget.h" #include "bardescriptordocumentnodehandlers.h" #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorDocument::BarDescriptorDocument(BarDescriptorEditorWidget *editorWidget) : Core::TextDocument(editorWidget) , m_nodeHandlers(QList()) , m_editorWidget(editorWidget) { // General registerNodeHandler(new BarDescriptorDocumentIdNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentVersionNumberNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentBuildIdNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentAuthorNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentAuthorIdNodeHandler(m_editorWidget)); // Application registerNodeHandler(new BarDescriptorDocumentApplicationNameNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentApplicationDescriptionNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentApplicationIconNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentSplashScreenNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentInitialWindowNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentArgNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentActionNodeHandler(m_editorWidget)); registerNodeHandler(new BarDescriptorDocumentEnvNodeHandler(m_editorWidget)); // Assets registerNodeHandler(new BarDescriptorDocumentAssetNodeHandler(m_editorWidget)); // blackberry-nativepackager requires the XML file to be in UTF-8 encoding, // force if possible if (QTextCodec *defaultUTF8 = QTextCodec::codecForName("UTF-8")) setCodec(defaultUTF8); else setCodec(Core::EditorManager::defaultTextCodec()); } BarDescriptorDocument::~BarDescriptorDocument() { while (!m_nodeHandlers.isEmpty()) { BarDescriptorDocumentAbstractNodeHandler *nodeHandler = m_nodeHandlers.takeFirst(); delete nodeHandler; } } bool BarDescriptorDocument::open(QString *errorString, const QString &fileName) { QString contents; if (read(fileName, &contents, errorString) != Utils::TextFileFormat::ReadSuccess) return false; setFilePath(fileName); m_editorWidget->setFilePath(fileName); bool result = loadContent(contents); if (!result) *errorString = tr("%1 does not appear to be a valid application descriptor file").arg(QDir::toNativeSeparators(fileName)); return result; } bool BarDescriptorDocument::save(QString *errorString, const QString &fn, bool autoSave) { QTC_ASSERT(!autoSave, return false); QTC_ASSERT(fn.isEmpty(), return false); bool result = write(filePath(), xmlSource(), errorString); if (!result) return false; m_editorWidget->setDirty(false); emit changed(); return true; } QString BarDescriptorDocument::defaultPath() const { QFileInfo fi(filePath()); return fi.absolutePath(); } QString BarDescriptorDocument::suggestedFileName() const { QFileInfo fi(filePath()); return fi.fileName(); } QString BarDescriptorDocument::mimeType() const { return QLatin1String(Constants::QNX_BAR_DESCRIPTOR_MIME_TYPE); } bool BarDescriptorDocument::shouldAutoSave() const { return false; } bool BarDescriptorDocument::isModified() const { return m_editorWidget->isDirty(); } bool BarDescriptorDocument::isSaveAsAllowed() const { return false; } Core::IDocument::ReloadBehavior BarDescriptorDocument::reloadBehavior(Core::IDocument::ChangeTrigger state, Core::IDocument::ChangeType type) const { if (type == TypeRemoved || type == TypePermissions) return BehaviorSilent; if (type == TypeContents && state == TriggerInternal && !isModified()) return BehaviorSilent; return BehaviorAsk; } bool BarDescriptorDocument::reload(QString *errorString, Core::IDocument::ReloadFlag flag, Core::IDocument::ChangeType type) { Q_UNUSED(type); if (flag == Core::IDocument::FlagIgnore) return true; return open(errorString, filePath()); } QString BarDescriptorDocument::xmlSource() const { BarDescriptorEditor *editor = qobject_cast(m_editorWidget->editor()); QTC_ASSERT(editor, return QString()); if (editor->activePage() == BarDescriptorEditor::Source) { return m_editorWidget->xmlSource(); } else { QDomDocument doc; doc.appendChild(doc.createProcessingInstruction(QLatin1String("xml"), QLatin1String("version='1.0' encoding='") + QLatin1String(codec()->name()) + QLatin1String("' standalone='no'"))); // QNX QDomElement rootElem = doc.createElement(QLatin1String("qnx")); rootElem.setAttribute(QLatin1String("xmlns"), QLatin1String("http://www.qnx.com/schemas/application/1.0")); QMap nodeHandlerMap; foreach (BarDescriptorDocumentAbstractNodeHandler *nodeHandler, m_nodeHandlers) nodeHandlerMap.insertMulti(nodeHandler->order(), nodeHandler); QList nodeHandlers = nodeHandlerMap.values(); foreach (BarDescriptorDocumentAbstractNodeHandler *nodeHandler, nodeHandlers) rootElem.appendChild(nodeHandler->toNode(doc)); doc.appendChild(rootElem); return doc.toString(4); } } bool BarDescriptorDocument::loadContent(const QString &xmlSource, QString *errorMessage, int *errorLine) { QDomDocument doc; bool result = doc.setContent(xmlSource, errorMessage, errorLine); if (!result) return false; QDomElement docElem = doc.documentElement(); if (docElem.tagName() != QLatin1String("qnx")) return false; m_editorWidget->clear(); removeUnknownNodeHandlers(); foreach (BarDescriptorDocumentAbstractNodeHandler *nodeHandler, m_nodeHandlers) nodeHandler->clear(); QDomNode node = docElem.firstChildElement(); while (!node.isNull()) { BarDescriptorDocumentAbstractNodeHandler *nodeHandler = nodeHandlerForDomNode(node); if (!nodeHandler) { nodeHandler = new BarDescriptorDocumentUnknownNodeHandler(m_editorWidget); registerNodeHandler(nodeHandler); } if (!nodeHandler->handle(node)) return false; node = node.nextSibling(); } m_editorWidget->setXmlSource(xmlSource); return true; } void BarDescriptorDocument::registerNodeHandler(BarDescriptorDocumentAbstractNodeHandler *nodeHandler) { m_nodeHandlers << nodeHandler; } BarDescriptorDocumentAbstractNodeHandler *BarDescriptorDocument::nodeHandlerForDomNode(const QDomNode &node) { foreach (BarDescriptorDocumentAbstractNodeHandler *handler, m_nodeHandlers) { if (handler->canHandle(node) && !dynamic_cast(handler)) return handler; } return 0; } void BarDescriptorDocument::removeUnknownNodeHandlers() { for (int i = m_nodeHandlers.size() - 1; i >= 0; --i) { BarDescriptorDocumentUnknownNodeHandler *nodeHandler = dynamic_cast(m_nodeHandlers[i]); if (nodeHandler) { m_nodeHandlers.removeAt(i); delete nodeHandler; } } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryrunconfiguration.h0000644000015301777760000000553012321547255031330 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYRUNCONFIGURATION_H #define QNX_INTERNAL_BLACKBERRYRUNCONFIGURATION_H #include namespace ProjectExplorer { class Target; } namespace QmakeProjectManager { class QmakeBuildConfiguration; class QmakeProject; } namespace Qnx { namespace Internal { class BlackBerryDeployConfiguration; class BlackBerryRunConfiguration : public ProjectExplorer::RunConfiguration { Q_OBJECT friend class BlackBerryRunConfigurationFactory; public: explicit BlackBerryRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &path); QWidget *createConfigurationWidget(); QString proFilePath() const; QString deviceName() const; QString barPackage() const; QString localExecutableFilePath() const; bool fromMap(const QVariantMap &map); QVariantMap toMap() const; BlackBerryDeployConfiguration *deployConfiguration() const; QmakeProjectManager::QmakeBuildConfiguration *activeQmakeBuildConfiguration() const; QString key() const; signals: void targetInformationChanged(); protected: BlackBerryRunConfiguration(ProjectExplorer::Target *parent, BlackBerryRunConfiguration *source); private: void init(); void updateDisplayName(); QString m_proFilePath; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYRUNCONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrykeyspage.cpp0000644000015301777760000000440512321547255030077 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrykeyspage.h" #include "blackberrykeyswidget.h" #include "qnxconstants.h" #include #include namespace Qnx { namespace Internal { BlackBerryKeysPage::BlackBerryKeysPage(QObject *parent) : Core::IOptionsPage(parent), m_widget(0) { setId(Core::Id(Constants::QNX_BB_SIGNING_ID)); setDisplayName(tr("Keys")); setCategory(Constants::QNX_BB_CATEGORY); setDisplayCategory(QCoreApplication::translate("BlackBerry", Constants::QNX_BB_CATEGORY_TR)); } QWidget *BlackBerryKeysPage::createPage(QWidget *parent) { m_widget = new BlackBerryKeysWidget(parent); return m_widget; } void BlackBerryKeysPage::apply() { } void BlackBerryKeysPage::finish() { } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryruncontrol.h0000644000015301777760000000444112321547255030141 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYRUNCONTROL_H #define QNX_INTERNAL_BLACKBERRYRUNCONTROL_H #include namespace QmakeProjectManager { class QmakeBuildConfiguration; } namespace Qnx { namespace Internal { class BlackBerryConnect; class BlackBerryRunConfiguration; class BlackBerryApplicationRunner; class BlackBerryRunControl : public ProjectExplorer::RunControl { Q_OBJECT public: explicit BlackBerryRunControl(BlackBerryRunConfiguration *runConfiguration); void start(); ProjectExplorer::RunControl::StopResult stop(); bool isRunning() const; QIcon icon() const; private slots: void handleStartFailed(const QString &message); private: BlackBerryApplicationRunner *m_runner; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYRUNCONTROL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptorpermissionsmodel.cpp0000644000015301777760000002624012321547255032407 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptorpermissionsmodel.h" #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorPermissionsModel::BarDescriptorPermissionsModel(QObject *parent) : QAbstractTableModel(parent) { initModel(); } Qt::ItemFlags BarDescriptorPermissionsModel::flags(const QModelIndex &index) const { Qt::ItemFlags flags = QAbstractTableModel::flags(index); flags |= Qt::ItemIsUserCheckable; return flags; } int BarDescriptorPermissionsModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); return m_permissions.size(); } int BarDescriptorPermissionsModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); return 1; } QVariant BarDescriptorPermissionsModel::data(const QModelIndex &index, int role) const { if (!index.isValid() || index.row() >= m_permissions.size() || index.column() >= 1) return QVariant(); BarDescriptorPermission perm = m_permissions[index.row()]; switch (role) { case Qt::DisplayRole: case Qt::EditRole: return perm.permission; case Qt::CheckStateRole: return perm.checked ? Qt::Checked : Qt::Unchecked; case Qt::ToolTipRole: return perm.description; case IdentifierRole: return perm.identifier; } return QVariant(); } bool BarDescriptorPermissionsModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (!index.isValid() || index.row() >= m_permissions.size() || index.column() >= 1) return false; if (role == Qt::CheckStateRole) { BarDescriptorPermission &perm = m_permissions[index.row()]; perm.checked = static_cast(value.toInt()) == Qt::Checked; emit dataChanged(index, index); return true; } return false; } QVariant BarDescriptorPermissionsModel::headerData(int section, Qt::Orientation orientation, int role) const { if (role != Qt::DisplayRole || orientation == Qt::Vertical) return QVariant(); if (section == 0) return tr("Permission"); return QVariant(); } void BarDescriptorPermissionsModel::uncheckAll() { setCheckStateAll(Qt::Unchecked); } void BarDescriptorPermissionsModel::checkAll() { setCheckStateAll(Qt::Checked); } void BarDescriptorPermissionsModel::checkPermission(const QString &identifier) { for (int i = 0; i < rowCount(); ++i) { QModelIndex idx = index(i, 0); if (data(idx, IdentifierRole).toString() == identifier) setData(idx, Qt::Checked, Qt::CheckStateRole); } } QStringList BarDescriptorPermissionsModel::checkedIdentifiers() const { QStringList result; foreach (const BarDescriptorPermission &perm, m_permissions) { if (perm.checked) result << perm.identifier; } return result; } void BarDescriptorPermissionsModel::initModel() { beginResetModel(); m_permissions << BarDescriptorPermission(tr("BlackBerry Messenger"), QLatin1String("bbm_connect"), tr("

Allows this app to connect to the BBM Social Platform to access BBM " "contact lists and user profiles, invite BBM contacts to download your " "app, initiate BBM chats and share content from within your app, or " "stream data between apps in real time.

")); m_permissions << BarDescriptorPermission(tr("Calendar"), QLatin1String("access_pimdomain_calendars"), tr("

Allows this app to access the calendar on the device. This access " "includes viewing, adding, and deleting calendar appointments.

")); m_permissions << BarDescriptorPermission(tr("Camera"), QLatin1String("use_camera"), tr("

Allows this app to take pictures, record video, and use the flash.

")); m_permissions << BarDescriptorPermission(tr("Contacts"), QLatin1String("access_pimdomain_contacts"), tr("

Allows this app to access the contacts stored on the device. This " "access includes viewing, creating, and deleting the contacts.

")); m_permissions << BarDescriptorPermission(tr("Device Identifying Information"), QLatin1String("read_device_identifying_information"), tr("

Allows this app to access device identifiers such as serial number and PIN.

")); m_permissions << BarDescriptorPermission(tr("Email and PIN Messages"), QLatin1String("access_pimdomain_messages"), tr("

Allows this app to access the email and PIN messages stored on the " "device. This access includes viewing, creating, sending, and deleting the messages.

")); m_permissions << BarDescriptorPermission(tr("GPS Location"), QLatin1String("read_geolocation"), tr("

Allows this app to access the current GPS location of the device.

")); m_permissions << BarDescriptorPermission(tr("Internet"), QLatin1String("access_internet"), tr("

Allows this app to use Wi-fi, wired, or other connections to a " "destination that is not local on the user's device.

")); m_permissions << BarDescriptorPermission(tr("Location"), QLatin1String("access_location_services"), tr("

Allows this app to access the device's current or saved locations.

")); m_permissions << BarDescriptorPermission(tr("Microphone"), QLatin1String("record_audio"), tr("

Allows this app to record sound using the microphone.

")); m_permissions << BarDescriptorPermission(tr("Notebooks"), QLatin1String("access_pimdomain_notebooks"), tr("

Allows this app to access the content stored in the notebooks on the " "device. This access includes adding and deleting entries and content.

")); m_permissions << BarDescriptorPermission(tr("Post Notifications"), QLatin1String("post_notification"), tr("

Post a notification to the notifications area of the screen.

")); m_permissions << BarDescriptorPermission(tr("Push"), QLatin1String("_sys_use_consumer_push"), tr("

Allows this app to use the Push Service with the BlackBerry Internet " "Service. This access allows the app to receive and request push " "messages. To use the Push Service with the BlackBerry Internet Service, " "you must register with BlackBerry. When you register, you " "receive a confirmation email message that contains information that " "your application needs to receive and request push messages. For more " "information about registering, visit " "https://developer.blackberry.com/services/push/. If you're using the " "Push Service with the BlackBerry Enterprise Server or the BlackBerry " "Device Service, you don't need to register with BlackBerry.

")); m_permissions << BarDescriptorPermission(tr("Run When Backgrounded"), QLatin1String("run_when_backgrounded"), tr("

Allows background processing. Without this permission, the app is " "stopped when the user switches focus to another app. Apps that use this " "permission are rigorously reviewed for acceptance to BlackBerry App " "World storefront for their use of power.

")); m_permissions << BarDescriptorPermission(tr("Shared Files"), QLatin1String("access_shared"), tr("

Allows this app to access pictures, music, documents, and other files " "stored on the user's device, at a remote storage provider, on a media " "card, or in the cloud.

")); m_permissions << BarDescriptorPermission(tr("Text Messages"), QLatin1String("access_sms_mms"), tr("

Allows this app to access the text messages stored on the device. The " "access includes viewing, creating, sending, and deleting text messages.

")); endResetModel(); } void BarDescriptorPermissionsModel::setCheckStateAll(Qt::CheckState checkState) { for (int i = 0; i < rowCount(); ++i) setData(index(i, 0), checkState, Qt::CheckStateRole); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenreader.h0000644000015301777760000000426012321547255031245 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEBUGTOKENREADER_H #define QNX_INTERNAL_BLACKBERRYDEBUGTOKENREADER_H #include QT_BEGIN_NAMESPACE class QZipReader; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BlackBerryDebugTokenReader { public: BlackBerryDebugTokenReader(const QString &filePath); ~BlackBerryDebugTokenReader(); bool isValid() const; QString author() const; QString authorId() const; static bool isSupported(); private: QString manifestValue(const QByteArray &key) const; QString value(const QByteArray &key, const QByteArray &data) const; QZipReader *m_zipReader; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEBUGTOKENREADER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryndksettingspage.h0000644000015301777760000000377412321547255031136 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYNDKSETTINGSPAGE_H #define BLACKBERRYNDKSETTINGSPAGE_H #include namespace Qnx { namespace Internal { class BlackBerryNDKSettingsWidget; class BlackBerryNDKSettingsPage : public Core::IOptionsPage { Q_OBJECT public: explicit BlackBerryNDKSettingsPage(QObject *parent = 0); QWidget *createPage(QWidget *parent); void apply(); void finish(); private: BlackBerryNDKSettingsWidget *m_widget; }; } // namespace Internal } // namespace Qnx #endif // BLACKBERRYNDKSETTINGSPAGE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfiguration.h0000644000015301777760000000641012321547255031761 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATION_H #define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATION_H #include namespace ProjectExplorer { class Kit; } namespace Qnx { namespace Internal { class BlackBerryDeviceConfiguration : public RemoteLinux::LinuxDevice { Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryDeviceConfiguration) public: typedef QSharedPointer Ptr; typedef QSharedPointer ConstPtr; static Ptr create(); static Ptr create(const QString &name, Core::Id type, MachineType machineType, Origin origin = ManuallyAdded, Core::Id id = Core::Id()); QString debugToken() const; void setDebugToken(const QString &debugToken); void fromMap(const QVariantMap &map); QString displayType() const; ProjectExplorer::IDeviceWidget *createWidget(); QList actionIds() const; QString displayNameForActionId(Core::Id actionId) const; void executeAction(Core::Id actionId, QWidget *parent); ProjectExplorer::IDevice::Ptr clone() const; ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const; bool hasDeviceTester() const; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; static ConstPtr device(const ProjectExplorer::Kit *k); protected: BlackBerryDeviceConfiguration(); BlackBerryDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id); BlackBerryDeviceConfiguration(const BlackBerryDeviceConfiguration &other); QVariantMap toMap() const; private: QString m_debugToken; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxanalyzesupport.h0000644000015301777760000000504612321547255027524 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNXANALYZESUPPORT_H #define QNXANALYZESUPPORT_H #include "qnxabstractrunsupport.h" #include #include #include namespace Analyzer { class AnalyzerRunControl; } namespace Qnx { namespace Internal { class QnxRunConfiguration; class QnxAnalyzeSupport : public QnxAbstractRunSupport { Q_OBJECT public: QnxAnalyzeSupport(QnxRunConfiguration *runConfig, Analyzer::AnalyzerRunControl *engine); public slots: void handleProfilingFinished(); private slots: void handleAdapterSetupRequested(); void handleRemoteProcessFinished(bool success); void handleProgressReport(const QString &progressOutput); void handleRemoteOutput(const QByteArray &output); void handleError(const QString &error); void remoteIsRunning(); private: void startExecution(); void showMessage(const QString &, Utils::OutputFormat); Analyzer::AnalyzerRunControl *m_runControl; QmlDebug::QmlOutputParser m_outputParser; int m_qmlPort; }; } // namespace Internal } // namespace Qnx #endif // QNXANALYZESUPPORT_H ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepconfigwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepconfigwidget.0000644000015301777760000000773412321547255033641 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycreatepackagestepconfigwidget.h" #include "ui_blackberrycreatepackagestepconfigwidget.h" #include "blackberrycreatepackagestep.h" using namespace Qnx; using namespace Qnx::Internal; BlackBerryCreatePackageStepConfigWidget::BlackBerryCreatePackageStepConfigWidget(BlackBerryCreatePackageStep *step) : ProjectExplorer::BuildStepConfigWidget() , m_step(step) { m_ui = new Ui::BlackBerryCreatePackageStepConfigWidget; m_ui->setupUi(this); m_ui->signPackages->setChecked(m_step->packageMode() == BlackBerryCreatePackageStep::SigningPackageMode); m_ui->developmentMode->setChecked(m_step->packageMode() == BlackBerryCreatePackageStep::DevelopmentMode); m_ui->cskPassword->setText(m_step->cskPassword()); m_ui->keystorePassword->setText(m_step->keystorePassword()); m_ui->savePasswords->setChecked(m_step->savePasswords()); connect(m_ui->signPackages, SIGNAL(toggled(bool)), this, SLOT(setPackageMode(bool))); connect(m_ui->cskPassword, SIGNAL(textChanged(QString)), m_step, SLOT(setCskPassword(QString))); connect(m_ui->keystorePassword, SIGNAL(textChanged(QString)), m_step, SLOT(setKeystorePassword(QString))); connect(m_ui->showPasswords, SIGNAL(toggled(bool)), this, SLOT(showPasswords(bool))); connect(m_ui->savePasswords, SIGNAL(toggled(bool)), m_step, SLOT(setSavePasswords(bool))); connect(m_step, SIGNAL(cskPasswordChanged(QString)), m_ui->cskPassword, SLOT(setText(QString))); connect(m_step, SIGNAL(keystorePasswordChanged(QString)), m_ui->keystorePassword, SLOT(setText(QString))); m_ui->signPackagesWidget->setEnabled(m_ui->signPackages->isChecked()); } BlackBerryCreatePackageStepConfigWidget::~BlackBerryCreatePackageStepConfigWidget() { delete m_ui; m_ui = 0; } QString BlackBerryCreatePackageStepConfigWidget::displayName() const { return tr("Create packages"); } QString BlackBerryCreatePackageStepConfigWidget::summaryText() const { return displayName(); } bool BlackBerryCreatePackageStepConfigWidget::showWidget() const { return true; } void BlackBerryCreatePackageStepConfigWidget::setPackageMode(bool signPackagesChecked) { m_step->setPackageMode(signPackagesChecked ? BlackBerryCreatePackageStep::SigningPackageMode : BlackBerryCreatePackageStep::DevelopmentMode); } void BlackBerryCreatePackageStepConfigWidget::showPasswords(bool show) { m_ui->cskPassword->setEchoMode(show ? QLineEdit::Normal : QLineEdit::Password); m_ui->keystorePassword->setEchoMode(show ? QLineEdit::Normal : QLineEdit::Password); } ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorauthorinformationwidget.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorauthorinformationwidg0000644000015301777760000000236012321547255034061 0ustar pbusernogroup00000000000000 Qnx::Internal::BarDescriptorEditorAuthorInformationWidget 0 0 371 90 Form Author: Author ID: Set from debug token... qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdebugsupport.h0000644000015301777760000000541112321547255027143 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEBUGSUPPORT_H #define QNX_INTERNAL_QNXDEBUGSUPPORT_H #include "qnxabstractrunsupport.h" #include namespace Debugger { class DebuggerEngine; } namespace Qnx { namespace Internal { class QnxRunConfiguration; class Slog2InfoRunner; class QnxDebugSupport : public QnxAbstractRunSupport { Q_OBJECT public: explicit QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::DebuggerEngine *engine); public slots: void handleDebuggingFinished(); private slots: void handleAdapterSetupRequested(); void handleRemoteProcessStarted(); void handleRemoteProcessFinished(bool success); void handleProgressReport(const QString &progressOutput); void handleRemoteOutput(const QByteArray &output); void handleError(const QString &error); void printMissingWarning(); void handleApplicationOutput(const QString &msg, Utils::OutputFormat outputFormat); private: void startExecution(); QString executable() const; void killInferiorProcess(); Slog2InfoRunner *m_slog2Info; Debugger::DebuggerEngine *m_engine; int m_pdebugPort; int m_qmlPort; bool m_useCppDebugger; bool m_useQmlDebugger; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEBUGSUPPORT_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxqtversionfactory.cpp0000644000015301777760000000600312321547255030373 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxqtversionfactory.h" #include "qnxconstants.h" #include "qnxutils.h" #include "qnxqtversion.h" #include #include using namespace Qnx; using namespace Qnx::Internal; QnxQtVersionFactory::QnxQtVersionFactory(QObject *parent) : QtSupport::QtVersionFactory(parent) { } QnxQtVersionFactory::~QnxQtVersionFactory() { } bool QnxQtVersionFactory::canRestore(const QString &type) { return type == QLatin1String(Constants::QNX_QNX_QT); } QtSupport::BaseQtVersion *QnxQtVersionFactory::restore(const QString &type, const QVariantMap &data) { if (!canRestore(type)) return 0; QnxQtVersion *v = new QnxQtVersion(); v->fromMap(data); return v; } int QnxQtVersionFactory::priority() const { return Constants::QNX_QNX_QT_FACTORY_PRIO; } QtSupport::BaseQtVersion *QnxQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource) { QFileInfo fi = qmakePath.toFileInfo(); if (!fi.exists() || !fi.isExecutable() || !fi.isFile()) return 0; if (evaluator->contains(QLatin1String("QNX_CPUDIR"))) { QString cpuDir = evaluator->value(QLatin1String("QNX_CPUDIR")); return new QnxQtVersion(QnxUtils::cpudirToArch(cpuDir), qmakePath, isAutoDetected, autoDetectionSource); } return 0; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizard.h0000644000015301777760000000474212321547255033210 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H #define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H #include "blackberrydeviceconfigurationwizardpages.h" #include #include namespace Qnx { namespace Internal { class BlackBerryDeviceConfigurationWizard : public Utils::Wizard { Q_OBJECT public: explicit BlackBerryDeviceConfigurationWizard(QWidget *parent = 0); ProjectExplorer::IDevice::Ptr device(); private: enum PageId { SetupPageId, QueryPageId, ConfigPageId, FinalPageId }; BlackBerryDeviceConfigurationWizardSetupPage *m_setupPage; BlackBerryDeviceConfigurationWizardQueryPage *m_queryPage; BlackBerryDeviceConfigurationWizardConfigPage *m_configPage; BlackBerryDeviceConfigurationWizardFinalPage *m_finalPage; BlackBerryDeviceConfigurationWizardHolder m_holder; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/pathchooserdelegate.cpp0000644000015301777760000000663312321547255030245 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "pathchooserdelegate.h" #include #include using namespace Qnx; using namespace Qnx::Internal; PathChooserDelegate::PathChooserDelegate(QObject *parent) : QStyledItemDelegate(parent) , m_kind(Utils::PathChooser::ExistingDirectory) { } void PathChooserDelegate::setExpectedKind(Utils::PathChooser::Kind kind) { m_kind = kind; } void PathChooserDelegate::setPromptDialogFilter(const QString &filter) { m_filter = filter; } QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { Q_UNUSED(option); Q_UNUSED(index); Utils::PathChooser *editor = new Utils::PathChooser(parent); editor->setAutoFillBackground(true); // To hide the text beneath the editor widget editor->lineEdit()->setMinimumWidth(0); connect(editor, SIGNAL(browsingFinished()), this, SLOT(emitCommitData())); return editor; } void PathChooserDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { QString value = index.model()->data(index, Qt::EditRole).toString(); Utils::PathChooser *pathChooser = qobject_cast(editor); if (!pathChooser) return; pathChooser->setExpectedKind(m_kind); pathChooser->setPromptDialogFilter(m_filter); pathChooser->setPath(value); } void PathChooserDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { Utils::PathChooser *pathChooser = qobject_cast(editor); if (!pathChooser) return; model->setData(index, pathChooser->path(), Qt::EditRole); } void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const { Q_UNUSED(index); editor->setGeometry(option.rect); } void PathChooserDelegate::emitCommitData() { emit commitData(qobject_cast(sender())); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenrequestdialog.ui0000644000015301777760000000521012321547255033035 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryDebugTokenRequestDialog 0 0 388 153 Request Debug Token Debug token path: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Device PIN: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter HHHHHHHH 8 0 0 75 true Status Qt::AlignCenter QDialogButtonBox::Cancel|QDialogButtonBox::Ok Utils::PathChooser QWidget
utils/pathchooser.h
1
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryruncontrolfactory.h0000644000015301777760000000512412321547255031530 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYRUNCONTROLFACTORY_H #define QNX_INTERNAL_BLACKBERRYRUNCONTROLFACTORY_H #include #include namespace RemoteLinux { class RemoteLinuxRunConfiguration; } namespace Qnx { namespace Internal { class BlackBerryRunConfiguration; class BlackBerryRunControlFactory : public ProjectExplorer::IRunControlFactory { Q_OBJECT public: BlackBerryRunControlFactory(QObject *parent = 0); bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, QString *errorMessage); private: static Debugger::DebuggerStartParameters startParameters( const BlackBerryRunConfiguration *runConfig); mutable QMap > m_activeRunControls; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYRUNCONTROLFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestep.cpp0000644000015301777760000003170212321547255031742 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycreatepackagestep.h" #include "qnxconstants.h" #include "blackberrycreatepackagestepconfigwidget.h" #include "blackberrydeployconfiguration.h" #include "qnxutils.h" #include "blackberryqtversion.h" #include "blackberrydeviceconfiguration.h" #include "blackberrydeployinformation.h" #include "blackberrysigningpasswordsdialog.h" #include #include #include #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char PACKAGER_CMD[] = "blackberry-nativepackager"; const char QT_INSTALL_LIBS[] = "QT_INSTALL_LIBS"; const char QT_INSTALL_LIBS_VAR[] = "%QT_INSTALL_LIBS%"; const char QT_INSTALL_PLUGINS[] = "QT_INSTALL_PLUGINS"; const char QT_INSTALL_PLUGINS_VAR[] = "%QT_INSTALL_PLUGINS%"; const char QT_INSTALL_IMPORTS[] = "QT_INSTALL_IMPORTS"; const char QT_INSTALL_IMPORTS_VAR[] = "%QT_INSTALL_IMPORTS%"; const char QT_INSTALL_QML[] = "QT_INSTALL_QML"; const char QT_INSTALL_QML_VAR[] = "%QT_INSTALL_QML%"; const char SRC_DIR_VAR[] = "%SRC_DIR%"; const char PACKAGE_MODE_KEY[] = "Qt4ProjectManager.BlackBerryCreatePackageStep.PackageMode"; const char CSK_PASSWORD_KEY[] = "Qt4ProjectManager.BlackBerryCreatePackageStep.CskPassword"; const char KEYSTORE_PASSWORD_KEY[] = "Qt4ProjectManager.BlackBerryCreatePackageStep.KeystorePassword"; const char SAVE_PASSWORDS_KEY[] = "Qt4ProjectManager.BlackBerryCreatePackageStep.SavePasswords"; } BlackBerryCreatePackageStep::BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl) : BlackBerryAbstractDeployStep(bsl, Core::Id(Constants::QNX_CREATE_PACKAGE_BS_ID)) { ctor(); } BlackBerryCreatePackageStep::BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCreatePackageStep *bs) : BlackBerryAbstractDeployStep(bsl, bs) { ctor(); } void BlackBerryCreatePackageStep::ctor() { setDisplayName(tr("Create packages")); m_packageMode = DevelopmentMode; } bool BlackBerryCreatePackageStep::init() { if (!BlackBerryAbstractDeployStep::init()) return false; const QString packageCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(PACKAGER_CMD)); if (packageCmd.isEmpty()) { raiseError(tr("Could not find packager command '%1' in the build environment") .arg(QLatin1String(PACKAGER_CMD))); return false; } BlackBerryDeployConfiguration *deployConfig = qobject_cast(deployConfiguration()); QTC_ASSERT(deployConfig, return false); QList packagesToDeploy = deployConfig->deploymentInfo()->enabledPackages(); if (packagesToDeploy.isEmpty()) { raiseError(tr("No packages enabled for deployment")); return false; } foreach (const BarPackageDeployInformation &info, packagesToDeploy) { if (info.appDescriptorPath().isEmpty()) { raiseError(tr("Application descriptor file not specified, please check deployment settings")); return false; } if (info.packagePath().isEmpty()) { raiseError(tr("No package specified, please check deployment settings")); return false; } const QString buildDir = QFileInfo(info.packagePath()).absolutePath(); QDir dir(buildDir); if (!dir.exists()) { if (!dir.mkpath(buildDir)) { raiseError(tr("Could not create build directory '%1'").arg(buildDir)); return false; } } const QString preparedFilePath = buildDir + QLatin1String("/bar-descriptor-") + project()->displayName() + QLatin1String("-qtc-generated.xml"); if (!prepareAppDescriptorFile(info.appDescriptorPath(), preparedFilePath)) // If there is an error, prepareAppDescriptorFile() will raise it return false; QStringList args; if (m_packageMode == DevelopmentMode) { args << QLatin1String("-devMode"); if (!debugToken().isEmpty()) args << QLatin1String("-debugToken") << QnxUtils::addQuotes(QDir::toNativeSeparators(debugToken())); } else if (m_packageMode == SigningPackageMode) { if (m_cskPassword.isEmpty() || m_keystorePassword.isEmpty()) { BlackBerrySigningPasswordsDialog dlg; dlg.setCskPassword(m_cskPassword); dlg.setStorePassword(m_keystorePassword); if (dlg.exec() == QDialog::Rejected) { raiseError(tr("Missing passwords for signing packages")); return false; } m_cskPassword = dlg.cskPassword(); m_keystorePassword = dlg.storePassword(); emit cskPasswordChanged(m_cskPassword); emit keystorePasswordChanged(m_keystorePassword); } args << QLatin1String("-sign"); args << QLatin1String("-cskpass"); args << m_cskPassword; args << QLatin1String("-storepass"); args << m_keystorePassword; } args << QLatin1String("-package") << QnxUtils::addQuotes(QDir::toNativeSeparators(info.packagePath())); args << QnxUtils::addQuotes(QDir::toNativeSeparators(preparedFilePath)); addCommand(packageCmd, args); } return true; } ProjectExplorer::BuildStepConfigWidget *BlackBerryCreatePackageStep::createConfigWidget() { return new BlackBerryCreatePackageStepConfigWidget(this); } QString BlackBerryCreatePackageStep::debugToken() const { BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit()); if (!device) return QString(); return device->debugToken(); } bool BlackBerryCreatePackageStep::fromMap(const QVariantMap &map) { m_packageMode = static_cast(map.value(QLatin1String(PACKAGE_MODE_KEY), DevelopmentMode).toInt()); m_savePasswords = map.value(QLatin1String(SAVE_PASSWORDS_KEY), false).toBool(); if (m_savePasswords) { m_cskPassword = map.value(QLatin1String(CSK_PASSWORD_KEY)).toString(); m_keystorePassword = map.value(QLatin1String(KEYSTORE_PASSWORD_KEY)).toString(); } return BlackBerryAbstractDeployStep::fromMap(map); } QVariantMap BlackBerryCreatePackageStep::toMap() const { QVariantMap map = BlackBerryAbstractDeployStep::toMap(); map.insert(QLatin1String(PACKAGE_MODE_KEY), m_packageMode); map.insert(QLatin1String(SAVE_PASSWORDS_KEY), m_savePasswords); if (m_savePasswords) { map.insert(QLatin1String(CSK_PASSWORD_KEY), m_cskPassword); map.insert(QLatin1String(KEYSTORE_PASSWORD_KEY), m_keystorePassword); } return map; } BlackBerryCreatePackageStep::PackageMode BlackBerryCreatePackageStep::packageMode() const { return m_packageMode; } QString BlackBerryCreatePackageStep::cskPassword() const { return m_cskPassword; } QString BlackBerryCreatePackageStep::keystorePassword() const { return m_keystorePassword; } bool BlackBerryCreatePackageStep::savePasswords() const { return m_savePasswords; } void BlackBerryCreatePackageStep::setPackageMode(BlackBerryCreatePackageStep::PackageMode packageMode) { m_packageMode = packageMode; } void BlackBerryCreatePackageStep::setCskPassword(const QString &cskPassword) { m_cskPassword = cskPassword; } void BlackBerryCreatePackageStep::setKeystorePassword(const QString &storePassword) { m_keystorePassword = storePassword; } void BlackBerryCreatePackageStep::setSavePasswords(bool savePasswords) { m_savePasswords = savePasswords; } bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDescriptorPath, const QString &preparedFilePath) { BlackBerryQtVersion *qtVersion = dynamic_cast(QtSupport::QtKitInformation::qtVersion(target()->kit())); if (!qtVersion) { raiseError(tr("Error preparing application descriptor file")); return false; } QFile file(appDescriptorPath); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { raiseError(tr("Could not open '%1' for reading").arg(appDescriptorPath)); return false; } QFile preparedFile(preparedFilePath); QByteArray fileContent = file.readAll(); // Add Warning text const QString warningText = QString::fromLatin1("\nversionInfo().value(QLatin1String(QT_INSTALL_LIBS)).toLatin1()); if (fileContent.contains(QT_INSTALL_PLUGINS_VAR)) fileContent.replace(QT_INSTALL_PLUGINS_VAR, qtVersion->versionInfo().value(QLatin1String(QT_INSTALL_PLUGINS)).toLatin1()); if (fileContent.contains(QT_INSTALL_IMPORTS_VAR)) fileContent.replace(QT_INSTALL_IMPORTS_VAR, qtVersion->versionInfo().value(QLatin1String(QT_INSTALL_IMPORTS)).toLatin1()); if (fileContent.contains(QT_INSTALL_QML_VAR)) fileContent.replace(QT_INSTALL_QML_VAR, qtVersion->versionInfo().value(QLatin1String(QT_INSTALL_QML)).toLatin1()); //Replace Source path placeholder if (fileContent.contains(SRC_DIR_VAR)) fileContent.replace(SRC_DIR_VAR, QDir::toNativeSeparators(target()->project()->projectDirectory()).toLatin1()); // Add parameter for QML debugging (if enabled) Debugger::DebuggerRunConfigurationAspect *aspect = target()->activeRunConfiguration()->extraAspect(); if (aspect->useQmlDebugger()) { if (!fileContent.contains("-qmljsdebugger")) { const QString argString = QString::fromLatin1("-qmljsdebugger=port:%1\n") .arg(aspect->qmlDebugServerPort()); fileContent.replace("", argString.toLatin1()); } } if (!preparedFile.open(QIODevice::WriteOnly)) { const QString buildDir = target()->activeBuildConfiguration()->buildDirectory().toUserOutput(); raiseError(tr("Could not create prepared application descriptor file in '%1'").arg(buildDir)); return false; } preparedFile.write(fileContent); preparedFile.close(); return true; } void BlackBerryCreatePackageStep::processStarted(const ProjectExplorer::ProcessParameters ¶ms) { if (m_packageMode == SigningPackageMode) { QString arguments = params.prettyArguments(); const QString cskPasswordLine = QLatin1String(" -cskpass ") + m_cskPassword; const QString hiddenCskPasswordLine = QLatin1String(" -cskpass "); arguments.replace(cskPasswordLine, hiddenCskPasswordLine); const QString storePasswordLine = QLatin1String(" -storepass ") + m_keystorePassword; const QString hiddenStorePasswordLine = QLatin1String(" -storepass "); arguments.replace(storePasswordLine, hiddenStorePasswordLine); emitOutputInfo(params, arguments); } else { BlackBerryAbstractDeployStep::processStarted(params); } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizardfinishpage.ui0000644000015301777760000000276012321547255032543 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerrySetupWizardFinishPage 0 0 400 134 WizardPage Qt::Vertical 20 36 Status Qt::AlignCenter Qt::Vertical 20 36 24 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdevicetester.h0000644000015301777760000000532612321547255027113 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEVICETESTER_H #define QNX_INTERNAL_QNXDEVICETESTER_H #include #include namespace QSsh { class SshRemoteProcessRunner; } namespace Qnx { namespace Internal { class QnxDeviceTester : public ProjectExplorer::DeviceTester { Q_OBJECT public: explicit QnxDeviceTester(QObject *parent = 0); void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration); void stopTest(); private slots: void handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult result); void handleProcessFinished(int exitStatus); void handleConnectionError(); private: enum State { Inactive, GenericTest, CommandsTest }; void testNextCommand(); void setFinished(); QStringList versionSpecificCommandsToTest(int versionNumber) const; RemoteLinux::GenericLinuxDeviceTester *m_genericTester; ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration; ProjectExplorer::DeviceTester::TestResult m_result; State m_state; int m_currentCommandIndex; QStringList m_commandsToTest; QSsh::SshRemoteProcessRunner *m_processRunner; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEVICETESTER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeploystepconfigwidget.h0000644000015301777760000000400112321547255032506 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEPLOYSTEPCONFIGWIDGET_H #define QNX_INTERNAL_BLACKBERRYDEPLOYSTEPCONFIGWIDGET_H #include namespace Qnx { namespace Internal { class BlackBerryDeployStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget { Q_OBJECT public: explicit BlackBerryDeployStepConfigWidget(); QString summaryText() const; QString displayName() const; bool showWidget() const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEPLOYSTEPCONFIGWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployconfigurationwidget.h0000644000015301777760000000442512321547255033226 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONWIDGET_H #define QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONWIDGET_H #include #include namespace Qnx { namespace Internal { namespace Ui { class BlackBerryDeployConfigurationWidget; } class BlackBerryDeployConfiguration; class BlackBerryDeployConfigurationWidget : public ProjectExplorer::NamedWidget { Q_OBJECT public: explicit BlackBerryDeployConfigurationWidget(BlackBerryDeployConfiguration *dc, QWidget *parent = 0); ~BlackBerryDeployConfigurationWidget(); private: Ui::BlackBerryDeployConfigurationWidget *m_ui; BlackBerryDeployConfiguration *m_deployConfiguration; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployconfigurationwidget.cpp0000644000015301777760000000620512321547255033557 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeployconfigurationwidget.h" #include "ui_blackberrydeployconfigurationwidget.h" #include "blackberrydeployconfiguration.h" #include "blackberrydeployinformation.h" #include "pathchooserdelegate.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeployConfigurationWidget::BlackBerryDeployConfigurationWidget(BlackBerryDeployConfiguration *dc, QWidget *parent) : ProjectExplorer::NamedWidget(parent) , m_ui(new Ui::BlackBerryDeployConfigurationWidget) , m_deployConfiguration(0) { m_ui->setupUi(this); m_deployConfiguration = dc; m_ui->deployPackagesView->setModel(m_deployConfiguration->deploymentInfo()); PathChooserDelegate *appDescriptorPathDelegate = new PathChooserDelegate(this); appDescriptorPathDelegate->setExpectedKind(Utils::PathChooser::File); appDescriptorPathDelegate->setPromptDialogFilter(QLatin1String("*.xml")); PathChooserDelegate *barPathDelegate = new PathChooserDelegate(this); barPathDelegate->setExpectedKind(Utils::PathChooser::File); barPathDelegate->setPromptDialogFilter(QLatin1String("*.bar")); m_ui->deployPackagesView->setItemDelegateForColumn(1, appDescriptorPathDelegate); m_ui->deployPackagesView->setItemDelegateForColumn(2, barPathDelegate); m_ui->deployPackagesView->header()->resizeSections(QHeaderView::ResizeToContents); } BlackBerryDeployConfigurationWidget::~BlackBerryDeployConfigurationWidget() { delete m_ui; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxabstractqtversion.h0000644000015301777760000000613312321547255030200 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXABSTRACTQTVERSION_H #define QNX_INTERNAL_QNXABSTRACTQTVERSION_H #include "qnxconstants.h" #include #include #include namespace Qnx { namespace Internal { class QnxAbstractQtVersion : public QtSupport::BaseQtVersion { friend class QnxBaseQtConfigWidget; Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxAbstractQtVersion) public: QnxAbstractQtVersion(); QnxAbstractQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); QString qnxHost() const; QString qnxTarget() const; QnxArchitecture architecture() const; QString archString() const; QVariantMap toMap() const; void fromMap(const QVariantMap &map); QList detectQtAbis() const; void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const; Utils::Environment qmakeRunEnvironment() const; QtSupport::QtConfigWidget *createConfigurationWidget() const; bool isValid() const; QString invalidReason() const; virtual QString sdkDescription() const = 0; protected: QString sdkPath() const; void setSdkPath(const QString &sdkPath); private: void updateEnvironment() const; virtual QList environment() const = 0; QnxArchitecture m_arch; QString m_sdkPath; mutable bool m_environmentUpToDate; mutable QList m_qnxEnv; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXABSTRACTQTVERSION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizard.cpp0000644000015301777760000000674212321547255033545 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceconfigurationwizard.h" #include "blackberrydeviceconfigurationwizardpages.h" #include "qnxconstants.h" #include "blackberrydeviceconfiguration.h" #include "blackberrydeviceconnectionmanager.h" #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeviceConfigurationWizard::BlackBerryDeviceConfigurationWizard(QWidget *parent) : Utils::Wizard(parent) { setWindowTitle(tr("New BlackBerry Device Configuration Setup")); m_setupPage = new BlackBerryDeviceConfigurationWizardSetupPage(this); m_queryPage = new BlackBerryDeviceConfigurationWizardQueryPage(m_holder, this); m_configPage = new BlackBerryDeviceConfigurationWizardConfigPage(m_holder, this); m_finalPage = new BlackBerryDeviceConfigurationWizardFinalPage(this); setPage(SetupPageId, m_setupPage); setPage(QueryPageId, m_queryPage); setPage(ConfigPageId, m_configPage); setPage(FinalPageId, m_finalPage); m_finalPage->setCommitPage(true); } ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationWizard::device() { QSsh::SshConnectionParameters sshParams; sshParams.options = QSsh::SshIgnoreDefaultProxy; sshParams.host = m_setupPage->hostName(); sshParams.password = m_setupPage->password(); sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey; sshParams.privateKeyFile = BlackBerryDeviceConnectionManager::instance()->privateKeyPath(); sshParams.userName = QLatin1String("devuser"); sshParams.timeout = 10; sshParams.port = 22; BlackBerryDeviceConfiguration::Ptr configuration = BlackBerryDeviceConfiguration::create( m_configPage->configurationName(), Core::Id(Constants::QNX_BB_OS_TYPE), m_holder.isSimulator ? ProjectExplorer::IDevice::Emulator : ProjectExplorer::IDevice::Hardware); configuration->setSshParameters(sshParams); configuration->setDebugToken(m_configPage->debugToken()); return configuration; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconnectionmanager.h0000644000015301777760000000715612321547255032614 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONNECTIONMANAGER_H #define QNX_INTERNAL_BLACKBERRYDEVICECONNECTIONMANAGER_H #include #include #include namespace Qnx { namespace Internal { class BlackBerryDeviceConnection; class BlackBerryDeviceConnectionManager : public QObject { Q_OBJECT public: ~BlackBerryDeviceConnectionManager(); void initialize(); void killAllConnections(); static BlackBerryDeviceConnectionManager *instance(); bool isConnected(Core::Id deviceId); QString connectionLog(Core::Id deviceId) const; void connectDevice(const ProjectExplorer::IDevice::ConstPtr &device); void disconnectDevice(const ProjectExplorer::IDevice::ConstPtr &device); const QString privateKeyPath() const; bool hasValidSSHKeys() const; bool setSSHKeys(const QByteArray privateKeyContent, const QByteArray publicKeyContent, QString *error); signals: void connectionOutput(Core::Id deviceId, const QString &output); void deviceAboutToConnect(Core::Id deviceId); void deviceConnected(); void deviceDisconnected(Core::Id deviceId); public slots: void connectDevice(Core::Id deviceId); void disconnectDevice(Core::Id deviceId); private slots: void handleDeviceListChanged(); void handleDeviceAboutToConnect(); void handleDeviceConnected(); void handleDeviceDisconnected(); void handleProcessOutput(const QString &output); void processPendingDeviceConnections(); private: explicit BlackBerryDeviceConnectionManager(); BlackBerryDeviceConnection *connectionForHost(const QString &host) const; QList devicesForHost(const QString &host) const; int connectionUsageCount(Core::Id deviceId); void disconnectRemovedDevices(); void reconnectChangedDevices(); void connectAddedDevices(); static BlackBerryDeviceConnectionManager *m_instance; QMultiMap m_connections; QList m_pendingDeviceConnections; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICECONNECTIONMANAGER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxruncontrol.cpp0000644000015301777760000000610312321547255027157 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxruncontrol.h" #include "qnxdeviceconfiguration.h" #include "qnxrunconfiguration.h" #include "slog2inforunner.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; using namespace RemoteLinux; QnxRunControl::QnxRunControl(ProjectExplorer::RunConfiguration *runConfig) : RemoteLinuxRunControl(runConfig) , m_slog2Info(0) { ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit()); QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast(); QnxRunConfiguration *qnxRunConfig = qobject_cast(runConfig); QTC_CHECK(qnxRunConfig); const QString applicationId = QFileInfo(qnxRunConfig->remoteExecutableFilePath()).fileName(); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat))); connect(this, SIGNAL(started()), m_slog2Info, SLOT(start())); if (qnxDevice->qnxVersion() > 0x060500) connect(m_slog2Info, SIGNAL(commandMissing()), this, SLOT(printMissingWarning())); } ProjectExplorer::RunControl::StopResult QnxRunControl::stop() { m_slog2Info->stop(); return RemoteLinuxRunControl::stop(); } void QnxRunControl::printMissingWarning() { appendMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available!"), Utils::ErrorMessageFormat); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycheckdevmodestep.cpp0000644000015301777760000001015712321547255031605 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycheckdevmodestep.h" #include "blackberrycheckdevmodestepconfigwidget.h" #include "blackberrydeviceconfiguration.h" #include "qnxconstants.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryCheckDevModeStep::BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl) : BlackBerryAbstractDeployStep(bsl, Core::Id(Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID)) { setDisplayName(tr("Check Development Mode")); } BlackBerryCheckDevModeStep::BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDevModeStep *bs) : BlackBerryAbstractDeployStep(bsl, bs) { setDisplayName(tr("Check Development Mode")); } bool BlackBerryCheckDevModeStep::init() { if (!BlackBerryAbstractDeployStep::init()) return false; QString deployCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD)); if (deployCmd.isEmpty()) { raiseError(tr("Could not find command '%1' in the build environment") .arg(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD))); return false; } BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit()); QString deviceHost = device ? device->sshParameters().host : QString(); if (deviceHost.isEmpty()) { raiseError(tr("No hostname specified for device")); return false; } QStringList args; args << QLatin1String("-listDeviceInfo"); args << deviceHost; if (!device->sshParameters().password.isEmpty()) { args << QLatin1String("-password"); args << device->sshParameters().password; } addCommand(deployCmd, args); return true; } ProjectExplorer::BuildStepConfigWidget *BlackBerryCheckDevModeStep::createConfigWidget() { return new BlackBerryCheckDevModeStepConfigWidget(); } QString BlackBerryCheckDevModeStep::password() const { BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit()); return device ? device->sshParameters().password : QString(); } void BlackBerryCheckDevModeStep::processStarted(const ProjectExplorer::ProcessParameters ¶ms) { QString arguments = params.prettyArguments(); if (!password().isEmpty()) { const QString passwordLine = QLatin1String(" -password ") + password(); const QString hiddenPasswordLine = QLatin1String(" -password "); arguments.replace(passwordLine, hiddenPasswordLine); } emitOutputInfo(params, arguments); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorassetswidget.cpp0000644000015301777760000001604412321547255032731 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorassetswidget.h" #include "ui_bardescriptoreditorassetswidget.h" #include "bardescriptordocument.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorAssetsWidget::BarDescriptorEditorAssetsWidget(QWidget *parent) : BarDescriptorEditorAbstractPanelWidget(parent), m_ui(new Ui::BarDescriptorEditorAssetsWidget) { m_ui->setupUi(this); QStringList headerLabels; headerLabels << tr("Path") << tr("Destination") << tr("Entry-Point"); m_assetsModel = new QStandardItemModel(this); m_assetsModel->setHorizontalHeaderLabels(headerLabels); m_ui->assets->setModel(m_assetsModel); connect(m_ui->addAsset, SIGNAL(clicked()), this, SLOT(addNewAsset())); connect(m_ui->removeAsset, SIGNAL(clicked()), this, SLOT(removeSelectedAsset())); connect(m_assetsModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(updateEntryCheckState(QStandardItem*))); connectAssetsModel(); } BarDescriptorEditorAssetsWidget::~BarDescriptorEditorAssetsWidget() { delete m_ui; } void BarDescriptorEditorAssetsWidget::clear() { // We can't just block signals, as the view depends on them disconnectAssetsModel(); m_assetsModel->removeRows(0, m_assetsModel->rowCount()); connectAssetsModel(); } void BarDescriptorEditorAssetsWidget::addAsset(const BarDescriptorAsset &asset) { disconnectAssetsModel(); addAssetInternal(asset); connectAssetsModel(); } QList BarDescriptorEditorAssetsWidget::assets() const { QList result; for (int i = 0; i < m_assetsModel->rowCount(); ++i) { BarDescriptorAsset asset; asset.source = m_assetsModel->item(i, 0)->text(); asset.destination = m_assetsModel->item(i, 1)->text(); asset.entry = m_assetsModel->item(i, 2)->checkState() == Qt::Checked; result << asset; } return result; } QStandardItemModel *BarDescriptorEditorAssetsWidget::assetsModel() const { return m_assetsModel; } void BarDescriptorEditorAssetsWidget::addAsset(const QString &fullPath) { if (fullPath.isEmpty()) return; BarDescriptorAsset asset; asset.source = fullPath; asset.destination = QFileInfo(fullPath).fileName(); asset.entry = false; addAssetInternal(asset); } void BarDescriptorEditorAssetsWidget::removeAsset(const QString &fullPath) { QList assetItems = m_assetsModel->findItems(fullPath); foreach (QStandardItem *assetItem, assetItems) { QList assetRow = m_assetsModel->takeRow(assetItem->row()); while (!assetRow.isEmpty()) delete assetRow.takeLast(); } } void BarDescriptorEditorAssetsWidget::addNewAsset() { const QString fileName = QFileDialog::getOpenFileName(this, tr("Select File to Add")); if (fileName.isEmpty()) return; addAsset(fileName); } void BarDescriptorEditorAssetsWidget::removeSelectedAsset() { QModelIndexList selectedIndexes = m_ui->assets->selectionModel()->selectedRows(); if (selectedIndexes.isEmpty()) return; foreach (const QModelIndex &index, selectedIndexes) m_assetsModel->removeRow(index.row()); } void BarDescriptorEditorAssetsWidget::updateEntryCheckState(QStandardItem *item) { if (item->column() != 2 || item->checkState() == Qt::Unchecked) return; disconnect(m_assetsModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(updateEntryCheckState(QStandardItem*))); for (int i = 0; i < m_assetsModel->rowCount(); ++i) { QStandardItem *other = m_assetsModel->item(i, 2); if (other == item) continue; // Only one asset can be the entry point other->setCheckState(Qt::Unchecked); } connect(m_assetsModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(updateEntryCheckState(QStandardItem*))); } void BarDescriptorEditorAssetsWidget::connectAssetsModel() { connect(m_assetsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); connect(m_assetsModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(changed())); connect(m_assetsModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(changed())); } void BarDescriptorEditorAssetsWidget::disconnectAssetsModel() { disconnect(m_assetsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); disconnect(m_assetsModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(changed())); disconnect(m_assetsModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(changed())); } void BarDescriptorEditorAssetsWidget::addAssetInternal(const BarDescriptorAsset &asset) { const QString path = asset.source; const QString dest = asset.destination; QTC_ASSERT(!path.isEmpty(), return); QTC_ASSERT(!dest.isEmpty(), return); if (hasAsset(asset)) return; QList items; items << new QStandardItem(path); items << new QStandardItem(dest); QStandardItem *entryItem = new QStandardItem(); entryItem->setCheckable(true); entryItem->setCheckState(asset.entry ? Qt::Checked : Qt::Unchecked); items << entryItem; m_assetsModel->appendRow(items); } bool BarDescriptorEditorAssetsWidget::hasAsset(const BarDescriptorAsset &asset) { for (int i = 0; i < m_assetsModel->rowCount(); ++i) { QStandardItem *sourceItem = m_assetsModel->item(i, 0); QStandardItem *destItem = m_assetsModel->item(i, 1); if (sourceItem->text() == asset.source && destItem->text() == asset.destination) return true; } return false; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycheckdevmodestepfactory.cpp0000644000015301777760000001015412321547255033172 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycheckdevmodestepfactory.h" #include "blackberrycheckdevmodestep.h" #include "blackberrydeviceconfigurationfactory.h" #include "qnxconstants.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryCheckDevModeStepFactory::BlackBerryCheckDevModeStepFactory(QObject *parent) : ProjectExplorer::IBuildStepFactory(parent) { } QList BlackBerryCheckDevModeStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const { if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) return QList(); Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->target()->kit()); if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType()) return QList(); return QList() << Core::Id(Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID); } QString BlackBerryCheckDevModeStepFactory::displayNameForId(const Core::Id id) const { if (id == Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID) return tr("Check Development Mode"); return QString(); } bool BlackBerryCheckDevModeStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const { return availableCreationIds(parent).contains(id); } ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) { if (!canCreate(parent, id)) return 0; return new BlackBerryCheckDevModeStep(parent); } bool BlackBerryCheckDevModeStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, ProjectExplorer::idFromMap(map)); } ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; BlackBerryCheckDevModeStep *bs = new BlackBerryCheckDevModeStep(parent); if (bs->fromMap(map)) return bs; delete bs; return 0; } bool BlackBerryCheckDevModeStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const { return canCreate(parent, product->id()); } ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) { if (!canClone(parent, product)) return 0; return new BlackBerryCheckDevModeStep(parent, static_cast(product)); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryndksettingswidget.ui0000644000015301777760000002610712321547255031666 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryNDKSettingsWidget 0 0 773 495 Form 75 true false QFrame::NoFrame Get started and configure your environment: Qt::PlainText Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false true Qt::TextBrowserInteraction 13 131 220 13 131 220 13 131 220 13 131 220 144 141 139 150 147 145 false true environment setup wizard true Qt::Horizontal 276 20 1 Add Remove Qt::Horizontal Activate Deactivate Qt::Vertical 20 40 BlackBerry NDK Information <html><head/><body><p><span style=" font-weight:600;">NDK Base Name:</span></p></body></html> Qt::Horizontal 40 20 <html><head/><body><p><span style=" font-weight:600;">NDK Path:</span></p></body></html> Qt::Horizontal 40 20 <html><head/><body><p><span style=" font-weight:600;">Version:</span></p></body></html> Qt::Horizontal 40 20 <html><head/><body><p><span style=" font-weight:600;">Host:</span></p></body></html> Qt::Horizontal 40 20 <html><head/><body><p><span style=" font-weight:600;">Target:</span></p></body></html> Qt::Horizontal 40 20 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryapplicationrunner.h0000644000015301777760000000731412321547255031473 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYAPPLICATIONRUNNER_H #define QNX_INTERNAL_BLACKBERRYAPPLICATIONRUNNER_H #include "blackberrydeviceconfiguration.h" #include "blackberryprocessparser.h" #include #include #include #include #include #include namespace QSsh { class SshRemoteProcessRunner; } namespace Qnx { namespace Internal { class BlackBerryRunConfiguration; class BlackBerryLogProcessRunner; class BlackBerryApplicationRunner : public QObject { Q_OBJECT public: explicit BlackBerryApplicationRunner(bool debugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent = 0); bool isRunning() const; qint64 pid() const; ProjectExplorer::RunControl::StopResult stop(); public slots: void start(); signals: void output(const QString &msg, Utils::OutputFormat format); void started(); void finished(); void startFailed(const QString &msg); private slots: void startFinished(int exitCode, QProcess::ExitStatus exitStatus); void stopFinished(int exitCode, QProcess::ExitStatus exitStatus); void readStandardOutput(); void readStandardError(); void disconnectFromDeviceSignals(Core::Id deviceId); void startRunningStateTimer(); void determineRunningState(); void readRunningStateStandardOutput(); void setPid(qint64 pid); void setApplicationId(const QString &applicationId); void launchApplication(); void startLogProcessRunner(); void displayConnectionOutput(Core::Id deviceId, const QString &output); private: void reset(); bool m_debugMode; qint64 m_pid; QString m_appId; bool m_running; bool m_stopping; Utils::Environment m_environment; QString m_deployCmd; BlackBerryDeviceConfiguration::ConstPtr m_device; QString m_barPackage; QSsh::SshConnectionParameters m_sshParams; QProcess *m_launchProcess; QProcess *m_stopProcess; BlackBerryProcessParser m_launchStopProcessParser; BlackBerryLogProcessRunner *m_logProcessRunner; QTimer *m_runningStateTimer; QProcess *m_runningStateProcess; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYAPPLICATIONRUNNER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeploystepconfigwidget.cpp0000644000015301777760000000371612321547255033055 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeploystepconfigwidget.h" using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeployStepConfigWidget::BlackBerryDeployStepConfigWidget() : ProjectExplorer::BuildStepConfigWidget() { } QString BlackBerryDeployStepConfigWidget::summaryText() const { return displayName(); } QString BlackBerryDeployStepConfigWidget::displayName() const { return tr("Deploy packages"); } bool BlackBerryDeployStepConfigWidget::showWidget() const { return false; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnx_dependencies.pri0000644000015301777760000000025712321547255027553 0ustar pbusernogroup00000000000000QTC_PLUGIN_NAME = Qnx QTC_PLUGIN_DEPENDS += \ coreplugin \ debugger \ projectexplorer \ qmakeprojectmanager \ qtsupport \ remotelinux \ texteditor qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployconfiguration.cpp0000644000015301777760000002057312321547255032357 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeployconfiguration.h" #include "qnxconstants.h" #include "blackberrydeployconfigurationwidget.h" #include "blackberrydeployinformation.h" #include #include #include #include #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char DEPLOYMENT_INFO_KEY[] = "Qnx.BlackBerry.DeployInformation"; const char BAR_DESC_SETUP[] = "Qnx.BlackBerry.DeployInformation.BarDescriptorSetup"; } BlackBerryDeployConfiguration::BlackBerryDeployConfiguration(ProjectExplorer::Target *parent) : ProjectExplorer::DeployConfiguration(parent, Core::Id(Constants::QNX_BB_DEPLOYCONFIGURATION_ID)) { ctor(); } BlackBerryDeployConfiguration::BlackBerryDeployConfiguration(ProjectExplorer::Target *parent, BlackBerryDeployConfiguration *source) : ProjectExplorer::DeployConfiguration(parent, source) { ctor(); cloneSteps(source); } void BlackBerryDeployConfiguration::ctor() { m_deployInformation = new BlackBerryDeployInformation(target()); m_appBarDesciptorSetup = false; connect(target()->project(), SIGNAL(proFilesEvaluated()), this, SLOT(setupBarDescriptor()), Qt::UniqueConnection); setDefaultDisplayName(tr("Deploy to BlackBerry Device")); } void BlackBerryDeployConfiguration::setupBarDescriptor() { QmakeProjectManager::QmakeBuildConfiguration *bc = qobject_cast(target()->activeBuildConfiguration()); if (!bc || !target()->kit()) return; Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit()); QString projectName = target()->project()->displayName(); QString targetName; QmakeProjectManager::QmakeProject *project = static_cast(target()->project()); foreach (QmakeProjectManager::QmakeProFileNode *node, project->applicationProFiles()) { QString target = node->targetInformation().target; if (!target.isEmpty()) { targetName = target; break; } } if (deviceType == Constants::QNX_BB_OS_TYPE) { const QLatin1String barDescriptorFileName("bar-descriptor.xml"); Utils::FileName barDescriptorPath = Utils::FileName::fromString(target()->project()->projectDirectory()).appendPath(barDescriptorFileName); const QFile barDescriptorFile(barDescriptorPath.toString()); if (barDescriptorFile.exists()) return; if (m_appBarDesciptorSetup) return; QDialogButtonBox::StandardButton button = Utils::CheckableMessageBox::question(Core::ICore::mainWindow(), tr("Setup Application Descriptor File"), tr("You need to set up a bar descriptor file to enable " "packaging.\nDo you want Qt Creator to generate it for your project?"), tr("Don't ask again for this project"), &m_appBarDesciptorSetup); if (button == QDialogButtonBox::No) return; QString barDescriptorTemplate; QtSupport::QtVersionNumber qtVersion = QtSupport::QtKitInformation::qtVersion(target()->kit())->qtVersion(); if (qtVersion >= QtSupport::QtVersionNumber(5, 0, 0)) barDescriptorTemplate = Core::ICore::resourcePath() + QLatin1String("/templates/wizards/bb-qt5-bardescriptor/bar-descriptor.xml"); else barDescriptorTemplate = Core::ICore::resourcePath() + QLatin1String("/templates/wizards/bb-bardescriptor/bar-descriptor.xml"); Utils::FileReader reader; if (!reader.fetch(barDescriptorTemplate)) { QMessageBox::warning(Core::ICore::mainWindow(), tr("Cannot Set up Application Descriptor File"), tr("Reading the bar descriptor template failed."), QMessageBox::Ok); return; } QString content = QString::fromUtf8(reader.data()); content.replace(QLatin1String("PROJECTNAME"), projectName); content.replace(QLatin1String("PROJECTPATH"), targetName); content.replace(QLatin1String("ID"), QLatin1String("com.example.") + projectName); if (Utils::FileName::fromString(target()->project()->projectDirectory()) .appendPath(QLatin1String("qml")).toFileInfo().exists()) content.replace(QLatin1String(""), QLatin1String(" qml\n")); Utils::FileSaver writer(barDescriptorFile.fileName(), QIODevice::WriteOnly); writer.write(content.toUtf8()); if (!writer.finalize()) { QMessageBox::warning(Core::ICore::mainWindow(), tr("Cannot Set up Application Descriptor File"), tr("Writing the bar descriptor file failed."), QMessageBox::Ok); return; } // Add the Bar Descriptor to the existing project if (target()->project()->rootProjectNode()) addBarDescriptorToProject(barDescriptorPath.toString()); } } void BlackBerryDeployConfiguration::addBarDescriptorToProject(const QString &barDesciptorPath) { if (barDesciptorPath.isEmpty()) return; ProjectExplorer::ProjectExplorerPlugin::instance() ->addExistingFiles(target()->project()->rootProjectNode(), QStringList() << barDesciptorPath); } BlackBerryDeployConfiguration::~BlackBerryDeployConfiguration() { } BlackBerryDeployInformation *BlackBerryDeployConfiguration::deploymentInfo() const { return m_deployInformation; } ProjectExplorer::NamedWidget *BlackBerryDeployConfiguration::createConfigWidget() { return new BlackBerryDeployConfigurationWidget(this); } QVariantMap BlackBerryDeployConfiguration::toMap() const { QVariantMap map(ProjectExplorer::DeployConfiguration::toMap()); map.insert(QLatin1String(DEPLOYMENT_INFO_KEY), deploymentInfo()->toMap()); map.insert(QLatin1String(BAR_DESC_SETUP), m_appBarDesciptorSetup); return map; } bool BlackBerryDeployConfiguration::fromMap(const QVariantMap &map) { if (!ProjectExplorer::DeployConfiguration::fromMap(map)) return false; m_appBarDesciptorSetup = map.value(QLatin1String(BAR_DESC_SETUP)).toBool(); QVariantMap deployInfoMap = map.value(QLatin1String(DEPLOYMENT_INFO_KEY)).toMap(); deploymentInfo()->fromMap(deployInfoMap); return true; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenuploader.h0000644000015301777760000000444112321547255031617 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEBUGTOKENUPLOADER_H #define QNX_INTERNAL_BLACKBERRYDEBUGTOKENUPLOADER_H #include "blackberryndkprocess.h" namespace Qnx { namespace Internal { class BlackBerryDebugTokenUploader : public BlackBerryNdkProcess { Q_OBJECT public: enum ReturnStatus { NoRouteToHost = UserStatus, AuthenticationFailed, DevelopmentModeDisabled, FailedToStartInferiorProcess, InferiorProcessTimedOut, InferiorProcessCrashed, InferiorProcessWriteError, InferiorProcessReadError, InvalidDebugTokenPath }; explicit BlackBerryDebugTokenUploader(QObject *parent = 0); void uploadDebugToken(const QString &path, const QString &deviceIp, const QString &devicePassword); }; } } #endif // QNX_INTERNAL_BLACKBERRYDEBUGTOKENUPLOADER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxutils.cpp0000644000015301777760000003143612321547255026121 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxutils.h" #include "qnxabstractqtversion.h" #include #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char *EVAL_ENV_VARS[] = { "QNX_TARGET", "QNX_HOST", "QNX_CONFIGURATION", "MAKEFLAGS", "LD_LIBRARY_PATH", "PATH", "QDE", "CPUVARDIR", "PYTHONPATH" }; } QString QnxUtils::addQuotes(const QString &string) { return QLatin1Char('"') + string + QLatin1Char('"'); } Qnx::QnxArchitecture QnxUtils::cpudirToArch(const QString &cpuDir) { if (cpuDir == QLatin1String("x86")) return Qnx::X86; else if (cpuDir == QLatin1String("armle-v7")) return Qnx::ArmLeV7; else return Qnx::UnknownArch; } QStringList QnxUtils::searchPaths(QnxAbstractQtVersion *qtVersion) { const QDir pluginDir(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"))); const QStringList pluginSubDirs = pluginDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); QStringList searchPaths; Q_FOREACH (const QString &dir, pluginSubDirs) { searchPaths << qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS")) + QLatin1Char('/') + dir; } searchPaths << qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS")); searchPaths << qtVersion->qnxTarget() + QLatin1Char('/') + qtVersion->archString().toLower() + QLatin1String("/lib"); searchPaths << qtVersion->qnxTarget() + QLatin1Char('/') + qtVersion->archString().toLower() + QLatin1String("/usr/lib"); return searchPaths; } QList QnxUtils::qnxEnvironmentFromNdkFile(const QString &fileName) { QList items; if (!QFileInfo(fileName).exists()) return items; const bool isWindows = Utils::HostOsInfo::isWindowsHost(); // locking creating bbndk-env file wrapper script QTemporaryFile tmpFile( QDir::tempPath() + QDir::separator() + QLatin1String("bbndk-env-eval-XXXXXX") + QLatin1String(isWindows ? ".bat" : ".sh")); if (!tmpFile.open()) return items; tmpFile.setTextModeEnabled(true); // writing content to wrapper script QTextStream fileContent(&tmpFile); if (isWindows) fileContent << QLatin1String("@echo off\n") << QLatin1String("call ") << fileName << QLatin1Char('\n'); else fileContent << QLatin1String("#!/bin/bash\n") << QLatin1String(". ") << fileName << QLatin1Char('\n'); QString linePattern = QString::fromLatin1(isWindows ? "echo %1=%%1%" : "echo %1=$%1"); for (int i = 0, len = sizeof(EVAL_ENV_VARS) / sizeof(const char *); i < len; ++i) fileContent << linePattern.arg(QLatin1String(EVAL_ENV_VARS[i])) << QLatin1Char('\n'); tmpFile.close(); // running wrapper script QProcess process; if (isWindows) process.start(QLatin1String("cmd.exe"), QStringList() << QLatin1String("/C") << tmpFile.fileName()); else process.start(QLatin1String("/bin/bash"), QStringList() << tmpFile.fileName()); // waiting for finish QApplication::setOverrideCursor(Qt::BusyCursor); bool waitResult = process.waitForFinished(10000); QApplication::restoreOverrideCursor(); if (!waitResult) { Utils::SynchronousProcess::stopProcess(process); return items; } if (process.exitStatus() != QProcess::NormalExit || process.exitCode() != 0) return items; // parsing process output QTextStream str(&process); while (!str.atEnd()) { QString line = str.readLine(); int equalIndex = line.indexOf(QLatin1Char('=')); if (equalIndex < 0) continue; QString var = line.left(equalIndex); QString value = line.mid(equalIndex + 1); items.append(Utils::EnvironmentItem(var, value)); } return items; } bool QnxUtils::isValidNdkPath(const QString &ndkPath) { return (QFileInfo(envFilePath(ndkPath)).exists()); } QString QnxUtils::envFilePath(const QString &ndkPath, const QString &targetVersion) { QString envFile; if (Utils::HostOsInfo::isWindowsHost()) envFile = ndkPath + QLatin1String("/bbndk-env.bat"); else if (Utils::HostOsInfo::isAnyUnixHost()) envFile = ndkPath + QLatin1String("/bbndk-env.sh"); if (!QFileInfo(envFile).exists()) { QString version = targetVersion.isEmpty() ? defaultTargetVersion(ndkPath) : targetVersion; version = version.replace(QLatin1Char('.'), QLatin1Char('_')); if (Utils::HostOsInfo::isWindowsHost()) envFile = ndkPath + QLatin1String("/bbndk-env_") + version + QLatin1String(".bat"); else if (Utils::HostOsInfo::isAnyUnixHost()) envFile = ndkPath + QLatin1String("/bbndk-env_") + version + QLatin1String(".sh"); } return envFile; } Utils::FileName QnxUtils::executableWithExtension(const Utils::FileName &fileName) { Utils::FileName result = fileName; if (Utils::HostOsInfo::isWindowsHost()) result.append(QLatin1String(".exe")); return result; } QString QnxUtils::dataDirPath() { const QString homeDir = QDir::homePath(); if (Utils::HostOsInfo::isMacHost()) return homeDir + QLatin1String("/Library/Research in Motion"); if (Utils::HostOsInfo::isAnyUnixHost()) return homeDir + QLatin1String("/.rim"); if (Utils::HostOsInfo::isWindowsHost()) { // Get the proper storage location on Windows using QDesktopServices, // to not hardcode "AppData/Local", as it might refer to "AppData/Roaming". QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); dataDir = dataDir.left(dataDir.indexOf(QCoreApplication::organizationName())); dataDir.append(QLatin1String("Research in Motion")); return dataDir; } return QString(); } QString QnxUtils::qConfigPath() { if (Utils::HostOsInfo::isMacHost() || Utils::HostOsInfo::isWindowsHost()) return dataDirPath() + QLatin1String("/BlackBerry Native SDK/qconfig"); else return dataDirPath() + QLatin1String("/bbndk/qconfig"); } QString QnxUtils::defaultTargetVersion(const QString &ndkPath) { foreach (const NdkInstallInformation &ndkInfo, installedNdks()) { if (!ndkInfo.path.compare(ndkPath, Utils::HostOsInfo::fileNameCaseSensitivity())) return ndkInfo.version; } return QString(); } QList QnxUtils::installedNdks() { QList ndkList; QString ndkConfigPath = qConfigPath(); if (!QDir(ndkConfigPath).exists()) return ndkList; QFileInfoList ndkfileList = QDir(ndkConfigPath).entryInfoList(QStringList() << QLatin1String("*.xml"), QDir::Files, QDir::Time); foreach (const QFileInfo &ndkFile, ndkfileList) { QFile xmlFile(ndkFile.absoluteFilePath()); if (!xmlFile.open(QIODevice::ReadOnly)) continue; QDomDocument doc; if (!doc.setContent(&xmlFile)) // Skip error message continue; QDomElement docElt = doc.documentElement(); if (docElt.tagName() != QLatin1String("qnxSystemDefinition")) continue; QDomElement childElt = docElt.firstChildElement(QLatin1String("installation")); // The file contains only one installation node if (!childElt.isNull()) { // The file contains only one base node NdkInstallInformation ndkInfo; ndkInfo.path = childElt.firstChildElement(QLatin1String("base")).text(); ndkInfo.name = childElt.firstChildElement(QLatin1String("name")).text(); ndkInfo.host = childElt.firstChildElement(QLatin1String("host")).text(); ndkInfo.target = childElt.firstChildElement(QLatin1String("target")).text(); ndkInfo.version = childElt.firstChildElement(QLatin1String("version")).text(); ndkList.append(ndkInfo); } } return ndkList; } QString QnxUtils::sdkInstallerPath(const QString &ndkPath) { QString sdkinstallPath; if (Utils::HostOsInfo::isWindowsHost()) sdkinstallPath = ndkPath + QLatin1String("/qde.exe"); else sdkinstallPath = ndkPath + QLatin1String("/qde"); if (QFileInfo(sdkinstallPath).exists()) return sdkinstallPath; return QString(); } // The resulting process when launching sdkinstall QString QnxUtils::qdeInstallProcess(const QString &ndkPath, const QString &option, const QString &version) { QString installerPath = sdkInstallerPath(ndkPath); if (installerPath.isEmpty()) return QString(); const QDir pluginDir(ndkPath + QLatin1String("/plugins")); const QStringList installerPlugins = pluginDir.entryList(QStringList() << QLatin1String("com.qnx.tools.ide.sdk.installer.app_*.jar")); const QString installerApplication = installerPlugins.size() >= 1 ? QLatin1String("com.qnx.tools.ide.sdk.installer.app.SDKInstallerApplication") : QLatin1String("com.qnx.tools.ide.sdk.manager.core.SDKInstallerApplication"); return QString::fromLatin1("%1 -nosplash -application %2 " "%3 %4 -vmargs -Dosgi.console=:none").arg(installerPath, installerApplication, option, version); } QList QnxUtils::qnxEnvironment(const QString &sdkPath) { // Mimic what the SDP installer puts into the system environment QList environmentItems; if (Utils::HostOsInfo::isWindowsHost()) { // TODO: //environment.insert(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx")); environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath + QLatin1String("/target/qnx6"))); environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_HOST_KEY), sdkPath + QLatin1String("/host/win32/x86"))); environmentItems.append(Utils::EnvironmentItem(QLatin1String("PATH"), sdkPath + QLatin1String("/host/win32/x86/usr/bin;%PATH%"))); // TODO: //environment.insert(QLatin1String("PATH"), QLatin1String("/etc/qnx/bin")); } else if (Utils::HostOsInfo::isAnyUnixHost()) { environmentItems.append(Utils::EnvironmentItem(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx"))); environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath + QLatin1String("/target/qnx6"))); environmentItems.append(Utils::EnvironmentItem(QLatin1String(Constants::QNX_HOST_KEY), sdkPath + QLatin1String("/host/linux/x86"))); environmentItems.append(Utils::EnvironmentItem(QLatin1String("PATH"), sdkPath + QLatin1String("/host/linux/x86/usr/bin:/etc/qnx/bin:${PATH}"))); environmentItems.append(Utils::EnvironmentItem(QLatin1String("LD_LIBRARY_PATH"), sdkPath + QLatin1String("/host/linux/x86/usr/lib:${LD_LIBRARY_PATH}"))); } environmentItems.append(Utils::EnvironmentItem(QLatin1String("QNX_JAVAHOME"), sdkPath + QLatin1String("/_jvm"))); environmentItems.append(Utils::EnvironmentItem(QLatin1String("MAKEFLAGS"), QLatin1String("-I") + sdkPath + QLatin1String("/target/qnx6/usr/include"))); return environmentItems; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorenvironmentwidget.cpp0000644000015301777760000000600412321547255033766 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorenvironmentwidget.h" #include "ui_bardescriptoreditorenvironmentwidget.h" using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorEnvironmentWidget::BarDescriptorEditorEnvironmentWidget(QWidget *parent) : BarDescriptorEditorAbstractPanelWidget(parent), m_ui(new Ui::BarDescriptorEditorEnvironmentWidget) { m_ui->setupUi(this); m_ui->environmentWidget->setBaseEnvironmentText(tr("Device Environment")); connect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed())); } BarDescriptorEditorEnvironmentWidget::~BarDescriptorEditorEnvironmentWidget() { delete m_ui; } void BarDescriptorEditorEnvironmentWidget::clear() { disconnect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed())); m_ui->environmentWidget->setUserChanges(QList()); connect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed())); } QList BarDescriptorEditorEnvironmentWidget::environment() const { return m_ui->environmentWidget->userChanges(); } void BarDescriptorEditorEnvironmentWidget::appendEnvironmentItem(const Utils::EnvironmentItem &envItem) { disconnect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed())); QList items = m_ui->environmentWidget->userChanges(); items.append(envItem); m_ui->environmentWidget->setUserChanges(items); connect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed())); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorentrypointwidget.h0000644000015301777760000000752312321547255033311 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORENTRYPOINTWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORENTRYPOINTWIDGET_H #include "bardescriptoreditorabstractpanelwidget.h" #include QT_BEGIN_NAMESPACE class QItemSelection; class QLabel; class QStringListModel; QT_END_NAMESPACE namespace Qnx { namespace Internal { namespace Ui { class BarDescriptorEditorEntryPointWidget; } class BarDescriptorEditorEntryPointWidget : public BarDescriptorEditorAbstractPanelWidget { Q_OBJECT public: explicit BarDescriptorEditorEntryPointWidget(QWidget *parent = 0); ~BarDescriptorEditorEntryPointWidget(); void clear(); QString applicationName() const; void setApplicationName(const QString &applicationName); QString applicationDescription() const; void setApplicationDescription(const QString &applicationDescription); QString applicationIconFileName() const; void setApplicationIcon(const QString &iconPath); QStringList splashScreens() const; void appendSplashScreen(const QString &splashScreenPath); void setAssetsModel(QStandardItemModel *assetsModel); signals: void imageAdded(const QString &path); void imageRemoved(const QString &path); private slots: void setApplicationIconDelayed(const QString &iconPath); void setApplicationIconPreview(const QString &path); void validateIconSize(const QString &path); void handleIconChanged(const QString &path); void clearIcon(); void browseForSplashScreen(); void removeSelectedSplashScreen(); void handleSplashScreenSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); void appendSplashScreenDelayed(const QString &splashScreenPath); private: enum ImageValidationResult { Valid, CouldNotLoad, IncorrectSize }; void setImagePreview(QLabel *previewLabel, const QString &path); void validateSplashScreenSize(const QString &path); void validateImage(const QString &path, QLabel *warningMessage, QLabel *warningPixmap, const QSize &maximumSize); QString localAssetPathFromDestination(const QString &path); QStringListModel *m_splashScreenModel; QWeakPointer m_assetsModel; QString m_prevIconPath; Ui::BarDescriptorEditorEntryPointWidget *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORENTRYPOINTWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorentrypointwidget.cpp0000644000015301777760000002775712321547255033657 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorentrypointwidget.h" #include "ui_bardescriptoreditorentrypointwidget.h" #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { // Recommended maximum size for icons according to // http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/r_barfile_dtd_ref_image.html static int AppIconMaxWidth = 114; static int AppIconMaxHeight = 114; // Recommended maximum size for splashscreens according to // http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/r_barfile_dtd_ref_splashscreens.html static int SplashScreenMaxWidth = 1280; static int SplashScreenMaxHeight = 1280; } BarDescriptorEditorEntryPointWidget::BarDescriptorEditorEntryPointWidget(QWidget *parent) : BarDescriptorEditorAbstractPanelWidget(parent), m_ui(new Ui::BarDescriptorEditorEntryPointWidget) { m_ui->setupUi(this); m_ui->iconFilePath->setExpectedKind(Utils::PathChooser::File); m_ui->iconFilePath->setPromptDialogFilter(tr("Images (*.jpg *.png)")); m_ui->iconWarningLabel->setVisible(false); m_ui->iconWarningPixmap->setVisible(false); m_ui->splashScreenWarningLabel->setVisible(false); m_ui->splashScreenWarningPixmap->setVisible(false); connect(m_ui->applicationName, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); connect(m_ui->applicationDescription, SIGNAL(textChanged()), this, SIGNAL(changed())); connect(m_ui->iconFilePath, SIGNAL(changed(QString)), this, SLOT(handleIconChanged(QString))); connect(m_ui->iconClearButton, SIGNAL(clicked()), this, SLOT(clearIcon())); m_splashScreenModel = new QStringListModel(this); m_ui->splashScreensView->setModel(m_splashScreenModel); connect(m_ui->addSplashScreen, SIGNAL(clicked()), this, SLOT(browseForSplashScreen())); connect(m_ui->removeSplashScreen, SIGNAL(clicked()), this, SLOT(removeSelectedSplashScreen())); connect(m_splashScreenModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); connect(m_ui->splashScreensView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(handleSplashScreenSelectionChanged(QItemSelection,QItemSelection))); } BarDescriptorEditorEntryPointWidget::~BarDescriptorEditorEntryPointWidget() { delete m_ui; } void BarDescriptorEditorEntryPointWidget::clear() { setPathChooserBlocked(m_ui->iconFilePath, QString()); setApplicationIconPreview(QString()); disconnect(m_splashScreenModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); m_splashScreenModel->setStringList(QStringList()); connect(m_splashScreenModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); setImagePreview(m_ui->splashScreenPreviewLabel, QString()); } QString BarDescriptorEditorEntryPointWidget::applicationName() const { return m_ui->applicationName->text(); } void BarDescriptorEditorEntryPointWidget::setApplicationName(const QString &applicationName) { setLineEditBlocked(m_ui->applicationName, applicationName); } QString BarDescriptorEditorEntryPointWidget::applicationDescription() const { return m_ui->applicationDescription->toPlainText(); } void BarDescriptorEditorEntryPointWidget::setApplicationDescription(const QString &applicationDescription) { setTextEditBlocked(m_ui->applicationDescription, applicationDescription); } QString BarDescriptorEditorEntryPointWidget::applicationIconFileName() const { return QFileInfo(m_ui->iconFilePath->path()).fileName(); } void BarDescriptorEditorEntryPointWidget::setApplicationIcon(const QString &iconPath) { // During file loading, the assets might not have been read yet QMetaObject::invokeMethod(this, "setApplicationIconDelayed", Qt::QueuedConnection, Q_ARG(QString, iconPath)); } QStringList BarDescriptorEditorEntryPointWidget::splashScreens() const { QStringList result; foreach (const QString &splashScreen, m_splashScreenModel->stringList()) result << QFileInfo(splashScreen).fileName(); return result; } void BarDescriptorEditorEntryPointWidget::appendSplashScreen(const QString &splashScreenPath) { QMetaObject::invokeMethod(this, "appendSplashScreenDelayed", Qt::QueuedConnection, Q_ARG(QString, splashScreenPath)); } void BarDescriptorEditorEntryPointWidget::setAssetsModel(QStandardItemModel *assetsModel) { m_assetsModel = QWeakPointer(assetsModel); } void BarDescriptorEditorEntryPointWidget::setApplicationIconPreview(const QString &path) { setImagePreview(m_ui->iconPreviewLabel, path); } void BarDescriptorEditorEntryPointWidget::validateIconSize(const QString &path) { validateImage(path, m_ui->iconWarningLabel, m_ui->iconWarningPixmap, QSize(AppIconMaxWidth, AppIconMaxHeight)); } void BarDescriptorEditorEntryPointWidget::handleIconChanged(const QString &path) { if (path == m_prevIconPath) return; setApplicationIconPreview(path); validateIconSize(path); emit changed(); emit imageRemoved(m_prevIconPath); m_prevIconPath = path; if (QFileInfo(path).exists()) emit imageAdded(path); } void BarDescriptorEditorEntryPointWidget::clearIcon() { m_ui->iconFilePath->setPath(QString()); } void BarDescriptorEditorEntryPointWidget::browseForSplashScreen() { const QString fileName = QFileDialog::getOpenFileName(this, tr("Select Splash Screen"), QString(), tr("Images (*.jpg *.png)")); if (fileName.isEmpty()) return; if (m_splashScreenModel->stringList().contains(fileName)) return; int rowCount = m_splashScreenModel->rowCount(); m_splashScreenModel->insertRow(rowCount); m_splashScreenModel->setData(m_splashScreenModel->index(rowCount), fileName); emit imageAdded(fileName); } void BarDescriptorEditorEntryPointWidget::removeSelectedSplashScreen() { QModelIndexList selectedIndexes = m_ui->splashScreensView->selectionModel()->selectedRows(); if (selectedIndexes.isEmpty()) return; foreach (const QModelIndex &index, selectedIndexes) { QString path = m_splashScreenModel->data(index, Qt::DisplayRole).toString(); emit imageRemoved(path); m_splashScreenModel->removeRow(index.row()); } } void BarDescriptorEditorEntryPointWidget::handleSplashScreenSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { Q_UNUSED(deselected); const bool emptySelection = selected.indexes().isEmpty(); m_ui->removeSplashScreen->setEnabled(!emptySelection); if (!emptySelection) { QString path = m_splashScreenModel->data(selected.indexes().at(0), Qt::DisplayRole).toString(); setImagePreview(m_ui->splashScreenPreviewLabel, path); validateSplashScreenSize(path); } else { setImagePreview(m_ui->splashScreenPreviewLabel, QString()); m_ui->splashScreenWarningLabel->setVisible(false); m_ui->splashScreenWarningPixmap->setVisible(false); } } void BarDescriptorEditorEntryPointWidget::appendSplashScreenDelayed(const QString &splashScreenPath) { const QString fullSplashScreenPath = localAssetPathFromDestination(splashScreenPath); if (fullSplashScreenPath.isEmpty()) return; disconnect(m_splashScreenModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); int rowCount = m_splashScreenModel->rowCount(); m_splashScreenModel->insertRow(rowCount); m_splashScreenModel->setData(m_splashScreenModel->index(rowCount), fullSplashScreenPath); connect(m_splashScreenModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); } void BarDescriptorEditorEntryPointWidget::setImagePreview(QLabel *previewLabel, const QString &path) { if (path.isEmpty()) { previewLabel->clear(); return; } QPixmap originalPixmap(path); if (originalPixmap.isNull()) { previewLabel->clear(); return; } QSize size = previewLabel->minimumSize(); QPixmap scaledPixmap = originalPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); if (scaledPixmap.isNull()) { previewLabel->clear(); return; } previewLabel->setPixmap(scaledPixmap); } void BarDescriptorEditorEntryPointWidget::validateSplashScreenSize(const QString &path) { validateImage(path, m_ui->splashScreenWarningLabel, m_ui->splashScreenWarningPixmap, QSize(SplashScreenMaxWidth, SplashScreenMaxHeight)); } void BarDescriptorEditorEntryPointWidget::validateImage(const QString &path, QLabel *warningMessage, QLabel *warningPixmap, const QSize &maximumSize) { ImageValidationResult result = Valid; QSize actualSize; if (!path.isEmpty()) { QImage img(path); if (img.isNull()) { result = CouldNotLoad; } else { actualSize = img.size(); if (actualSize.width() > maximumSize.width() || actualSize.height() > maximumSize.height()) result = IncorrectSize; } } switch (result) { case CouldNotLoad: warningMessage->setText(tr("Could not open '%1' for reading.").arg(path)); warningMessage->setVisible(true); warningPixmap->setVisible(true); break; case IncorrectSize: { warningMessage->setText(tr("The selected image is too big (%1x%2). The maximum size is %3x%4 pixels.") .arg(actualSize.width()).arg(actualSize.height()) .arg(maximumSize.width()).arg(maximumSize.height())); warningMessage->setVisible(true); warningPixmap->setVisible(true); break; } case Valid: default: warningMessage->setVisible(false); warningPixmap->setVisible(false); break; } } void BarDescriptorEditorEntryPointWidget::setApplicationIconDelayed(const QString &iconPath) { const QString fullIconPath = localAssetPathFromDestination(iconPath); if (fullIconPath.isEmpty()) return; setPathChooserBlocked(m_ui->iconFilePath, fullIconPath); setApplicationIconPreview(fullIconPath); validateIconSize(fullIconPath); } QString BarDescriptorEditorEntryPointWidget::localAssetPathFromDestination(const QString &destination) { if (!m_assetsModel) return QString(); for (int i = 0; i < m_assetsModel.data()->rowCount(); ++i) { QStandardItem *destItem = m_assetsModel.data()->item(i, 1); if (destItem->text() == destination) return m_assetsModel.data()->item(i, 0)->text(); } return QString(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxtoolchain.h0000644000015301777760000000664612321547255026413 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNXTOOLCHAIN_H #define QNXTOOLCHAIN_H #include #include namespace Qnx { namespace Internal { class QnxToolChain : public ProjectExplorer::GccToolChain { public: explicit QnxToolChain(Detection d); QString type() const; QString typeDisplayName() const; ProjectExplorer::ToolChainConfigWidget *configurationWidget(); void addToEnvironment(Utils::Environment &env) const; QList suggestedMkspecList() const; QVariantMap toMap() const; bool fromMap(const QVariantMap &data); QString ndkPath() const; void setNdkPath(const QString &ndkPath); protected: virtual QList detectSupportedAbis() const; QStringList reinterpretOptions(const QStringList &args) const; private: QString m_ndkPath; }; // -------------------------------------------------------------------------- // QnxToolChainFactory // -------------------------------------------------------------------------- class QnxToolChainFactory : public ProjectExplorer::ToolChainFactory { Q_OBJECT public: QnxToolChainFactory(); bool canRestore(const QVariantMap &data); ProjectExplorer::ToolChain *restore(const QVariantMap &data); bool canCreate(); ProjectExplorer::ToolChain *create(); }; //---------------------------------------------------------------------------- // QnxToolChainConfigWidget //---------------------------------------------------------------------------- class QnxToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidget { Q_OBJECT public: QnxToolChainConfigWidget(QnxToolChain *tc); private: void applyImpl(); void discardImpl(); bool isDirtyImpl() const; void makeReadOnlyImpl() {} Utils::PathChooser *m_compilerCommand; Utils::PathChooser *m_ndkPath; ProjectExplorer::AbiWidget *m_abiWidget; }; } // namespace Internal } // namespace Qnx #endif // QNXTOOLCHAIN_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenrequestdialog.cpp0000644000015301777760000002172312321547255033211 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydebugtokenrequestdialog.h" #include "blackberrydebugtokenrequester.h" #include "blackberrydeviceinformation.h" #include "blackberryconfigurationmanager.h" #include "blackberrysigningutils.h" #include "ui_blackberrydebugtokenrequestdialog.h" #include #include #include namespace Qnx { namespace Internal { BlackBerryDebugTokenRequestDialog::BlackBerryDebugTokenRequestDialog( QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), m_ui(new Ui_BlackBerryDebugTokenRequestDialog), m_requester(new BlackBerryDebugTokenRequester(this)), m_deviceInfo(new BlackBerryDeviceInformation(this)), m_utils(BlackBerrySigningUtils::instance()) { m_ui->setupUi(this); m_ui->progressBar->hide(); m_ui->status->clear(); m_ui->debugTokenPath->setExpectedKind(Utils::PathChooser::SaveFile); m_ui->debugTokenPath->setPromptDialogTitle(tr("Request Debug Token")); m_ui->debugTokenPath->setPromptDialogFilter(tr("BAR Files (*.bar)")); m_cancelButton = m_ui->buttonBox->button(QDialogButtonBox::Cancel); m_okButton = m_ui->buttonBox->button(QDialogButtonBox::Ok); m_okButton->setEnabled(false); connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); connect(m_okButton, SIGNAL(clicked()), this, SLOT(requestDebugToken())); connect(m_ui->debugTokenPath, SIGNAL(changed(QString)), this, SLOT(validate())); connect(m_ui->debugTokenPath, SIGNAL(beforeBrowsing()), this, SLOT(setDefaultPath())); connect(m_ui->debugTokenPath, SIGNAL(editingFinished()), this, SLOT(appendExtension())); connect(m_ui->debugTokenPath, SIGNAL(editingFinished()), this, SLOT(expandPath())); connect(m_ui->devicePin, SIGNAL(textChanged(QString)), this, SLOT(validate())); connect(m_requester, SIGNAL(finished(int)), this, SLOT(debugTokenArrived(int))); connect(m_deviceInfo, SIGNAL(finished(int)), this, SLOT(setDevicePin(int))); } BlackBerryDebugTokenRequestDialog::~BlackBerryDebugTokenRequestDialog() { delete m_ui; } QString BlackBerryDebugTokenRequestDialog::debugToken() const { return m_ui->debugTokenPath->path(); } void BlackBerryDebugTokenRequestDialog::setDevicePin(const QString &devicePin) { m_ui->devicePin->setText(devicePin); } void BlackBerryDebugTokenRequestDialog::setTargetDetails(const QString &deviceIp, const QString &password) { m_ui->devicePin->setPlaceholderText(tr("Requesting Device PIN...")); m_deviceInfo->setDeviceTarget(deviceIp, password); } void BlackBerryDebugTokenRequestDialog::validate() { if (!m_ui->debugTokenPath->isValid() || m_ui->devicePin->text().isEmpty()) { m_okButton->setEnabled(false); return; } QFileInfo fileInfo(m_ui->debugTokenPath->path()); if (!fileInfo.dir().exists()) { m_ui->status->setText(tr("Base directory does not exist.")); m_okButton->setEnabled(false); return; } m_ui->status->clear(); m_okButton->setEnabled(true); } void BlackBerryDebugTokenRequestDialog::requestDebugToken() { setBusy(true); QFile file(m_ui->debugTokenPath->path()); if (file.exists()) { const int result = QMessageBox::question(this, tr("Are you sure?"), tr("The file '%1' will be overwritten. Do you want to proceed?") .arg(file.fileName()), QMessageBox::Yes | QMessageBox::No); if (result & QMessageBox::Yes) { file.remove(); } else { setBusy(false); return; } } BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); m_requester->requestDebugToken(m_ui->debugTokenPath->path(), m_utils.cskPassword(), configuration.defaultKeystorePath(), m_utils.certificatePassword(), m_ui->devicePin->text()); } void BlackBerryDebugTokenRequestDialog::setDefaultPath() { const QString path = m_ui->debugTokenPath->path(); const QString defaultFileName = QLatin1String("/debugToken.bar"); if (path.isEmpty()) { m_ui->debugTokenPath->setPath(QDir::homePath() + defaultFileName); return; } const QFileInfo fileInfo(path); if (fileInfo.isDir()) m_ui->debugTokenPath->setPath(path + defaultFileName); } void BlackBerryDebugTokenRequestDialog::appendExtension() { QString path = m_ui->debugTokenPath->path(); if (path.isEmpty()) return; if (!path.endsWith(QLatin1String(".bar"))) { path += QLatin1String(".bar"); m_ui->debugTokenPath->setPath(path); } } void BlackBerryDebugTokenRequestDialog::expandPath() { const QString path = m_ui->debugTokenPath->path(); if (path.isEmpty() || path.startsWith(QLatin1Char('/'))) return; const QFileInfo fileInfo(path); m_ui->debugTokenPath->setPath(fileInfo.absoluteFilePath()); } void BlackBerryDebugTokenRequestDialog::debugTokenArrived(int status) { QString errorString = tr("Failed to request debug token:") + QLatin1Char(' '); switch (status) { case BlackBerryDebugTokenRequester::Success: accept(); return; case BlackBerryDebugTokenRequester::WrongCskPassword: m_utils.clearCskPassword(); errorString += tr("Wrong CSK password."); break; case BlackBerryDebugTokenRequester::WrongKeystorePassword: m_utils.clearCertificatePassword(); errorString += tr("Wrong keystore password."); break; case BlackBerryDebugTokenRequester::NetworkUnreachable: errorString += tr("Network unreachable."); break; case BlackBerryDebugTokenRequester::IllegalPin: errorString += tr("Illegal device PIN."); break; case BlackBerryDebugTokenRequester::FailedToStartInferiorProcess: errorString += tr("Failed to start inferior process."); break; case BlackBerryDebugTokenRequester::InferiorProcessTimedOut: errorString += tr("Inferior processes timed out."); break; case BlackBerryDebugTokenRequester::InferiorProcessCrashed: errorString += tr("Inferior process has crashed."); break; case BlackBerryDebugTokenRequester::InferiorProcessReadError: case BlackBerryDebugTokenRequester::InferiorProcessWriteError: errorString += tr("Failed to communicate with the inferior process."); break; case BlackBerryDebugTokenRequester::NotYetRegistered: errorString += tr("Not yet registered to request debug tokens."); break; case BlackBerryDebugTokenRequester::UnknownError: default: m_utils.clearCertificatePassword(); m_utils.clearCskPassword(); errorString += tr("An unknwon error has occurred."); break; } QMessageBox::critical(this, tr("Error"), errorString); setBusy(false); } void BlackBerryDebugTokenRequestDialog::setDevicePin(int status) { m_ui->devicePin->setPlaceholderText(QString()); if (status != BlackBerryDeviceInformation::Success) return; const QString devicePin = m_deviceInfo->devicePin(); if (devicePin.isEmpty()) return; m_ui->devicePin->setText(devicePin); } void BlackBerryDebugTokenRequestDialog::setBusy(bool busy) { m_okButton->setEnabled(!busy); m_cancelButton->setEnabled(!busy); m_ui->debugTokenPath->setEnabled(!busy); m_ui->devicePin->setEnabled(!busy); m_ui->progressBar->setVisible(busy); if (busy) m_ui->status->setText(tr("Requesting debug token...")); else m_ui->status->clear(); } } } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxqtversion.h0000644000015301777760000000455212321547255026457 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXQTVERSION_H #define QNX_INTERNAL_QNXQTVERSION_H #include "qnxconstants.h" #include "qnxabstractqtversion.h" namespace Qnx { namespace Internal { class QnxQtVersion : public QnxAbstractQtVersion { Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxQtVersion) public: QnxQtVersion(); QnxQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); QnxQtVersion *clone() const; ~QnxQtVersion(); QString type() const; QString description() const; Core::FeatureSet availableFeatures() const; QString platformName() const; QString platformDisplayName() const; QString sdkDescription() const; private: QList environment() const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXQTVERSION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxtoolchain.cpp0000644000015301777760000002111212321547255026727 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxtoolchain.h" #include "qnxconstants.h" #include "qnxutils.h" #include "blackberryconfigurationmanager.h" #include "blackberryconfiguration.h" #include #include using namespace ProjectExplorer; namespace Qnx { namespace Internal { static const char CompilernNdkPath[] = "Qnx.QnxToolChain.NDKPath"; static const QList qccSupportedAbis() { QList abis; abis << Abi(Abi::ArmArchitecture, Abi::LinuxOS, Abi::GenericLinuxFlavor, Abi::ElfFormat, 32); abis << Abi(Abi::X86Architecture, Abi::LinuxOS, Abi::GenericLinuxFlavor, Abi::ElfFormat, 32); return abis; } static void setQnxEnvironment(Utils::Environment &env, const QList &qnxEnv) { // We only need to set QNX_HOST and QNX_TARGET needed when running qcc foreach (const Utils::EnvironmentItem &item, qnxEnv) { if (item.name == QLatin1String("QNX_HOST") || item.name == QLatin1String("QNX_TARGET") ) env.set(item.name, item.value); } } QnxToolChain::QnxToolChain(ToolChain::Detection d) : GccToolChain(QLatin1String(Constants::QNX_TOOLCHAIN_ID), d) { } QString QnxToolChain::type() const { return QLatin1String(Constants::QNX_TOOLCHAIN_ID); } QString QnxToolChain::typeDisplayName() const { return QnxToolChainFactory::tr("QCC"); } ToolChainConfigWidget *QnxToolChain::configurationWidget() { return new QnxToolChainConfigWidget(this); } void QnxToolChain::addToEnvironment(Utils::Environment &env) const { foreach (BlackBerryConfiguration* config, BlackBerryConfigurationManager::instance().configurations()) { if (config->gccCompiler() == compilerCommand()) { setQnxEnvironment(env, config->qnxEnv()); break; } } if (env.value(QLatin1String("QNX_HOST")).isEmpty() || env.value(QLatin1String("QNX_TARGET")).isEmpty()) setQnxEnvironment(env, QnxUtils::qnxEnvironment(m_ndkPath)); GccToolChain::addToEnvironment(env); } QList QnxToolChain::suggestedMkspecList() const { QList mkspecList; mkspecList << Utils::FileName::fromString(QLatin1String("qnx-armv7le-qcc")); mkspecList << Utils::FileName::fromString(QLatin1String("qnx-x86-qcc")); mkspecList << Utils::FileName::fromString(QLatin1String("blackberry-armv7le-qcc")); mkspecList << Utils::FileName::fromString(QLatin1String("blackberry-x86-qcc")); return mkspecList; } QVariantMap QnxToolChain::toMap() const { QVariantMap data = GccToolChain::toMap(); data.insert(QLatin1String(CompilernNdkPath), m_ndkPath); return data; } bool QnxToolChain::fromMap(const QVariantMap &data) { if (!GccToolChain::fromMap(data)) return false; m_ndkPath = data.value(QLatin1String(CompilernNdkPath)).toString(); return true; } QString QnxToolChain::ndkPath() const { return m_ndkPath; } void QnxToolChain::setNdkPath(const QString &ndkPath) { m_ndkPath = ndkPath; } // qcc doesn't support a "-dumpmachine" option to get supported abis QList QnxToolChain::detectSupportedAbis() const { return qccSupportedAbis(); } // Qcc is a multi-compiler driver, and most of the gcc options can be accomplished by using the -Wp, and -Wc // options to pass the options directly down to the compiler QStringList QnxToolChain::reinterpretOptions(const QStringList &args) const { QStringList arguments; foreach (const QString &str, args) { if (str.startsWith(QLatin1String("--sysroot="))) continue; QString arg = str; if (arg == QLatin1String("-v") || arg == QLatin1String("-dM")) arg.prepend(QLatin1String("-Wp,")); arguments << arg; } return arguments; } // -------------------------------------------------------------------------- // QnxToolChainFactory // -------------------------------------------------------------------------- QnxToolChainFactory::QnxToolChainFactory() { setId(Constants::QNX_TOOLCHAIN_ID); setDisplayName(tr("QCC")); } bool QnxToolChainFactory::canRestore(const QVariantMap &data) { const QString id = idFromMap(data); return id.startsWith(QLatin1String(Constants::QNX_TOOLCHAIN_ID) + QLatin1Char(':')); } ToolChain *QnxToolChainFactory::restore(const QVariantMap &data) { QnxToolChain *tc = new QnxToolChain(ToolChain::ManualDetection); if (tc->fromMap(data)) return tc; delete tc; return 0; } bool QnxToolChainFactory::canCreate() { return true; } ToolChain *QnxToolChainFactory::create() { return new QnxToolChain(ToolChain::ManualDetection); } //--------------------------------------------------------------------------------- // QnxToolChainConfigWidget //--------------------------------------------------------------------------------- QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc) : ToolChainConfigWidget(tc) , m_compilerCommand(new Utils::PathChooser) , m_ndkPath(new Utils::PathChooser) , m_abiWidget(new AbiWidget) { m_compilerCommand->setExpectedKind(Utils::PathChooser::ExistingCommand); m_compilerCommand->setFileName(tc->compilerCommand()); m_compilerCommand->setEnabled(!tc->isAutoDetected()); m_ndkPath->setExpectedKind(Utils::PathChooser::ExistingDirectory); m_ndkPath->setPath(tc->ndkPath()); m_ndkPath->setEnabled(!tc->isAutoDetected()); m_abiWidget->setAbis(qccSupportedAbis(), tc->targetAbi()); m_abiWidget->setEnabled(!tc->isAutoDetected()); m_mainLayout->addRow(tr("&Compiler path:"), m_compilerCommand); //: SDP refers to 'Software Development Platform'. m_mainLayout->addRow(tr("NDK/SDP path:"), m_ndkPath); m_mainLayout->addRow(tr("&ABI:"), m_abiWidget); connect(m_compilerCommand, SIGNAL(changed(QString)), this, SIGNAL(dirty())); connect(m_ndkPath, SIGNAL(changed(QString)), this, SIGNAL(dirty())); connect(m_abiWidget, SIGNAL(abiChanged()), this, SIGNAL(dirty())); } void QnxToolChainConfigWidget::applyImpl() { if (toolChain()->isAutoDetected()) return; QnxToolChain *tc = static_cast(toolChain()); Q_ASSERT(tc); QString displayName = tc->displayName(); tc->setCompilerCommand(m_compilerCommand->fileName()); tc->setDisplayName(displayName); // reset display name tc->setNdkPath(m_ndkPath->fileName().toString()); tc->setTargetAbi(m_abiWidget->currentAbi()); } void QnxToolChainConfigWidget::discardImpl() { // subwidgets are not yet connected! bool blocked = blockSignals(true); QnxToolChain *tc = static_cast(toolChain()); m_compilerCommand->setFileName(tc->compilerCommand()); m_ndkPath->setPath(tc->ndkPath()); m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi()); if (!m_compilerCommand->path().isEmpty()) m_abiWidget->setEnabled(true); blockSignals(blocked); } bool QnxToolChainConfigWidget::isDirtyImpl() const { QnxToolChain *tc = static_cast(toolChain()); Q_ASSERT(tc); return m_compilerCommand->fileName() != tc->compilerCommand() || m_ndkPath->path() != tc->ndkPath() || m_abiWidget->currentAbi() != tc->targetAbi(); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydevicelistdetector.cpp0000644000015301777760000000705612321547255032161 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydevicelistdetector.h" #include "blackberryconfigurationmanager.h" #include "blackberryndkprocess.h" #include #include namespace Qnx { namespace Internal { BlackBerryDeviceListDetector::BlackBerryDeviceListDetector(QObject *parent) : QObject(parent) , m_process(new QProcess(this)) { m_process->setProcessChannelMode(QProcess::MergedChannels); connect(m_process, SIGNAL(readyRead()), this, SLOT(processReadyRead())); connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished())); connect(m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processFinished())); } void BlackBerryDeviceListDetector::detectDeviceList() { if (m_process->state() != QProcess::NotRunning) return; m_process->setEnvironment(Utils::EnvironmentItem::toStringList( BlackBerryConfigurationManager::instance().defaultQnxEnv())); const QString command = BlackBerryNdkProcess::resolveNdkToolPath(QLatin1String("blackberry-deploy")); QStringList arguments; arguments << QLatin1String("-devices"); m_process->start(command, arguments, QIODevice::ReadWrite | QIODevice::Unbuffered); } void BlackBerryDeviceListDetector::processReadyRead() { while (m_process->canReadLine()) processData(readProcessLine()); } void BlackBerryDeviceListDetector::processFinished() { while (!m_process->atEnd()) processData(readProcessLine()); emit finished(); } const QString BlackBerryDeviceListDetector::readProcessLine() { // we assume that the process output is ASCII only QByteArray bytes = m_process->readLine(); while (bytes.endsWith('\r') || bytes.endsWith('\n')) bytes.chop(1); return QString::fromLocal8Bit(bytes); } void BlackBerryDeviceListDetector::processData(const QString &line) { // line format is: deviceName,deviceHostNameOrIP,deviceType,versionIfSimulator QStringList list = line.split(QLatin1String(",")); if (list.count() == 4) emit deviceDetected (list[0], list[1], QLatin1String("Simulator") == list[2]); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployconfigurationwidget.ui0000644000015301777760000000203112321547255033403 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryDeployConfigurationWidget 0 0 599 213 Packages to deploy: true Qt::ElideLeft false false ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardpages.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardpages0000644000015301777760000001242612321547255034000 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARDPAGES_H #define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARDPAGES_H #include "blackberrydevicelistdetector.h" #include #include #include namespace QSsh { class SshKeyGenerator; } namespace Qnx { namespace Internal { namespace Ui { class BlackBerryDeviceConfigurationWizardSetupPage; class BlackBerryDeviceConfigurationWizardQueryPage; class BlackBerryDeviceConfigurationWizardConfigPage; } class BlackBerrySshKeysGenerator; class BlackBerryDeviceInformation; struct BlackBerryDeviceConfigurationWizardHolder { QString devicePin; QString deviceName; QString scmBundle; QString debugTokenAuthor; bool isSimulator; bool debugTokenValid; bool deviceInfoRetrieved; bool isProductionDevice; BlackBerryDeviceConfigurationWizardHolder() : isSimulator(false) , debugTokenValid(false) , deviceInfoRetrieved(false) , isProductionDevice(true) {} }; class BlackBerryDeviceConfigurationWizardSetupPage : public QWizardPage { Q_OBJECT public: enum ItemKind { SpecifyManually, Autodetected, PleaseWait, Note }; explicit BlackBerryDeviceConfigurationWizardSetupPage(QWidget *parent = 0); ~BlackBerryDeviceConfigurationWizardSetupPage(); void initializePage(); bool isComplete() const; QString hostName() const; QString password() const; private slots: void onDeviceSelectionChanged(); void onDeviceDetected(const QString &deviceName, const QString &hostName, bool isSimulator); void onDeviceListDetectorFinished(); private: void refreshDeviceList(); QListWidgetItem *createDeviceListItem(const QString &displayName, ItemKind itemKind) const; QListWidgetItem *findDeviceListItem(ItemKind itemKind) const; Ui::BlackBerryDeviceConfigurationWizardSetupPage *m_ui; BlackBerryDeviceListDetector *m_deviceListDetector; }; class BlackBerryDeviceConfigurationWizardQueryPage : public QWizardPage { Q_OBJECT enum QueryState { Querying = 0, GeneratingSshKey, Done }; public: explicit BlackBerryDeviceConfigurationWizardQueryPage(BlackBerryDeviceConfigurationWizardHolder &holder, QWidget *parent = 0); ~BlackBerryDeviceConfigurationWizardQueryPage(); void initializePage(); bool isComplete() const; private slots: void processQueryFinished(int status); void sshKeysGenerationFailed(const QString &error); void processSshKeys(const QByteArray &privateKey, const QByteArray &publicKey); private: void checkAndGenerateSSHKeys(); void queryDone(); void setState(QueryState state, const QString &message); Ui::BlackBerryDeviceConfigurationWizardQueryPage *m_ui; BlackBerryDeviceConfigurationWizardHolder &m_holder; BlackBerryDeviceInformation *m_deviceInformation; QueryState m_state; }; class BlackBerryDeviceConfigurationWizardConfigPage : public QWizardPage { Q_OBJECT public: explicit BlackBerryDeviceConfigurationWizardConfigPage(BlackBerryDeviceConfigurationWizardHolder &holder, QWidget *parent = 0); ~BlackBerryDeviceConfigurationWizardConfigPage(); void initializePage(); bool isComplete() const; QString configurationName() const; QString debugToken() const; private slots: void generateDebugToken(); private: Ui::BlackBerryDeviceConfigurationWizardConfigPage *m_ui; BlackBerryDeviceConfigurationWizardHolder &m_holder; }; class BlackBerryDeviceConfigurationWizardFinalPage : public QWizardPage { Q_OBJECT public: explicit BlackBerryDeviceConfigurationWizardFinalPage(QWidget *parent = 0); }; } // namespace Internal } // namespace Qnx Q_DECLARE_METATYPE(Qnx::Internal::BlackBerryDeviceConfigurationWizardSetupPage::ItemKind) #endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARDPAGES_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfiguration.cpp0000644000015301777760000001435712321547255032325 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceconfiguration.h" #include "qnxconstants.h" #include "qnxdeviceprocesssignaloperation.h" #include "blackberrydeviceconfigurationwidget.h" #include "blackberrydeviceconnectionmanager.h" #include "qnxdeviceprocesslist.h" #include #include using namespace Qnx; using namespace Qnx::Internal; using namespace ProjectExplorer; namespace { const char ConnectToDeviceActionId[] = "Qnx.BlackBerry.ConnectToDeviceAction"; const char DisconnectFromDeviceActionId[] = "Qnx.BlackBerry.DisconnectFromDeviceAction"; } BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration() : RemoteLinux::LinuxDevice() { } BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration(const QString &name, Core::Id type, IDevice::MachineType machineType, IDevice::Origin origin, Core::Id id) : RemoteLinux::LinuxDevice(name, type, machineType, origin, id) { } BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration(const BlackBerryDeviceConfiguration &other) : RemoteLinux::LinuxDevice(other) , m_debugToken(other.m_debugToken) { } BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfiguration::create() { return Ptr(new BlackBerryDeviceConfiguration); } BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfiguration::create(const QString &name, Core::Id type, IDevice::MachineType machineType, IDevice::Origin origin, Core::Id id) { return Ptr(new BlackBerryDeviceConfiguration(name, type, machineType, origin, id)); } QString BlackBerryDeviceConfiguration::debugToken() const { return m_debugToken; } void BlackBerryDeviceConfiguration::setDebugToken(const QString &debugToken) { m_debugToken = debugToken; } void BlackBerryDeviceConfiguration::fromMap(const QVariantMap &map) { RemoteLinux::LinuxDevice::fromMap(map); m_debugToken = map.value(QLatin1String(Constants::QNX_DEBUG_TOKEN_KEY)).toString(); } IDevice::Ptr BlackBerryDeviceConfiguration::clone() const { return Ptr(new BlackBerryDeviceConfiguration(*this)); } bool BlackBerryDeviceConfiguration::hasDeviceTester() const { // we are unable to easily verify that a device is available unless we duplicate // 'Connect to device' functionality, therefore disabling device-tester return false; } BlackBerryDeviceConfiguration::ConstPtr BlackBerryDeviceConfiguration::device(const Kit *k) { IDevice::ConstPtr dev = DeviceKitInformation::device(k); return dev.dynamicCast(); } QString BlackBerryDeviceConfiguration::displayType() const { return tr("BlackBerry"); } IDeviceWidget *BlackBerryDeviceConfiguration::createWidget() { return new BlackBerryDeviceConfigurationWidget(sharedFromThis() .staticCast()); } QList BlackBerryDeviceConfiguration::actionIds() const { return QList() << Core::Id(ConnectToDeviceActionId) << Core::Id(DisconnectFromDeviceActionId); } QString BlackBerryDeviceConfiguration::displayNameForActionId(Core::Id actionId) const { if (actionId == Core::Id(ConnectToDeviceActionId)) return tr("Connect to device"); else if (actionId == Core::Id(DisconnectFromDeviceActionId)) return tr("Disconnect from device"); return QString(); } void BlackBerryDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent) { Q_UNUSED(parent); const BlackBerryDeviceConfiguration::ConstPtr device = sharedFromThis().staticCast(); BlackBerryDeviceConnectionManager *connectionManager = BlackBerryDeviceConnectionManager::instance(); if (actionId == Core::Id(ConnectToDeviceActionId)) connectionManager->connectDevice(device); else if (actionId == Core::Id(DisconnectFromDeviceActionId) && connectionManager->isConnected(id())) connectionManager->disconnectDevice(device); } QVariantMap BlackBerryDeviceConfiguration::toMap() const { QVariantMap map = RemoteLinux::LinuxDevice::toMap(); map.insert(QLatin1String(Constants::QNX_DEBUG_TOKEN_KEY), m_debugToken); return map; } DeviceProcessList *BlackBerryDeviceConfiguration::createProcessListModel(QObject *parent) const { return new QnxDeviceProcessList(sharedFromThis(), parent); } DeviceProcessSignalOperation::Ptr BlackBerryDeviceConfiguration::signalOperation() const { return DeviceProcessSignalOperation::Ptr( new BlackBerryDeviceProcessSignalOperation(sshParameters())); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysigningutils.cpp0000644000015301777760000001234412321547255031007 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrysigningutils.h" #include "blackberrycertificate.h" #include "blackberryconfiguration.h" #include "blackberryconfigurationmanager.h" #include #include #include #include #include using namespace Qnx::Internal; BlackBerrySigningUtils & BlackBerrySigningUtils::instance() { static BlackBerrySigningUtils utils; return utils; } BlackBerrySigningUtils::BlackBerrySigningUtils(QObject *parent) : QObject(parent), m_defaultCertificate(0) { } bool BlackBerrySigningUtils::hasRegisteredKeys() { BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); QFileInfo cskFile(configuration.idTokenPath()); return cskFile.exists(); } bool BlackBerrySigningUtils::hasLegacyKeys() { BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); QFileInfo cskFile(configuration.barsignerCskPath()); return cskFile.exists(); } bool BlackBerrySigningUtils::hasDefaultCertificate() { BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); QFileInfo keystore(configuration.defaultKeystorePath()); return keystore.exists(); } QString BlackBerrySigningUtils::cskPassword() { if (m_cskPassword.isEmpty()) m_cskPassword = promptPassword(tr("Please provide your bbidtoken.csk PIN.")); return m_cskPassword; } QString BlackBerrySigningUtils::certificatePassword() { if (m_certificatePassword.isEmpty()) m_certificatePassword = promptPassword(tr("Please enter your certificate password.")); return m_certificatePassword; } const BlackBerryCertificate * BlackBerrySigningUtils::defaultCertificate() const { return m_defaultCertificate; } void BlackBerrySigningUtils::openDefaultCertificate() { if (m_defaultCertificate) { emit defaultCertificateLoaded(BlackBerryCertificate::Success); return; } const QString password = certificatePassword(); BlackBerryConfigurationManager &configManager = BlackBerryConfigurationManager::instance(); m_defaultCertificate = new BlackBerryCertificate(configManager.defaultKeystorePath(), QString(), password, this); connect(m_defaultCertificate, SIGNAL(finished(int)), this, SLOT(certificateLoaded(int))); m_defaultCertificate->load(); } void BlackBerrySigningUtils::setDefaultCertificate(BlackBerryCertificate *certificate) { if (m_defaultCertificate) m_defaultCertificate->deleteLater(); certificate->setParent(this); m_defaultCertificate = certificate; } void BlackBerrySigningUtils::clearCskPassword() { m_cskPassword.clear(); } void BlackBerrySigningUtils::clearCertificatePassword() { m_certificatePassword.clear(); } void BlackBerrySigningUtils::deleteDefaultCertificate() { clearCertificatePassword(); m_defaultCertificate->deleteLater(); m_defaultCertificate = 0; BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); QFile::remove(configuration.defaultKeystorePath()); } void BlackBerrySigningUtils::certificateLoaded(int status) { if (status != BlackBerryCertificate::Success) { m_defaultCertificate->deleteLater(); m_defaultCertificate = 0; if (status == BlackBerryCertificate::WrongPassword) clearCertificatePassword(); } emit defaultCertificateLoaded(status); } QString BlackBerrySigningUtils::promptPassword(const QString &message) const { QInputDialog dialog; dialog.setWindowTitle(tr("Qt Creator")); dialog.setInputMode(QInputDialog::TextInput); dialog.setLabelText(message); dialog.setTextEchoMode(QLineEdit::Password); if (dialog.exec() == QDialog::Rejected) return QString(); return dialog.textValue(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxabstractrunsupport.h0000644000015301777760000000645212321547255030413 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNXABSTRACTRUNSUPPORT_H #define QNXABSTRACTRUNSUPPORT_H #include #include #include #include #include namespace ProjectExplorer { class DeviceApplicationRunner; class DeviceUsedPortsGatherer; } namespace Qnx { namespace Internal { class QnxRunConfiguration; class QnxAbstractRunSupport : public QObject { Q_OBJECT protected: enum State { Inactive, GatheringPorts, StartingRemoteProcess, Running }; public: QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QObject *parent = 0); protected: bool setPort(int &port); virtual void startExecution() = 0; virtual QString executable() const; Utils::Environment environment() const { return m_environment; } QString workingDirectory() const { return m_workingDir; } void setFinished(); State state() const; void setState(State state); ProjectExplorer::DeviceApplicationRunner *appRunner() const; const ProjectExplorer::IDevice::ConstPtr device() const; protected slots: virtual void handleAdapterSetupRequested(); virtual void handleRemoteProcessStarted(); virtual void handleRemoteProcessFinished(bool); virtual void handleProgressReport(const QString &progressOutput); virtual void handleRemoteOutput(const QByteArray &output); virtual void handleError(const QString &); private slots: void handlePortListReady(); private: ProjectExplorer::DeviceUsedPortsGatherer * m_portsGatherer; Utils::PortList m_portList; const QString m_remoteExecutable; ProjectExplorer::IDevice::ConstPtr m_device; ProjectExplorer::DeviceApplicationRunner *m_runner; State m_state; Utils::Environment m_environment; QString m_workingDir; }; } // namespace Internal } // namespace Qnx #endif // QNXABSTRACTRUNSUPPORT_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestep.h0000644000015301777760000000623712321547255031414 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEP_H #define QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEP_H #include "blackberryabstractdeploystep.h" QT_BEGIN_NAMESPACE class QFile; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BlackBerryCreatePackageStep : public BlackBerryAbstractDeployStep { Q_OBJECT friend class BlackBerryCreatePackageStepFactory; public: enum PackageMode { SigningPackageMode, DevelopmentMode }; explicit BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl); bool init(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); QString debugToken() const; bool fromMap(const QVariantMap &map); QVariantMap toMap() const; PackageMode packageMode() const; QString cskPassword() const; QString keystorePassword() const; bool savePasswords() const; public slots: void setPackageMode(PackageMode packageMode); void setCskPassword(const QString &cskPassword); void setKeystorePassword(const QString &keystorePassword); void setSavePasswords(bool savePasswords); signals: void cskPasswordChanged(QString); void keystorePasswordChanged(QString); protected: BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCreatePackageStep *bs); void processStarted(const ProjectExplorer::ProcessParameters ¶ms); private: void ctor(); bool prepareAppDescriptorFile(const QString &appDescriptorPath, const QString &preparedFilePath); PackageMode m_packageMode; QString m_cskPassword; QString m_keystorePassword; bool m_savePasswords; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEP_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenrequestdialog.h0000644000015301777760000000542412321547255032656 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEBUGTOKENREQUESTDIALOG_H #define QNX_INTERNAL_BLACKBERRYDEBUGTOKENREQUESTDIALOG_H #include QT_BEGIN_NAMESPACE class QPushButton; QT_END_NAMESPACE namespace Qnx { namespace Internal { class Ui_BlackBerryDebugTokenRequestDialog; class BlackBerryDebugTokenRequester; class BlackBerryDeviceInformation; class BlackBerrySigningUtils; class BlackBerryDebugTokenRequestDialog : public QDialog { Q_OBJECT public: explicit BlackBerryDebugTokenRequestDialog(QWidget *parent = 0, Qt::WindowFlags f = 0); ~BlackBerryDebugTokenRequestDialog(); QString debugToken() const; void setDevicePin(const QString &devicePin); void setTargetDetails(const QString &deviceIp, const QString &password); private slots: void validate(); void requestDebugToken(); void setDefaultPath(); void appendExtension(); void expandPath(); void debugTokenArrived(int status); void setDevicePin(int status); private: void setBusy(bool busy); Ui_BlackBerryDebugTokenRequestDialog *m_ui; BlackBerryDebugTokenRequester *m_requester; BlackBerryDeviceInformation *m_deviceInfo; BlackBerrySigningUtils &m_utils; QPushButton *m_cancelButton; QPushButton *m_okButton; }; } } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEBUGTOKENREQUESTDIALOG_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceprocesssignaloperation.cpp0000644000015301777760000000717712321547255032743 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeviceprocesssignaloperation.h" using namespace Qnx; using namespace Qnx::Internal; QnxDeviceProcessSignalOperation::QnxDeviceProcessSignalOperation( const QSsh::SshConnectionParameters sshParameters) : RemoteLinux::RemoteLinuxSignalOperation(sshParameters) { } static QString signalProcessByNameQnxCommandLine(const QString &filePath, int sig) { QString executable = filePath; return QString::fromLatin1("for PID in $(ps -f -o pid,comm | grep %1 | awk '/%1/ {print $1}'); " "do " "kill -%2 $PID; " "done").arg(executable.replace(QLatin1String("/"), QLatin1String("\\/"))).arg(sig); } QString QnxDeviceProcessSignalOperation::killProcessByNameCommandLine( const QString &filePath) const { return QString::fromLatin1("%1; %2").arg(signalProcessByNameQnxCommandLine(filePath, 15), signalProcessByNameQnxCommandLine(filePath, 9)); } QString QnxDeviceProcessSignalOperation::interruptProcessByNameCommandLine( const QString &filePath) const { return signalProcessByNameQnxCommandLine(filePath, 2); } BlackBerryDeviceProcessSignalOperation::BlackBerryDeviceProcessSignalOperation( const QSsh::SshConnectionParameters sshParameters) : RemoteLinux::RemoteLinuxSignalOperation(sshParameters) { } static QString signalProcessByNameBlackBerryCommandLine(const QString &filePath, int sig) { QString executable = filePath; return QString::fromLatin1("for PID in $(pidin -F \"%a %A\" | grep \"%1\" | awk '/%1/ {print $1}'); " "do " "kill -%2 $PID; " "done").arg(executable.replace(QLatin1String("/"), QLatin1String("\\/"))).arg(sig); } QString BlackBerryDeviceProcessSignalOperation::killProcessByNameCommandLine(const QString &filePath) const { return QString::fromLatin1("%1; %2").arg(signalProcessByNameBlackBerryCommandLine(filePath, 15), signalProcessByNameBlackBerryCommandLine(filePath, 9)); } QString BlackBerryDeviceProcessSignalOperation::interruptProcessByNameCommandLine(const QString &filePath) const { return signalProcessByNameBlackBerryCommandLine(filePath, 2); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryndksettingswidget.cpp0000644000015301777760000003104512321547255032030 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryndksettingswidget.h" #include "ui_blackberryndksettingswidget.h" #include "qnxutils.h" #include "blackberrysigningutils.h" #include "blackberrysetupwizard.h" #include "blackberryconfigurationmanager.h" #include "blackberryconfiguration.h" #include #include #include #include #include #include namespace Qnx { namespace Internal { BlackBerryNDKSettingsWidget::BlackBerryNDKSettingsWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui_BlackBerryNDKSettingsWidget), m_autoDetectedNdks(0), m_manualNdks(0) { m_bbConfigManager = &BlackBerryConfigurationManager::instance(); m_ui->setupUi(this); m_ui->activateNdkTargetButton->setEnabled(false); m_ui->deactivateNdkTargetButton->setEnabled(false); m_activatedTargets << m_bbConfigManager->activeConfigurations(); m_ui->ndksTreeWidget->header()->setResizeMode(QHeaderView::Stretch); m_ui->ndksTreeWidget->header()->setStretchLastSection(false); m_ui->ndksTreeWidget->setHeaderItem(new QTreeWidgetItem(QStringList() << tr("NDK") << tr("NDK Environment File"))); m_ui->ndksTreeWidget->setTextElideMode(Qt::ElideNone); m_ui->ndksTreeWidget->setColumnCount(2); m_autoDetectedNdks = new QTreeWidgetItem(m_ui->ndksTreeWidget); m_autoDetectedNdks->setText(0, tr("Auto-Detected")); m_autoDetectedNdks->setFirstColumnSpanned(true); m_autoDetectedNdks->setFlags(Qt::ItemIsEnabled); m_manualNdks = new QTreeWidgetItem(m_ui->ndksTreeWidget); m_manualNdks->setText(0, tr("Manual")); m_manualNdks->setFirstColumnSpanned(true); m_manualNdks->setFlags(Qt::ItemIsEnabled); m_ui->ndksTreeWidget->expandAll(); updateNdkList(); connect(m_ui->wizardButton, SIGNAL(clicked()), this, SLOT(launchBlackBerrySetupWizard())); connect(m_ui->addNdkButton, SIGNAL(clicked()), this, SLOT(addNdkTarget())); connect(m_ui->removeNdkButton, SIGNAL(clicked()), this, SLOT(removeNdkTarget())); connect(m_ui->activateNdkTargetButton, SIGNAL(clicked()), this, SLOT(activateNdkTarget())); connect(m_ui->deactivateNdkTargetButton, SIGNAL(clicked()), this, SLOT(deactivateNdkTarget())); connect(m_ui->ndksTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateInfoTable(QTreeWidgetItem*))); } void BlackBerryNDKSettingsWidget::setWizardMessageVisible(bool visible) { m_ui->wizardLabel->setVisible(visible); m_ui->wizardButton->setVisible(visible); } bool BlackBerryNDKSettingsWidget::hasActiveNdk() const { return !m_bbConfigManager->configurations().isEmpty(); } QList BlackBerryNDKSettingsWidget::activatedTargets() { return m_activatedTargets; } QList BlackBerryNDKSettingsWidget::deactivatedTargets() { return m_deactivatedTargets; } void BlackBerryNDKSettingsWidget::launchBlackBerrySetupWizard() const { BlackBerrySigningUtils &blackBerryUtils = BlackBerrySigningUtils::instance(); const bool alreadyConfigured = blackBerryUtils.hasRegisteredKeys() && blackBerryUtils.hasDefaultCertificate(); if (alreadyConfigured) { QMessageBox::information(0, tr("Qt Creator"), tr("It appears that your BlackBerry environment has already been configured.")); return; } BlackBerrySetupWizard wizard(Core::ICore::mainWindow()); connect(&wizard, SIGNAL(ndkTargetsUpdated()), this, SLOT(updateNdkList())); wizard.exec(); } void BlackBerryNDKSettingsWidget::updateInfoTable(QTreeWidgetItem* currentItem) { if (!currentItem) return; QString envFilePath = currentItem->text(1); if (envFilePath.isEmpty()) { m_ui->removeNdkButton->setEnabled(false); m_ui->activateNdkTargetButton->setEnabled(false); m_ui->deactivateNdkTargetButton->setEnabled(false); return; } BlackBerryConfiguration *config = m_bbConfigManager->configurationFromEnvFile(Utils::FileName::fromString(envFilePath)); if (!config) return; m_ui->baseNameLabel->setText(config->displayName()); m_ui->ndkPathLabel->setText(QDir::toNativeSeparators(config->ndkPath())); m_ui->hostLabel->setText(QDir::toNativeSeparators(config->qnxHost())); m_ui->targetLabel->setText(QDir::toNativeSeparators(config->sysRoot().toString())); m_ui->versionLabel->clear(); // TODO: Add a versionNumber attribute for the BlackBerryConfiguration class if (config->isAutoDetected()) { foreach (const NdkInstallInformation &ndkInfo, QnxUtils::installedNdks()) { if (ndkInfo.name == config->displayName()) { m_ui->versionLabel->setText(ndkInfo.version); break; } } } updateUi(currentItem, config); } void BlackBerryNDKSettingsWidget::updateNdkList() { qDeleteAll(m_autoDetectedNdks->takeChildren()); qDeleteAll(m_manualNdks->takeChildren()); foreach (BlackBerryConfiguration *config, m_bbConfigManager->configurations()) { QTreeWidgetItem *parent = config->isAutoDetected() ? m_autoDetectedNdks : m_manualNdks; QTreeWidgetItem *item = new QTreeWidgetItem(parent); item->setText(0, config->displayName()); item->setText(1, config->ndkEnvFile().toString()); QFont font; font.setBold(config->isActive() || m_activatedTargets.contains(config)); item->setFont(0, font); item->setFont(1, font); } if (m_autoDetectedNdks->child(0)) { m_autoDetectedNdks->child(0)->setSelected(true); updateInfoTable(m_autoDetectedNdks->child(0)); } } void BlackBerryNDKSettingsWidget::addNdkTarget() { launchBlackBerryInstallerWizard(BlackBerryInstallerDataHandler::InstallMode); emit targetsUpdated(); } void BlackBerryNDKSettingsWidget::removeNdkTarget() { if (!m_ui->ndksTreeWidget->currentItem()) return; QString ndk = m_ui->ndksTreeWidget->currentItem()->text(0); QString envFilePath = m_ui->ndksTreeWidget->currentItem()->text(1); BlackBerryConfiguration *config = m_bbConfigManager->configurationFromEnvFile(Utils::FileName::fromString(envFilePath)); if (!config) return; if (config->isAutoDetected()) { uninstallNdkTarget(); emit targetsUpdated(); return; } QMessageBox::StandardButton button = QMessageBox::question(Core::ICore::mainWindow(), tr("Clean BlackBerry 10 Configuration"), tr("Are you sure you want to remove:\n %1?").arg(ndk), QMessageBox::Yes | QMessageBox::No); if (button == QMessageBox::Yes) { m_activatedTargets.removeOne(config); m_deactivatedTargets.removeOne(config); m_bbConfigManager->removeConfiguration(config); m_manualNdks->removeChild(m_ui->ndksTreeWidget->currentItem()); emit targetsUpdated(); } } void BlackBerryNDKSettingsWidget::activateNdkTarget() { if (!m_ui->ndksTreeWidget->currentItem()) return; QString envFilePath = m_ui->ndksTreeWidget->currentItem()->text(1); BlackBerryConfiguration *config = m_bbConfigManager->configurationFromEnvFile(Utils::FileName::fromString(envFilePath)); if (config && !m_activatedTargets.contains(config)) { m_activatedTargets << config; if (m_deactivatedTargets.contains(config)) m_deactivatedTargets.removeAt(m_deactivatedTargets.indexOf(config)); updateUi(m_ui->ndksTreeWidget->currentItem(), config); emit targetsUpdated(); } } void BlackBerryNDKSettingsWidget::deactivateNdkTarget() { if (!m_ui->ndksTreeWidget->currentItem()) return; QString envFilePath = m_ui->ndksTreeWidget->currentItem()->text(1); BlackBerryConfiguration *config = m_bbConfigManager->configurationFromEnvFile(Utils::FileName::fromString(envFilePath)); if (config && m_activatedTargets.contains(config)) { m_deactivatedTargets << config; m_activatedTargets.removeAt(m_activatedTargets.indexOf(config)); updateUi(m_ui->ndksTreeWidget->currentItem(), config); emit targetsUpdated(); } } void BlackBerryNDKSettingsWidget::updateUi(QTreeWidgetItem *item, BlackBerryConfiguration *config) { if (!item || !config) return; QFont font; font.setBold(m_activatedTargets.contains(config)); item->setFont(0, font); item->setFont(1, font); m_ui->activateNdkTargetButton->setEnabled(!m_activatedTargets.contains(config)); m_ui->deactivateNdkTargetButton->setEnabled(m_activatedTargets.contains(config) && m_activatedTargets.size() > 1); // Disable remove button for auto detected pre-10.2 NDKs (uninstall wizard doesn't handle them) m_ui->removeNdkButton->setEnabled(!(config->isAutoDetected() && QnxUtils::sdkInstallerPath(config->ndkPath()).isEmpty())); } void BlackBerryNDKSettingsWidget::uninstallNdkTarget() { const QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Confirmation"), tr("Are you sure you want to uninstall %1?"). arg(m_ui->baseNameLabel->text()), QMessageBox::Yes | QMessageBox::No); if (answer == QMessageBox::Yes) launchBlackBerryInstallerWizard(BlackBerryInstallerDataHandler::UninstallMode, m_ui->versionLabel->text()); } void BlackBerryNDKSettingsWidget::handleInstallationFinished() { m_bbConfigManager->loadAutoDetectedConfigurations(); updateNdkList(); } void BlackBerryNDKSettingsWidget::handleUninstallationFinished() { if (!m_ui->ndksTreeWidget->currentItem()) return; QString targetName = m_ui->ndksTreeWidget->currentItem()->text(0); QString envFilePath = m_ui->ndksTreeWidget->currentItem()->text(1); // Check if the target is corrrecly uninstalled foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) { if (ndk.name == targetName) return; } BlackBerryConfiguration *config = m_bbConfigManager->configurationFromEnvFile(Utils::FileName::fromString(envFilePath)); if (m_activatedTargets.contains(config)) m_activatedTargets.removeAt(m_activatedTargets.indexOf(config)); else if (m_deactivatedTargets.contains(config)) m_deactivatedTargets.removeAt(m_deactivatedTargets.indexOf(config)); m_bbConfigManager->removeConfiguration(config); updateNdkList(); } void BlackBerryNDKSettingsWidget::launchBlackBerryInstallerWizard(BlackBerryInstallerDataHandler::Mode mode, const QString& targetVersion) { BlackBerryInstallWizard wizard(mode, targetVersion, this); if (mode == BlackBerryInstallerDataHandler::InstallMode) connect(&wizard, SIGNAL(processFinished()), this, SLOT(handleInstallationFinished())); else connect(&wizard, SIGNAL(processFinished()), this, SLOT(handleUninstallationFinished())); wizard.exec(); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationfactory.cpp0000644000015301777760000000620512321547255033706 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceconfigurationfactory.h" #include "qnxconstants.h" #include "blackberrydeviceconfigurationwizard.h" #include "blackberrydeviceconfiguration.h" #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeviceConfigurationFactory::BlackBerryDeviceConfigurationFactory(QObject *parent) : ProjectExplorer::IDeviceFactory(parent) { } QString BlackBerryDeviceConfigurationFactory::displayNameForId(Core::Id type) const { Q_UNUSED(type); return tr("BlackBerry Device"); } QList BlackBerryDeviceConfigurationFactory::availableCreationIds() const { QList result; result << Core::Id(Constants::QNX_BB_OS_TYPE); return result; } bool BlackBerryDeviceConfigurationFactory::canCreate() const { return true; } ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationFactory::create(Core::Id id) const { Q_UNUSED(id); BlackBerryDeviceConfigurationWizard wizard; if (wizard.exec() != QDialog::Accepted) return ProjectExplorer::IDevice::Ptr(); return wizard.device(); } bool BlackBerryDeviceConfigurationFactory::canRestore(const QVariantMap &map) const { return ProjectExplorer::IDevice::typeFromMap(map) == Constants::QNX_BB_OS_TYPE; } ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationFactory::restore(const QVariantMap &map) const { QTC_ASSERT(canRestore(map), return BlackBerryDeviceConfiguration::Ptr()); const BlackBerryDeviceConfiguration::Ptr device = BlackBerryDeviceConfiguration::create(); device->fromMap(map); return device; } Core::Id BlackBerryDeviceConfigurationFactory::deviceType() { return Core::Id(Constants::QNX_BB_OS_TYPE); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconnection.cpp0000644000015301777760000001223212321547255031603 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceconnection.h" #include "blackberryconfiguration.h" #include "blackberryconfigurationmanager.h" #include "qnxutils.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char CONNECT_SUCCESS_MSG[] = "Successfully connected"; } BlackBerryDeviceConnection::BlackBerryDeviceConnection() : QObject(), m_connectionState(Disconnected), m_process(new QProcess(this)) { connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished())); connect(m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processFinished())); connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput())); connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError())); } void BlackBerryDeviceConnection::connectDevice(const ProjectExplorer::IDevice::ConstPtr &device) { Utils::Environment env = Utils::Environment::systemEnvironment(); env.modify(BlackBerryConfigurationManager::instance().defaultQnxEnv()); m_process->setEnvironment(env.toStringList()); m_host = device->sshParameters().host; const QString password = device->sshParameters().password; const QString publicKeyFile = device->sshParameters().privateKeyFile + QLatin1String(".pub"); // Since killing the blackberry-connect script won't kill the java process it launches, // let's just call the java process directly instead. QString command = env.searchInPath(QLatin1String("java")); if (command.isEmpty()) { const QString line = tr("Error connecting to device: java could not be found in the environment.") + QLatin1Char('\n'); emit processOutput(line); m_messageLog.append(line); return; } QStringList args; args << QLatin1String("-Xmx512M"); args << QLatin1String("-jar"); args << env.value(QLatin1String("QNX_HOST")) + QLatin1String("/usr/lib/Connect.jar"); args << QLatin1String("-targetHost") << m_host; if (!password.isEmpty()) args << QLatin1String("-password") << password; args << QLatin1String("-sshPublicKey") << publicKeyFile; m_connectionState = Connecting; m_process->start(command, args); m_messageLog.clear(); emit deviceAboutToConnect(); } void BlackBerryDeviceConnection::disconnectDevice() { m_process->terminate(); if (!m_process->waitForFinished(5000)) m_process->kill(); m_connectionState = Disconnected; } QString BlackBerryDeviceConnection::host() const { return m_host; } BlackBerryDeviceConnection::State BlackBerryDeviceConnection::connectionState() { return m_connectionState; } QString BlackBerryDeviceConnection::messageLog() const { return m_messageLog; } void BlackBerryDeviceConnection::processFinished() { m_connectionState = Disconnected; emit deviceDisconnected(); } void BlackBerryDeviceConnection::readStandardOutput() { m_process->setReadChannel(QProcess::StandardOutput); while (m_process->canReadLine()) { const QString line = QString::fromLocal8Bit(m_process->readLine()); emit processOutput(line); m_messageLog.append(line); if (line.contains(QLatin1String(CONNECT_SUCCESS_MSG))) { m_connectionState = Connected; emit deviceConnected(); } } } void BlackBerryDeviceConnection::readStandardError() { m_process->setReadChannel(QProcess::StandardError); while (m_process->canReadLine()) { const QString line = QString::fromLocal8Bit(m_process->readLine()); emit processOutput(line); m_messageLog.append(line); } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryinstallwizardprocesspage.ui0000644000015301777760000000216412321547255033245 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryInstallWizardProcessPage 0 0 400 300 Form Please wait... 24 Qt::Vertical 20 40 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxabstractqtversion.cpp0000644000015301777760000001205312321547255030531 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxabstractqtversion.h" #include "qnxbaseqtconfigwidget.h" #include "qnxutils.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; QnxAbstractQtVersion::QnxAbstractQtVersion() : QtSupport::BaseQtVersion() , m_arch(UnknownArch) { } QnxAbstractQtVersion::QnxAbstractQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected, const QString &autoDetectionSource) : QtSupport::BaseQtVersion(path, isAutoDetected, autoDetectionSource) , m_arch(arch) { } QnxArchitecture QnxAbstractQtVersion::architecture() const { return m_arch; } QString QnxAbstractQtVersion::archString() const { switch (m_arch) { case X86: return QLatin1String("x86"); case ArmLeV7: return QLatin1String("ARMle-v7"); case UnknownArch: return QString(); } return QString(); } QVariantMap QnxAbstractQtVersion::toMap() const { QVariantMap result = BaseQtVersion::toMap(); result.insert(QLatin1String("SDKPath"), sdkPath()); result.insert(QLatin1String("Arch"), m_arch); return result; } void QnxAbstractQtVersion::fromMap(const QVariantMap &map) { BaseQtVersion::fromMap(map); setSdkPath(QDir::fromNativeSeparators(map.value(QLatin1String("SDKPath")).toString())); m_arch = static_cast(map.value(QLatin1String("Arch"), UnknownArch).toInt()); } QList QnxAbstractQtVersion::detectQtAbis() const { ensureMkSpecParsed(); return qtAbisFromLibrary(qtCorePaths(versionInfo(), qtVersionString())); } void QnxAbstractQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const { QtSupport::BaseQtVersion::addToEnvironment(k, env); updateEnvironment(); env.modify(m_qnxEnv); env.prependOrSetLibrarySearchPath(versionInfo().value(QLatin1String("QT_INSTALL_LIBS"))); } Utils::Environment QnxAbstractQtVersion::qmakeRunEnvironment() const { if (!sdkPath().isEmpty()) updateEnvironment(); Utils::Environment env = Utils::Environment::systemEnvironment(); env.modify(m_qnxEnv); return env; } QString QnxAbstractQtVersion::sdkPath() const { return m_sdkPath; } void QnxAbstractQtVersion::setSdkPath(const QString &sdkPath) { if (m_sdkPath == sdkPath) return; m_sdkPath = sdkPath; m_environmentUpToDate = false; } void QnxAbstractQtVersion::updateEnvironment() const { if (!m_environmentUpToDate) { m_qnxEnv = environment(); m_environmentUpToDate = true; } } QString QnxAbstractQtVersion::qnxHost() const { if (!m_environmentUpToDate) updateEnvironment(); foreach (const Utils::EnvironmentItem &item, m_qnxEnv) { if (item.name == QLatin1String(Constants::QNX_HOST_KEY)) return item.value; } return QString(); } QString QnxAbstractQtVersion::qnxTarget() const { if (!m_environmentUpToDate) updateEnvironment(); foreach (const Utils::EnvironmentItem &item, m_qnxEnv) { if (item.name == QLatin1String(Constants::QNX_TARGET_KEY)) return item.value; } return QString(); } QtSupport::QtConfigWidget *QnxAbstractQtVersion::createConfigurationWidget() const { return new QnxBaseQtConfigWidget(const_cast(this)); } bool QnxAbstractQtVersion::isValid() const { return QtSupport::BaseQtVersion::isValid() && !sdkPath().isEmpty(); } QString QnxAbstractQtVersion::invalidReason() const { if (sdkPath().isEmpty()) return tr("No SDK path set"); return QtSupport::BaseQtVersion::invalidReason(); } ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycheckdevmodestepconfigwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycheckdevmodestepconfigwidget.c0000644000015301777760000000376212321547255033643 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycheckdevmodestepconfigwidget.h" using namespace Qnx; using namespace Qnx::Internal; BlackBerryCheckDevModeStepConfigWidget::BlackBerryCheckDevModeStepConfigWidget() : ProjectExplorer::BuildStepConfigWidget() { } QString BlackBerryCheckDevModeStepConfigWidget::displayName() const { return tr("Check development mode"); } QString BlackBerryCheckDevModeStepConfigWidget::summaryText() const { return displayName(); } bool BlackBerryCheckDevModeStepConfigWidget::showWidget() const { return false; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryqtversionfactory.cpp0000644000015301777760000000617412321547255031716 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryqtversionfactory.h" #include "qnxconstants.h" #include "blackberryqtversion.h" #include "qnxutils.h" #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryQtVersionFactory::BlackBerryQtVersionFactory(QObject *parent) : QtSupport::QtVersionFactory(parent) { } BlackBerryQtVersionFactory::~BlackBerryQtVersionFactory() { } bool BlackBerryQtVersionFactory::canRestore(const QString &type) { return type == QLatin1String(Constants::QNX_BB_QT); } QtSupport::BaseQtVersion *BlackBerryQtVersionFactory::restore(const QString &type, const QVariantMap &data) { if (!canRestore(type)) return 0; BlackBerryQtVersion *v = new BlackBerryQtVersion(); v->fromMap(data); return v; } int BlackBerryQtVersionFactory::priority() const { return Constants::QNX_BB_QT_FACTORY_PRIO; } QtSupport::BaseQtVersion *BlackBerryQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource) { QFileInfo fi = qmakePath.toFileInfo(); if (!fi.exists() || !fi.isExecutable() || !fi.isFile()) return 0; if (evaluator->values(QLatin1String("CONFIG")).contains(QLatin1String("blackberry"))) { QString cpuDir = evaluator->value(QLatin1String("QNX_CPUDIR")); return new BlackBerryQtVersion(QnxUtils::cpudirToArch(cpuDir), qmakePath, isAutoDetected, autoDetectionSource); } return 0; } ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpackageinformationwidget.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpackageinformationwid0000644000015301777760000000251612321547255034006 0ustar pbusernogroup00000000000000 Qnx::Internal::BarDescriptorEditorPackageInformationWidget 0 0 372 85 Form Package ID: Package version: Package build ID: qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryqtversionfactory.h0000644000015301777760000000464212321547255031361 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYQTVERSIONFACTORY_H #define QNX_INTERNAL_BLACKBERRYQTVERSIONFACTORY_H #include namespace Qnx { namespace Internal { class BlackBerryQtVersionFactory : public QtSupport::QtVersionFactory { Q_OBJECT public: explicit BlackBerryQtVersionFactory(QObject *parent = 0); ~BlackBerryQtVersionFactory(); virtual bool canRestore(const QString &type); virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data); virtual int priority() const; virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYQTVERSIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxanalyzesupport.cpp0000644000015301777760000001203512321547255030053 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxanalyzesupport.h" #include #include #include #include #include using namespace ProjectExplorer; using namespace Qnx; using namespace Qnx::Internal; QnxAnalyzeSupport::QnxAnalyzeSupport(QnxRunConfiguration *runConfig, Analyzer::AnalyzerRunControl *runControl) : QnxAbstractRunSupport(runConfig, runControl) , m_runControl(runControl) , m_qmlPort(-1) { const DeviceApplicationRunner *runner = appRunner(); connect(runner, SIGNAL(reportError(QString)), SLOT(handleError(QString))); connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); connect(runner, SIGNAL(finished(bool)), SLOT(handleRemoteProcessFinished(bool))); connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(m_runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)), SLOT(handleAdapterSetupRequested())); connect(&m_outputParser, SIGNAL(waitingForConnectionOnPort(quint16)), SLOT(remoteIsRunning())); } void QnxAnalyzeSupport::handleAdapterSetupRequested() { QTC_ASSERT(state() == Inactive, return); showMessage(tr("Preparing remote side...") + QLatin1Char('\n'), Utils::NormalMessageFormat); QnxAbstractRunSupport::handleAdapterSetupRequested(); } void QnxAnalyzeSupport::startExecution() { if (state() == Inactive) return; if (!setPort(m_qmlPort) && m_qmlPort == -1) return; setState(StartingRemoteProcess); const QStringList args = QStringList() << Utils::QtcProcess::splitArgs(m_runControl->startParameters().debuggeeArgs) << QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(m_qmlPort); appRunner()->setEnvironment(environment()); appRunner()->setWorkingDirectory(workingDirectory()); appRunner()->start(device(), executable(), args); } void QnxAnalyzeSupport::handleRemoteProcessFinished(bool success) { if (m_runControl || state() == Inactive) return; if (!success) showMessage(tr("The %1 process closed unexpectedly.").arg(executable()), Utils::NormalMessageFormat); m_runControl->notifyRemoteFinished(success); } void QnxAnalyzeSupport::handleProfilingFinished() { setFinished(); } void QnxAnalyzeSupport::handleProgressReport(const QString &progressOutput) { showMessage(progressOutput + QLatin1Char('\n'), Utils::NormalMessageFormat); } void QnxAnalyzeSupport::handleRemoteOutput(const QByteArray &output) { QTC_ASSERT(state() == Inactive || state() == Running, return); showMessage(QString::fromUtf8(output), Utils::StdOutFormat); } void QnxAnalyzeSupport::handleError(const QString &error) { if (state() == Running) { showMessage(error, Utils::ErrorMessageFormat); } else if (state() != Inactive) { showMessage(tr("Initial setup failed: %1").arg(error), Utils::NormalMessageFormat); setFinished(); } } void QnxAnalyzeSupport::remoteIsRunning() { if (m_runControl) m_runControl->notifyRemoteSetupDone(m_qmlPort); } void QnxAnalyzeSupport::showMessage(const QString &msg, Utils::OutputFormat format) { if (state() != Inactive && m_runControl) m_runControl->logApplicationMessage(msg, format); m_outputParser.processOutput(msg); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizardcertificatepage.ui0000644000015301777760000000562312321547255033546 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerrySetupWizardCertificatePage 0 0 400 223 Form Author: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password Confirm password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password Show password 75 true Status Qt::AlignCenter Qt::Vertical 20 93 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxqtversionfactory.h0000644000015301777760000000457012321547255030047 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXQTVERSIONFACTORY_H #define QNX_INTERNAL_QNXQTVERSIONFACTORY_H #include namespace Qnx { namespace Internal { class QnxQtVersionFactory : public QtSupport::QtVersionFactory { Q_OBJECT public: explicit QnxQtVersionFactory(QObject *parent = 0); ~QnxQtVersionFactory(); virtual bool canRestore(const QString &type); virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data); virtual int priority() const; virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXQTVERSIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxqtversion.cpp0000644000015301777760000000570312321547255027011 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxqtversion.h" #include "qnxconstants.h" #include "qnxutils.h" #include #include using namespace Qnx; using namespace Qnx::Internal; QnxQtVersion::QnxQtVersion() : QnxAbstractQtVersion() { } QnxQtVersion::QnxQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected, const QString &autoDetectionSource) : QnxAbstractQtVersion(arch, path, isAutoDetected, autoDetectionSource) { setDisplayName(defaultDisplayName(qtVersionString(), path, false)); } QnxQtVersion *QnxQtVersion::clone() const { return new QnxQtVersion(*this); } QnxQtVersion::~QnxQtVersion() { } QString QnxQtVersion::type() const { return QLatin1String(Constants::QNX_QNX_QT); } QString QnxQtVersion::description() const { //: Qt Version is meant for QNX return tr("QNX %1").arg(archString()); } Core::FeatureSet QnxQtVersion::availableFeatures() const { Core::FeatureSet features = QnxAbstractQtVersion::availableFeatures(); features |= Core::FeatureSet(Constants::QNX_QNX_FEATURE); return features; } QString QnxQtVersion::platformName() const { return QString::fromLatin1(Constants::QNX_QNX_PLATFORM_NAME); } QString QnxQtVersion::platformDisplayName() const { return tr("QNX"); } QString QnxQtVersion::sdkDescription() const { return tr("QNX Software Development Platform:"); } QList QnxQtVersion::environment() const { return QnxUtils::qnxEnvironment(sdkPath()); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycheckdevmodestep.h0000644000015301777760000000440512321547255031251 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H #define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H #include "blackberryabstractdeploystep.h" namespace Qnx { namespace Internal { class BlackBerryCheckDevModeStep : public BlackBerryAbstractDeployStep { Q_OBJECT friend class BlackBerryCheckDevModeStepFactory; public: explicit BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl); bool init(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); protected: BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDevModeStep *bs); void processStarted(const ProjectExplorer::ProcessParameters ¶ms); private: QString password() const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxruncontrolfactory.cpp0000644000015301777760000002005712321547255030553 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxruncontrolfactory.h" #include "qnxconstants.h" #include "qnxrunconfiguration.h" #include "qnxdebugsupport.h" #include "qnxanalyzesupport.h" #include "qnxqtversion.h" #include "qnxruncontrol.h" #include "qnxutils.h" #include "qnxdeviceconfiguration.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Analyzer; using namespace Debugger; using namespace ProjectExplorer; using namespace Qnx; using namespace Qnx::Internal; static DebuggerStartParameters createDebuggerStartParameters(const QnxRunConfiguration *runConfig) { DebuggerStartParameters params; Target *target = runConfig->target(); Kit *k = target->kit(); const IDevice::ConstPtr device = DeviceKitInformation::device(k); if (device.isNull()) return params; params.startMode = AttachToRemoteServer; params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString(); params.sysRoot = SysRootKitInformation::sysRoot(k).toString(); params.useCtrlCStub = true; if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) params.toolChainAbi = tc->targetAbi(); params.executable = runConfig->localExecutableFilePath(); params.remoteExecutable = runConfig->remoteExecutableFilePath(); params.remoteChannel = device->sshParameters().host + QLatin1String(":-1"); params.displayName = runConfig->displayName(); params.remoteSetupNeeded = true; params.closeMode = KillAtClose; params.processArgs = runConfig->arguments().join(QLatin1String(" ")); Debugger::DebuggerRunConfigurationAspect *aspect = runConfig->extraAspect(); if (aspect->useQmlDebugger()) { params.languages |= QmlLanguage; params.qmlServerAddress = device->sshParameters().host; params.qmlServerPort = 0; // QML port is handed out later } if (aspect->useCppDebugger()) params.languages |= Debugger::CppLanguage; if (const ProjectExplorer::Project *project = runConfig->target()->project()) { params.projectSourceDirectory = project->projectDirectory(); if (const ProjectExplorer::BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration()) params.projectBuildDirectory = buildConfig->buildDirectory().toString(); params.projectSourceFiles = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles); } QnxQtVersion *qtVersion = dynamic_cast(QtSupport::QtKitInformation::qtVersion(k)); if (qtVersion) params.solibSearchPath = QnxUtils::searchPaths(qtVersion); return params; } static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig, RunMode mode) { AnalyzerStartParameters params; Target *target = runConfig->target(); Kit *k = target->kit(); const IDevice::ConstPtr device = DeviceKitInformation::device(k); if (device.isNull()) return params; if (mode == QmlProfilerRunMode) params.startMode = StartLocal; params.debuggee = runConfig->remoteExecutableFilePath(); params.debuggeeArgs = runConfig->arguments().join(QLatin1String(" ")); params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters(); params.displayName = runConfig->displayName(); params.sysroot = SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString(); params.analyzerHost = params.connParams.host; params.analyzerPort = params.connParams.port; if (EnvironmentAspect *environment = runConfig->extraAspect()) params.environment = environment->environment(); return params; } QnxRunControlFactory::QnxRunControlFactory(QObject *parent) : IRunControlFactory(parent) { } bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const { if (mode != NormalRunMode && mode != DebugRunMode && mode != QmlProfilerRunMode) return false; if (!runConfiguration->isEnabled() || !runConfiguration->id().name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)) { return false; } const QnxRunConfiguration * const rc = qobject_cast(runConfiguration); if (mode == DebugRunMode || mode == QmlProfilerRunMode) { const QnxDeviceConfiguration::ConstPtr dev = DeviceKitInformation::device(runConfiguration->target()->kit()) .dynamicCast(); if (dev.isNull()) return false; return rc->portsUsedByDebuggers() <= dev->freePorts().count(); } return true; } RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage) { Q_ASSERT(canRun(runConfig, mode)); QnxRunConfiguration *rc = qobject_cast(runConfig); Q_ASSERT(rc); switch (mode) { case NormalRunMode: return new QnxRunControl(rc); case DebugRunMode: { const DebuggerStartParameters params = createDebuggerStartParameters(rc); DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage); if (!runControl) return 0; QnxDebugSupport *debugSupport = new QnxDebugSupport(rc, runControl->engine()); connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished())); return runControl; } case QmlProfilerRunMode: { const AnalyzerStartParameters params = createAnalyzerStartParameters(rc, mode); AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig); QnxAnalyzeSupport * const analyzeSupport = new QnxAnalyzeSupport(rc, runControl); connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished())); return runControl; } case NoRunMode: case CallgrindRunMode: case MemcheckRunMode: case DebugRunModeWithBreakOnMain: QTC_ASSERT(false, return 0); } return 0; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizarddevicepage.ui0000644000015301777760000000712212321547255032517 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerrySetupWizardDevicePage 0 0 508 159 WizardPage Device name: IP or host name of the device Device IP address: Qt::Horizontal 40 20 Device password: The password you use to unlock your device QLineEdit::Password Qt::Horizontal 40 20 Physical device true Simulator Qt::Vertical 20 5 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployconfigurationfactory.h0000644000015301777760000000567512321547255033422 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONFACTORY_H #define QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONFACTORY_H #include namespace ProjectExplorer { class Target; } namespace Qnx { namespace Internal { class BlackBerryDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory { Q_OBJECT public: explicit BlackBerryDeployConfigurationFactory(QObject *parent = 0); ~BlackBerryDeployConfigurationFactory(); QList availableCreationIds(ProjectExplorer::Target *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id); bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const; ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycheckdevmodestepconfigwidget.h0000644000015301777760000000403012321547255033635 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H #define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H #include namespace Qnx { namespace Internal { class BlackBerryCheckDevModeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget { Q_OBJECT public: explicit BlackBerryCheckDevModeStepConfigWidget(); QString displayName() const; QString summaryText() const; bool showWidget() const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardsetuppage.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardsetup0000644000015301777760000000262712321547255034043 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryDeviceConfigurationWizardSetupPage 0 0 484 182 WizardPage QLineEdit::Password Device password: Device host name or IP address: qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptormagicmatcher.cpp0000644000015301777760000000370612321547255031441 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptormagicmatcher.h" #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorMagicMatcher::BarDescriptorMagicMatcher() { } bool BarDescriptorMagicMatcher::matches(const QByteArray &data) const { QXmlStreamReader reader(data); if (reader.readNextStartElement()) return reader.name() == QLatin1String("qnx"); return false; } int BarDescriptorMagicMatcher::priority() const { return Core::MimeGlobPattern::MaxWeight; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeploystepfactory.cpp0000644000015301777760000001145212321547255030535 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeploystepfactory.h" #include "qnxconstants.h" #include "qnxdeviceconfigurationfactory.h" #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; QnxDeployStepFactory::QnxDeployStepFactory() : ProjectExplorer::IBuildStepFactory() { } QList QnxDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const { if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) return QList(); Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->target()->kit()); if (deviceType != QnxDeviceConfigurationFactory::deviceType()) return QList(); return QList() << RemoteLinux::GenericDirectUploadStep::stepId() << ProjectExplorer::DeviceCheckBuildStep::stepId(); } QString QnxDeployStepFactory::displayNameForId(const Core::Id id) const { if (id == RemoteLinux::GenericDirectUploadStep::stepId()) return RemoteLinux::GenericDirectUploadStep::displayName(); else if (id == ProjectExplorer::DeviceCheckBuildStep::stepId()) return ProjectExplorer::DeviceCheckBuildStep::stepDisplayName(); return QString(); } bool QnxDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const { return availableCreationIds(parent).contains(id); } ProjectExplorer::BuildStep *QnxDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) { if (!canCreate(parent, id)) return 0; if (id == RemoteLinux::GenericDirectUploadStep::stepId()) return new RemoteLinux::GenericDirectUploadStep(parent, id); else if (id == ProjectExplorer::DeviceCheckBuildStep::stepId()) return new ProjectExplorer::DeviceCheckBuildStep(parent, id); return 0; } bool QnxDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, ProjectExplorer::idFromMap(map)); } ProjectExplorer::BuildStep *QnxDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; ProjectExplorer::BuildStep * const bs = create(parent, ProjectExplorer::idFromMap(map)); if (bs->fromMap(map)) return bs; delete bs; return 0; } bool QnxDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const { return canCreate(parent, product->id()); } ProjectExplorer::BuildStep *QnxDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) { if (!canClone(parent, product)) return 0; if (RemoteLinux::GenericDirectUploadStep * const other = qobject_cast(product)) return new RemoteLinux::GenericDirectUploadStep(parent, other); else if (ProjectExplorer::DeviceCheckBuildStep * const other = qobject_cast(product)) return new ProjectExplorer::DeviceCheckBuildStep(parent, other); return 0; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployinformation.cpp0000644000015301777760000002573412321547255032041 0ustar pbusernogroup00000000000000/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Digia. ** **************************************************************************/ #include "blackberrydeployinformation.h" #include "blackberrydeployconfiguration.h" #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char COUNT_KEY[] = "Qnx.BlackBerry.DeployInformationCount"; const char DEPLOYINFO_KEY[] = "Qnx.BlackBerry.DeployInformation.%1"; const char ENABLED_KEY[] = "Qnx.BlackBerry.DeployInformation.Enabled"; const char APPDESCRIPTOR_KEY[] = "Qnx.BlackBerry.DeployInformation.AppDescriptor"; const char PACKAGE_KEY[] = "Qnx.BlackBerry.DeployInformation.Package"; const char PROFILE_KEY[] = "Qnx.BlackBerry.DeployInformation.ProFile"; const char TARGET_KEY[] = "Qnx.BlackBerry.DeployInformation.Target"; const char SOURCE_KEY[] = "Qnx.BlackBerry.DeployInformation.Source"; } QString BarPackageDeployInformation::appDescriptorPath() const { if (userAppDescriptorPath.isEmpty()) return sourceDir + QLatin1String("/bar-descriptor.xml"); return userAppDescriptorPath; } QString BarPackageDeployInformation::packagePath() const { if (userPackagePath.isEmpty()) return buildDir + QLatin1Char('/') + targetName + QLatin1String(".bar"); return userPackagePath; } // ---------------------------------------------------------------------------- BlackBerryDeployInformation::BlackBerryDeployInformation(ProjectExplorer::Target *target) : QAbstractTableModel(target) , m_target(target) { connect(project(), SIGNAL(proFilesEvaluated()), this, SLOT(updateModel())); } int BlackBerryDeployInformation::rowCount(const QModelIndex &parent) const { if (parent.isValid()) return 0; return m_deployInformation.count(); } int BlackBerryDeployInformation::columnCount(const QModelIndex &parent) const { if (parent.isValid()) return 0; return ColumnCount; } QVariant BlackBerryDeployInformation::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); if (index.row() >= m_deployInformation.count() || index.column() >= ColumnCount) return QVariant(); BarPackageDeployInformation di = m_deployInformation[index.row()]; if (role == Qt::CheckStateRole) { if (index.column() == EnabledColumn) return di.enabled ? Qt::Checked : Qt::Unchecked; } else if (role == Qt::DisplayRole || role == Qt::EditRole) { if (index.column() == AppDescriptorColumn) return QDir::toNativeSeparators(di.appDescriptorPath()); else if (index.column() == PackageColumn) return QDir::toNativeSeparators(di.packagePath()); } return QVariant(); } QVariant BlackBerryDeployInformation::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Vertical || role != Qt::DisplayRole) return QVariant(); switch (section) { case EnabledColumn: return tr("Enabled"); case AppDescriptorColumn: return tr("Application descriptor file"); case PackageColumn: return tr("Package"); default: return QVariant(); } } bool BlackBerryDeployInformation::setData(const QModelIndex &index, const QVariant &value, int role) { if (!index.isValid()) return false; if (index.row() >= m_deployInformation.count() || index.column() >= ColumnCount) return false; BarPackageDeployInformation &di = m_deployInformation[index.row()]; if (role == Qt::CheckStateRole && index.column() == EnabledColumn) { di.enabled = static_cast(value.toInt()) == Qt::Checked; } else if (role == Qt::EditRole) { if (index.column() == AppDescriptorColumn) di.userAppDescriptorPath = value.toString(); else if (index.column() == PackageColumn) di.userPackagePath = value.toString(); } emit dataChanged(index, index); return true; } Qt::ItemFlags BlackBerryDeployInformation::flags(const QModelIndex &index) const { Qt::ItemFlags flags = QAbstractTableModel::flags(index); switch (index.column()) { case EnabledColumn: flags |= Qt::ItemIsEditable | Qt::ItemIsUserCheckable; break; case AppDescriptorColumn: case PackageColumn: flags |= Qt::ItemIsEditable; break; } return flags; } QList BlackBerryDeployInformation::enabledPackages() const { QList result; foreach (const BarPackageDeployInformation& info, m_deployInformation) { if (info.enabled) result << info; } return result; } QVariantMap BlackBerryDeployInformation::toMap() const { QVariantMap outerMap; outerMap[QLatin1String(COUNT_KEY)] = m_deployInformation.size(); for (int i = 0; i < m_deployInformation.size(); ++i) { const BarPackageDeployInformation &deployInfo = m_deployInformation[i]; QVariantMap deployInfoMap; deployInfoMap[QLatin1String(ENABLED_KEY)] = deployInfo.enabled; deployInfoMap[QLatin1String(APPDESCRIPTOR_KEY)] = deployInfo.userAppDescriptorPath; deployInfoMap[QLatin1String(PACKAGE_KEY)] = deployInfo.userPackagePath; deployInfoMap[QLatin1String(PROFILE_KEY)] = deployInfo.proFilePath; deployInfoMap[QLatin1String(TARGET_KEY)] = deployInfo.targetName; deployInfoMap[QLatin1String(SOURCE_KEY)] = deployInfo.sourceDir; outerMap[QString::fromLatin1(DEPLOYINFO_KEY).arg(i)] = deployInfoMap; } return outerMap; } void BlackBerryDeployInformation::fromMap(const QVariantMap &map) { beginResetModel(); m_deployInformation.clear(); int count = map.value(QLatin1String(COUNT_KEY)).toInt(); for (int i = 0; i < count; ++i) { QVariantMap innerMap = map.value(QString::fromLatin1(DEPLOYINFO_KEY).arg(i)).toMap(); const bool enabled = innerMap.value(QLatin1String(ENABLED_KEY)).toBool(); const QString appDescriptorPath = innerMap.value(QLatin1String(APPDESCRIPTOR_KEY)).toString(); const QString packagePath = innerMap.value(QLatin1String(PACKAGE_KEY)).toString(); const QString proFilePath = innerMap.value(QLatin1String(PROFILE_KEY)).toString(); const QString targetName = innerMap.value(QLatin1String(TARGET_KEY)).toString(); const QString sourceDir = innerMap.value(QLatin1String(SOURCE_KEY)).toString(); BarPackageDeployInformation deployInformation(enabled, proFilePath, sourceDir, m_target->activeBuildConfiguration()->buildDirectory().toString(), targetName); deployInformation.userAppDescriptorPath = appDescriptorPath; deployInformation.userPackagePath = packagePath; m_deployInformation << deployInformation; } endResetModel(); } void BlackBerryDeployInformation::updateModel() { if (m_deployInformation.isEmpty()) { initModel(); return; } beginResetModel(); QList keep; QList appNodes = project()->applicationProFiles(); foreach (QmakeProjectManager::QmakeProFileNode *node, appNodes) { bool nodeFound = false; for (int i = 0; i < m_deployInformation.size(); ++i) { if (m_deployInformation[i].proFilePath == node->path() && (!m_deployInformation[i].userAppDescriptorPath.isEmpty() || !m_deployInformation[i].userPackagePath.isEmpty())) { BarPackageDeployInformation deployInformation = m_deployInformation[i]; // In case the user resets the bar package path (or if it is empty already), we need the current build dir deployInformation.buildDir = m_target->activeBuildConfiguration()->buildDirectory().toString(); keep << deployInformation; nodeFound = true; break; } } if (!nodeFound) keep << deployInformationFromNode(node); } m_deployInformation = keep; endResetModel(); } QmakeProjectManager::QmakeProject *BlackBerryDeployInformation::project() const { return static_cast(m_target->project()); } void BlackBerryDeployInformation::initModel() { if (!m_deployInformation.isEmpty()) return; QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(m_target->kit()); if (!version || !version->isValid()) { beginResetModel(); m_deployInformation.clear(); endResetModel(); return; } const QmakeProjectManager::QmakeProFileNode *const rootNode = project()->rootQmakeProjectNode(); if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard. return; disconnect(project(), SIGNAL(proFilesEvaluated()), this, SLOT(updateModel())); beginResetModel(); m_deployInformation.clear(); QList appNodes = project()->applicationProFiles(); foreach (QmakeProjectManager::QmakeProFileNode *node, appNodes) m_deployInformation << deployInformationFromNode(node); endResetModel(); connect(project(), SIGNAL(proFilesEvaluated()), this, SLOT(updateModel())); } BarPackageDeployInformation BlackBerryDeployInformation::deployInformationFromNode(QmakeProjectManager::QmakeProFileNode *node) const { QmakeProjectManager::TargetInformation ti = node->targetInformation(); QFileInfo fi(node->path()); const QString buildDir = m_target->activeBuildConfiguration()->buildDirectory().toString(); return BarPackageDeployInformation(true, node->path(), fi.absolutePath(), buildDir, ti.target); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryimportcertificatedialog.cpp0000644000015301777760000001103112321547255033155 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryimportcertificatedialog.h" #include "blackberrycertificate.h" #include "ui_blackberryimportcertificatedialog.h" #include #include #include namespace Qnx { namespace Internal { BlackBerryImportCertificateDialog::BlackBerryImportCertificateDialog( QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), m_ui(new Ui_BlackBerryImportCertificateDialog), m_certificate(0) { m_ui->setupUi(this); m_ui->certPath->setExpectedKind(Utils::PathChooser::File); m_ui->certPath->setPromptDialogTitle(tr("Import Certificate")); m_ui->certPath->setPromptDialogFilter(tr("PKCS 12 Archives (*.p12)")); m_cancelButton = m_ui->buttonBox->button(QDialogButtonBox::Cancel); m_okButton = m_ui->buttonBox->button(QDialogButtonBox::Ok); m_okButton->setEnabled(false); connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); connect(m_okButton, SIGNAL(clicked()), this, SLOT(importCertificate())); connect(m_ui->certPath, SIGNAL(changed(QString)), this, SLOT(validate())); connect(m_ui->certPass, SIGNAL(textChanged(QString)), this, SLOT(validate())); } QString BlackBerryImportCertificateDialog::author() const { return m_author; } QString BlackBerryImportCertificateDialog::certPath() const { return m_ui->certPath->path(); } QString BlackBerryImportCertificateDialog::keystorePassword() const { return m_ui->certPass->text(); } BlackBerryCertificate * BlackBerryImportCertificateDialog::certificate() const { return m_certificate; } void BlackBerryImportCertificateDialog::importCertificate() { setBusy(true); m_certificate = new BlackBerryCertificate(certPath(), QString(), keystorePassword()); connect(m_certificate, SIGNAL(finished(int)), this, SLOT(certificateLoaded(int))); m_certificate->load(); } void BlackBerryImportCertificateDialog::validate() { if (!m_ui->certPath->isValid() || m_ui->certPass->text().isEmpty()) { m_okButton->setEnabled(false); return; } m_okButton->setEnabled(true); } void BlackBerryImportCertificateDialog::certificateLoaded(int status) { if (status != BlackBerryCertificate::Success) { setBusy(false); m_certificate->deleteLater(); m_certificate = 0; QString message; if (status == BlackBerryCertificate::WrongPassword) message = tr("The keystore password is invalid."); else if (status == BlackBerryCertificate::InvalidOutputFormat) message = tr("Error parsing inferior process output."); else message = tr("An unknown error has occurred."); QMessageBox::information(this, tr("Error"), message); } else { m_author = m_certificate->author(); accept(); } } void BlackBerryImportCertificateDialog::setBusy(bool busy) { m_ui->certPath->setEnabled(!busy); m_ui->certPass->setEnabled(!busy); m_okButton->setEnabled(!busy); m_cancelButton->setEnabled(!busy); } } // namespace Internal } // namespace Qnx ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorabstractpanelwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorabstractpanelwidget.c0000644000015301777760000000566012321547255033714 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorabstractpanelwidget.h" #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorAbstractPanelWidget::BarDescriptorEditorAbstractPanelWidget(QWidget *parent) : QWidget(parent) { } void BarDescriptorEditorAbstractPanelWidget::setComboBoxBlocked(QComboBox *comboBox, int index) { bool blocked = comboBox->blockSignals(true); comboBox->setCurrentIndex(index); comboBox->blockSignals(blocked); } void BarDescriptorEditorAbstractPanelWidget::setCheckBoxBlocked(QCheckBox *checkBox, bool checked) { bool blocked = checkBox->blockSignals(true); checkBox->setChecked(checked); checkBox->blockSignals(blocked); } void BarDescriptorEditorAbstractPanelWidget::setLineEditBlocked(QLineEdit *lineEdit, const QString &text) { bool blocked = lineEdit->blockSignals(true); lineEdit->setText(text); lineEdit->blockSignals(blocked); } void BarDescriptorEditorAbstractPanelWidget::setTextEditBlocked(QTextEdit *textEdit, const QString &text) { bool blocked = textEdit->blockSignals(true); textEdit->setPlainText(text); textEdit->blockSignals(blocked); } void BarDescriptorEditorAbstractPanelWidget::setPathChooserBlocked(Utils::PathChooser *pathChooser, const QString &path) { bool blocked = pathChooser->blockSignals(true); pathChooser->setPath(path); pathChooser->blockSignals(blocked); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfigurationfactory.cpp0000644000015301777760000000602112321547255032370 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeviceconfigurationfactory.h" #include "qnxconstants.h" #include "qnxdeviceconfigurationwizard.h" #include "qnxdeviceconfiguration.h" #include using namespace Qnx; using namespace Qnx::Internal; QnxDeviceConfigurationFactory::QnxDeviceConfigurationFactory(QObject *parent) : ProjectExplorer::IDeviceFactory(parent) { } QString QnxDeviceConfigurationFactory::displayNameForId(Core::Id type) const { Q_UNUSED(type); return tr("QNX Device"); } QList QnxDeviceConfigurationFactory::availableCreationIds() const { QList result; result << Core::Id(Constants::QNX_QNX_OS_TYPE); return result; } bool QnxDeviceConfigurationFactory::canCreate() const { return true; } ProjectExplorer::IDevice::Ptr QnxDeviceConfigurationFactory::create(Core::Id id) const { Q_UNUSED(id); QnxDeviceConfigurationWizard wizard; if (wizard.exec() != QDialog::Accepted) return ProjectExplorer::IDevice::Ptr(); return wizard.device(); } bool QnxDeviceConfigurationFactory::canRestore(const QVariantMap &map) const { return ProjectExplorer::IDevice::typeFromMap(map) == Constants::QNX_QNX_OS_TYPE; } ProjectExplorer::IDevice::Ptr QnxDeviceConfigurationFactory::restore(const QVariantMap &map) const { QTC_ASSERT(canRestore(map), return QnxDeviceConfiguration::Ptr()); const QnxDeviceConfiguration::Ptr device = QnxDeviceConfiguration::create(); device->fromMap(map); return device; } Core::Id QnxDeviceConfigurationFactory::deviceType() { return Core::Id(Constants::QNX_QNX_OS_TYPE); } ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardpages.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardpages0000644000015301777760000004067412321547255034006 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceconfigurationwizardpages.h" #include "blackberryconfiguration.h" #include "blackberrydebugtokenrequestdialog.h" #include "blackberrysshkeysgenerator.h" #include "blackberrydeviceinformation.h" #include "ui_blackberrydeviceconfigurationwizardsetuppage.h" #include "ui_blackberrydeviceconfigurationwizardquerypage.h" #include "ui_blackberrydeviceconfigurationwizardconfigpage.h" #include "blackberryconfiguration.h" #include "blackberrydeviceconnectionmanager.h" #include "qnxutils.h" #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace Qnx; using namespace Qnx::Internal; namespace { const char DEVICEHOSTNAME_FIELD_ID[] = "DeviceHostName"; const char DEVICEPASSWORD_FIELD_ID[] = "DevicePassword"; const char CONFIGURATIONNAME_FIELD_ID[] = "ConfigurationName"; const char DEBUGTOKENPATH_FIELD_ID[] = "DebugTokenPath"; enum DeviceListUserRole { ItemKindRole = Qt::UserRole, DeviceNameRole, DeviceIpRole, DeviceTypeRole }; } BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizardSetupPage(QWidget *parent) : QWizardPage(parent) , m_ui(new Ui::BlackBerryDeviceConfigurationWizardSetupPage) , m_deviceListDetector(new BlackBerryDeviceListDetector(this)) { m_ui->setupUi(this); setTitle(tr("Connection")); connect(m_ui->deviceListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onDeviceSelectionChanged())); connect(m_deviceListDetector, SIGNAL(deviceDetected(QString,QString,bool)), this, SLOT(onDeviceDetected(QString,QString,bool))); connect(m_deviceListDetector, SIGNAL(finished()), this, SLOT(onDeviceListDetectorFinished())); connect(m_ui->deviceHostIp, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); registerField(QLatin1String(DEVICEHOSTNAME_FIELD_ID), m_ui->deviceHostIp); registerField(QLatin1String(DEVICEPASSWORD_FIELD_ID), m_ui->password); } BlackBerryDeviceConfigurationWizardSetupPage::~BlackBerryDeviceConfigurationWizardSetupPage() { delete m_ui; m_ui = 0; } void BlackBerryDeviceConfigurationWizardSetupPage::initializePage() { m_ui->password->clear(); refreshDeviceList(); } void BlackBerryDeviceConfigurationWizardSetupPage::refreshDeviceList() { m_ui->deviceListWidget->clear(); QListWidgetItem *manual = createDeviceListItem(tr("Specify device manually"), SpecifyManually); m_ui->deviceListWidget->addItem(manual); manual->setSelected(true); QListWidgetItem *pleaseWait = createDeviceListItem(tr("Auto-detecting devices - please wait..."), PleaseWait); m_ui->deviceListWidget->addItem(pleaseWait); m_deviceListDetector->detectDeviceList(); } void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceListDetectorFinished() { QListWidgetItem *pleaseWait = findDeviceListItem(PleaseWait); if (pleaseWait) { m_ui->deviceListWidget->removeItemWidget(pleaseWait); delete pleaseWait; } if (!findDeviceListItem(Autodetected)) { QListWidgetItem *note = createDeviceListItem(tr("No device has been auto-detected."), Note); note->setToolTip(tr("Device auto-detection is available in BB NDK 10.2. " "Make sure that your device is in Development Mode.")); m_ui->deviceListWidget->addItem(note); } } void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceDetected( const QString &deviceName, const QString &hostName, bool isSimulator) { QString displayName(deviceName); if (displayName != hostName) displayName.append(QLatin1String(" (")).append(hostName).append(QLatin1String(")")); QListWidgetItem *device = createDeviceListItem(displayName, Autodetected); device->setData(DeviceNameRole, displayName); device->setData(DeviceIpRole, hostName); device->setData(DeviceTypeRole, isSimulator); QListWidgetItem *pleaseWait = findDeviceListItem(PleaseWait); int row = pleaseWait ? m_ui->deviceListWidget->row(pleaseWait) : m_ui->deviceListWidget->count(); m_ui->deviceListWidget->insertItem(row, device); } void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceSelectionChanged() { QList selectedItems = m_ui->deviceListWidget->selectedItems(); const QListWidgetItem *selected = selectedItems.count() == 1 ? selectedItems[0] : 0; const ItemKind itemKind = selected ? selected->data(ItemKindRole).value() : Note; switch (itemKind) { case SpecifyManually: m_ui->deviceHostIp->setEnabled(true); m_ui->deviceHostIp->setText(QLatin1String("169.254.0.1")); m_ui->password->setEnabled(true); m_ui->deviceHostIp->selectAll(); m_ui->deviceHostIp->setFocus(); break; case Autodetected: m_ui->deviceHostIp->setEnabled(false); m_ui->deviceHostIp->setText(selected->data(DeviceIpRole).toString()); m_ui->password->setEnabled(true); m_ui->password->setFocus(); break; case PleaseWait: case Note: m_ui->deviceHostIp->setEnabled(false); m_ui->deviceHostIp->clear(); m_ui->password->setEnabled(false); break; } } QListWidgetItem *BlackBerryDeviceConfigurationWizardSetupPage::createDeviceListItem( const QString &displayName, ItemKind itemKind) const { QListWidgetItem *item = new QListWidgetItem(displayName); if (itemKind == PleaseWait || itemKind == Note) { item->setFlags(item->flags() & ~Qt::ItemIsSelectable); QFont font = item->font(); font.setItalic(true); item->setFont(font); } item->setData(ItemKindRole, QVariant::fromValue(itemKind)); return item; } QListWidgetItem *BlackBerryDeviceConfigurationWizardSetupPage::findDeviceListItem(ItemKind itemKind) const { int count = m_ui->deviceListWidget->count(); for (int i = 0; i < count; ++i) { QListWidgetItem *item = m_ui->deviceListWidget->item(i); if (item->data(ItemKindRole).value() == itemKind) return item; } return 0; } bool BlackBerryDeviceConfigurationWizardSetupPage::isComplete() const { return !m_ui->deviceHostIp->text().isEmpty(); } QString BlackBerryDeviceConfigurationWizardSetupPage::hostName() const { return m_ui->deviceHostIp->text(); } QString BlackBerryDeviceConfigurationWizardSetupPage::password() const { return m_ui->password->text(); } // ---------------------------------------------------------------------------- BlackBerryDeviceConfigurationWizardQueryPage::BlackBerryDeviceConfigurationWizardQueryPage (BlackBerryDeviceConfigurationWizardHolder &holder, QWidget *parent) : QWizardPage(parent) , m_ui(new Ui::BlackBerryDeviceConfigurationWizardQueryPage) , m_holder(holder) , m_deviceInformation(new BlackBerryDeviceInformation(this)) { m_ui->setupUi(this); setTitle(tr("Device Information")); m_ui->progressBar->setMaximum(Done); connect(m_deviceInformation,SIGNAL(finished(int)),this,SLOT(processQueryFinished(int))); } BlackBerryDeviceConfigurationWizardQueryPage::~BlackBerryDeviceConfigurationWizardQueryPage() { delete m_ui; m_ui = 0; } void BlackBerryDeviceConfigurationWizardQueryPage::initializePage() { m_holder.deviceInfoRetrieved = false; setState(Querying, tr("Querying device information. Please wait...")); m_deviceInformation->setDeviceTarget( field(QLatin1String(DEVICEHOSTNAME_FIELD_ID)).toString(), field(QLatin1String(DEVICEPASSWORD_FIELD_ID)).toString()); } void BlackBerryDeviceConfigurationWizardQueryPage::processQueryFinished(int status) { m_holder.deviceInfoRetrieved = status == BlackBerryDeviceInformation::Success; m_holder.devicePin = m_deviceInformation->devicePin(); m_holder.scmBundle = m_deviceInformation->scmBundle(); m_holder.deviceName = m_deviceInformation->hostName(); if (m_holder.deviceName.isEmpty()) m_holder.deviceName = QLatin1String("BlackBerry at ") + field(QLatin1String(DEVICEHOSTNAME_FIELD_ID)).toString(); m_holder.debugTokenAuthor = m_deviceInformation->debugTokenAuthor(); m_holder.debugTokenValid = m_deviceInformation->debugTokenValid(); m_holder.isSimulator = m_deviceInformation->isSimulator(); m_holder.isProductionDevice = m_deviceInformation->isProductionDevice(); if (m_holder.deviceInfoRetrieved) checkAndGenerateSSHKeys(); else setState(Done, tr("Cannot connect to the device. " "Check if the device is in development mode and has matching host name and password.")); } void BlackBerryDeviceConfigurationWizardQueryPage::checkAndGenerateSSHKeys() { if (! BlackBerryDeviceConnectionManager::instance()->hasValidSSHKeys()) { setState(GeneratingSshKey, tr("Generating SSH keys. Please wait...")); BlackBerrySshKeysGenerator *sshKeysGenerator = new BlackBerrySshKeysGenerator(); connect(sshKeysGenerator, SIGNAL(sshKeysGenerationFailed(QString)), this, SLOT(sshKeysGenerationFailed(QString)), Qt::QueuedConnection); connect(sshKeysGenerator, SIGNAL(sshKeysGenerationFinished(QByteArray,QByteArray)), this, SLOT(processSshKeys(QByteArray,QByteArray)), Qt::QueuedConnection); sshKeysGenerator->start(); } else queryDone(); } void BlackBerryDeviceConfigurationWizardQueryPage::sshKeysGenerationFailed(const QString &error) { // this slot can be called asynchronously - processing it only in GeneratingSshKey state if (m_state != GeneratingSshKey) return; QString message = tr("Failed generating SSH key needed for securing connection to a device. Error:"); message += QLatin1Char(' '); message.append(error); setState(Done, message); } void BlackBerryDeviceConfigurationWizardQueryPage::processSshKeys(const QByteArray &privateKey, const QByteArray &publicKey) { // this slot can be called asynchronously - processing it only in GeneratingSshKey state if (m_state != GeneratingSshKey) return; // condition prevents overriding already generated SSH keys // this may happens when an user enter the QueryPage several times before // the first SSH keys are generated i.e. when multiple calls of checkAndGenerateSSHKeys() // before processSshKeys() is called, multiple processSshKeys() calls are triggered later. // only the first one is allowed to write the SSH keys. if (! BlackBerryDeviceConnectionManager::instance()->hasValidSSHKeys()) { QString error; if (!BlackBerryDeviceConnectionManager::instance()->setSSHKeys(privateKey, publicKey, &error)) { QString message = tr("Failed saving SSH key needed for securing connection to a device. Error:"); message += QLatin1Char(' '); message.append(error); setState(Done, message); return; } } queryDone(); } void BlackBerryDeviceConfigurationWizardQueryPage::queryDone() { setState(Done, tr("Device information retrieved successfully.")); } void BlackBerryDeviceConfigurationWizardQueryPage::setState(QueryState state, const QString &message) { m_state = state; m_ui->statusLabel->setText(message); m_ui->progressBar->setVisible(state != Done); m_ui->progressBar->setValue(state); emit completeChanged(); if (isComplete()) if (wizard()->currentPage() == this) wizard()->next(); } bool BlackBerryDeviceConfigurationWizardQueryPage::isComplete() const { return m_state == Done && m_holder.deviceInfoRetrieved && BlackBerryDeviceConnectionManager::instance()->hasValidSSHKeys(); } // ---------------------------------------------------------------------------- BlackBerryDeviceConfigurationWizardConfigPage::BlackBerryDeviceConfigurationWizardConfigPage (BlackBerryDeviceConfigurationWizardHolder &holder, QWidget *parent) : QWizardPage(parent) , m_ui(new Ui::BlackBerryDeviceConfigurationWizardConfigPage) , m_holder(holder) { m_ui->setupUi(this); setTitle(tr("Configuration")); m_ui->debugTokenField->setExpectedKind(Utils::PathChooser::File); m_ui->debugTokenField->setPromptDialogFilter(QLatin1String("*.bar")); QString debugTokenBrowsePath = QnxUtils::dataDirPath(); if (!QFileInfo(debugTokenBrowsePath).exists()) debugTokenBrowsePath = QDir::homePath(); m_ui->debugTokenField->setInitialBrowsePathBackup(debugTokenBrowsePath); connect(m_ui->configurationNameField, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->debugTokenField, SIGNAL(changed(QString)), this, SIGNAL(completeChanged())); connect(m_ui->generateButton, SIGNAL(clicked()), this, SLOT(generateDebugToken())); registerField(QLatin1String(CONFIGURATIONNAME_FIELD_ID), m_ui->configurationNameField); registerField(QLatin1String(DEBUGTOKENPATH_FIELD_ID), m_ui->debugTokenField); } BlackBerryDeviceConfigurationWizardConfigPage::~BlackBerryDeviceConfigurationWizardConfigPage() { delete m_ui; m_ui = 0; } void BlackBerryDeviceConfigurationWizardConfigPage::initializePage() { QString deviceHostName = field(QLatin1String(DEVICEHOSTNAME_FIELD_ID)).toString(); m_ui->configurationNameField->setText(m_holder.deviceName); m_ui->deviceHostNameField->setText(deviceHostName); m_ui->deviceTypeField->setText(QLatin1String (m_holder.isSimulator ? "Simulator" : "Device")); m_ui->debugTokenField->setEnabled(!m_holder.isSimulator); m_ui->generateButton->setEnabled(!m_holder.isSimulator); } bool BlackBerryDeviceConfigurationWizardConfigPage::isComplete() const { bool configurationNameComplete = !m_ui->configurationNameField->text().isEmpty(); Utils::FileName fileName = m_ui->debugTokenField->fileName(); bool debugTokenComplete = m_holder.isSimulator || !m_holder.isProductionDevice || (!fileName.isEmpty() && QFileInfo(fileName.toString()).exists()); return configurationNameComplete && debugTokenComplete; } void BlackBerryDeviceConfigurationWizardConfigPage::generateDebugToken() { BlackBerryDebugTokenRequestDialog dialog; dialog.setDevicePin(m_holder.devicePin); const int result = dialog.exec(); if (result != QDialog::Accepted) return; m_ui->debugTokenField->setPath(dialog.debugToken()); } QString BlackBerryDeviceConfigurationWizardConfigPage::configurationName() const { return m_ui->configurationNameField->text(); } QString BlackBerryDeviceConfigurationWizardConfigPage::debugToken() const { return m_ui->debugTokenField->fileName().toString(); } // ---------------------------------------------------------------------------- BlackBerryDeviceConfigurationWizardFinalPage::BlackBerryDeviceConfigurationWizardFinalPage(QWidget *parent) : QWizardPage(parent) { setTitle(tr("Summary")); QVBoxLayout *layout = new QVBoxLayout(this); QLabel *label = new QLabel(tr("The new device configuration will be created now."), this); layout->addWidget(label); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfigurationwizardpages.h0000644000015301777760000000404112321547255032706 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H #define QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H #include namespace Qnx { namespace Internal { class QnxDeviceConfigurationWizardSetupPage : public RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage { Q_OBJECT public: explicit QnxDeviceConfigurationWizardSetupPage(QWidget *parent = 0); QString defaultConfigurationName() const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployinformation.h0000644000015301777760000000666412321547255031507 0ustar pbusernogroup00000000000000/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Digia. ** **************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEPLOYINFORMATION_H #define QNX_INTERNAL_BLACKBERRYDEPLOYINFORMATION_H #include namespace ProjectExplorer { class Target; } namespace QmakeProjectManager { class QmakeProFileNode; class QmakeProject; } namespace Qnx { namespace Internal { class BarPackageDeployInformation { public: BarPackageDeployInformation(bool enabled, const QString &proFilePath, const QString &sourceDir, const QString &buildDir, const QString &targetName) : enabled(enabled) , proFilePath(proFilePath) , sourceDir(sourceDir) , buildDir(buildDir) , targetName(targetName) { } QString appDescriptorPath() const; QString packagePath() const; bool enabled; QString proFilePath; QString sourceDir; QString buildDir; QString targetName; QString userAppDescriptorPath; QString userPackagePath; }; class BlackBerryDeployInformation : public QAbstractTableModel { Q_OBJECT public: explicit BlackBerryDeployInformation(ProjectExplorer::Target *target); int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); Qt::ItemFlags flags(const QModelIndex &index) const; QList enabledPackages() const; QVariantMap toMap() const; void fromMap(const QVariantMap &map); private slots: void updateModel(); private: enum Columns { EnabledColumn = 0, AppDescriptorColumn, PackageColumn, ColumnCount // Always have last }; QmakeProjectManager::QmakeProject *project() const; void initModel(); BarPackageDeployInformation deployInformationFromNode(QmakeProjectManager::QmakeProFileNode *node) const; ProjectExplorer::Target *m_target; QList m_deployInformation; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEPLOYINFORMATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwidget.cpp0000644000015301777760000002377712321547255033537 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceconfigurationwidget.h" #include "blackberrydebugtokenuploader.h" #include "blackberrydebugtokenrequestdialog.h" #include "ui_blackberrydeviceconfigurationwidget.h" #include "blackberryconfiguration.h" #include "blackberrydeviceconnectionmanager.h" #include "qnxconstants.h" #include "qnxutils.h" #include #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace Qnx::Internal; BlackBerryDeviceConfigurationWidget::BlackBerryDeviceConfigurationWidget(const IDevice::Ptr &device, QWidget *parent) : IDeviceWidget(device, parent), ui(new Ui::BlackBerryDeviceConfigurationWidget), progressDialog(new QProgressDialog(this)), uploader(new BlackBerryDebugTokenUploader(this)) { ui->setupUi(this); ui->connectionLog->setFont(TextEditor::TextEditorSettings::fontSettings().font()); connect(ui->hostLineEdit, SIGNAL(editingFinished()), this, SLOT(hostNameEditingFinished())); connect(ui->pwdLineEdit, SIGNAL(editingFinished()), this, SLOT(passwordEditingFinished())); connect(ui->keyFileLineEdit, SIGNAL(editingFinished()), this, SLOT(keyFileEditingFinished())); connect(ui->keyFileLineEdit, SIGNAL(browsingFinished()), this, SLOT(keyFileEditingFinished())); connect(ui->showPasswordCheckBox, SIGNAL(toggled(bool)), this, SLOT(showPassword(bool))); connect(ui->debugToken, SIGNAL(changed(QString)), this, SLOT(updateUploadButton())); connect(ui->debugToken, SIGNAL(editingFinished()), this, SLOT(debugTokenEditingFinished())); connect(ui->debugToken, SIGNAL(browsingFinished()), this, SLOT(debugTokenEditingFinished())); connect(uploader, SIGNAL(finished(int)), this, SLOT(uploadFinished(int))); connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(connectionOutput(Core::Id,QString)), this, SLOT(appendConnectionLog(Core::Id,QString))); connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceAboutToConnect(Core::Id)), this, SLOT(clearConnectionLog(Core::Id))); connect(ui->requestButton, SIGNAL(clicked()), this, SLOT(requestDebugToken())); connect(ui->uploadButton, SIGNAL(clicked()), this, SLOT(uploadDebugToken())); QString debugTokenBrowsePath = QnxUtils::dataDirPath(); if (!QFileInfo(debugTokenBrowsePath).exists()) debugTokenBrowsePath = QDir::homePath(); ui->debugToken->setInitialBrowsePathBackup(debugTokenBrowsePath); initGui(); } BlackBerryDeviceConfigurationWidget::~BlackBerryDeviceConfigurationWidget() { delete ui; } void BlackBerryDeviceConfigurationWidget::hostNameEditingFinished() { QSsh::SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); sshParams.host = ui->hostLineEdit->text(); deviceConfiguration()->setSshParameters(sshParams); } void BlackBerryDeviceConfigurationWidget::passwordEditingFinished() { QSsh::SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); sshParams.password = ui->pwdLineEdit->text(); deviceConfiguration()->setSshParameters(sshParams); } void BlackBerryDeviceConfigurationWidget::keyFileEditingFinished() { QSsh::SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); sshParams.privateKeyFile = ui->keyFileLineEdit->path(); deviceConfiguration()->setSshParameters(sshParams); } void BlackBerryDeviceConfigurationWidget::showPassword(bool showClearText) { ui->pwdLineEdit->setEchoMode(showClearText ? QLineEdit::Normal : QLineEdit::Password); } void BlackBerryDeviceConfigurationWidget::debugTokenEditingFinished() { deviceConfiguration()->setDebugToken(ui->debugToken->path()); } void BlackBerryDeviceConfigurationWidget::requestDebugToken() { BlackBerryDebugTokenRequestDialog dialog; if (!ui->hostLineEdit->text().isEmpty() && !ui->pwdLineEdit->text().isEmpty()) dialog.setTargetDetails(ui->hostLineEdit->text(), ui->pwdLineEdit->text()); const int result = dialog.exec(); if (result != QDialog::Accepted) return; ui->debugToken->setPath(dialog.debugToken()); debugTokenEditingFinished(); } void BlackBerryDeviceConfigurationWidget::uploadDebugToken() { // check the debug token path before even laucnhing the uploader process if (!QFileInfo(ui->debugToken->fileName().toString()).exists()) { QMessageBox::critical(this, tr("Error"), tr("Invalid debug token path.")); return; } progressDialog->show(); uploader->uploadDebugToken(ui->debugToken->path(), ui->hostLineEdit->text(), ui->pwdLineEdit->text()); } void BlackBerryDeviceConfigurationWidget::updateUploadButton() { ui->uploadButton->setEnabled(!ui->debugToken->path().isEmpty()); } void BlackBerryDeviceConfigurationWidget::uploadFinished(int status) { progressDialog->hide(); QString errorString = tr("Failed to upload debug token:") + QLatin1Char(' '); switch (status) { case BlackBerryDebugTokenUploader::Success: QMessageBox::information(this, tr("Qt Creator"), tr("Debug token successfully uploaded.")); return; case BlackBerryDebugTokenUploader::NoRouteToHost: errorString += tr("No route to host."); break; case BlackBerryDebugTokenUploader::AuthenticationFailed: errorString += tr("Authentication failed."); break; case BlackBerryDebugTokenUploader::DevelopmentModeDisabled: errorString += tr("Development mode is disabled on the device."); break; case BlackBerryDebugTokenUploader::FailedToStartInferiorProcess: errorString += tr("Failed to start inferior process."); break; case BlackBerryDebugTokenUploader::InferiorProcessTimedOut: errorString += tr("Inferior processes timed out."); break; case BlackBerryDebugTokenUploader::InferiorProcessCrashed: errorString += tr("Inferior process has crashed."); break; case BlackBerryDebugTokenUploader::InferiorProcessReadError: case BlackBerryDebugTokenUploader::InferiorProcessWriteError: errorString += tr("Failed to communicate with the inferior process."); break; case BlackBerryDebugTokenUploader::UnknownError: errorString += tr("An unknwon error has happened."); break; } QMessageBox::critical(this, tr("Error"), errorString); } void BlackBerryDeviceConfigurationWidget::appendConnectionLog(Core::Id deviceId, const QString &line) { if (deviceId == device()->id()) ui->connectionLog->appendPlainText(line.trimmed()); } void BlackBerryDeviceConfigurationWidget::clearConnectionLog(Core::Id deviceId) { if (deviceId == device()->id()) ui->connectionLog->clear(); } void BlackBerryDeviceConfigurationWidget::updateDeviceFromUi() { hostNameEditingFinished(); passwordEditingFinished(); keyFileEditingFinished(); debugTokenEditingFinished(); } void BlackBerryDeviceConfigurationWidget::initGui() { ui->debugToken->setExpectedKind(Utils::PathChooser::File); ui->debugToken->setPromptDialogFilter(QLatin1String("*.bar")); ui->keyFileLineEdit->setExpectedKind(Utils::PathChooser::File); ui->keyFileLineEdit->lineEdit()->setMinimumWidth(0); const QSsh::SshConnectionParameters &sshParams = deviceConfiguration()->sshParameters(); ui->hostLineEdit->setEnabled(!deviceConfiguration()->isAutoDetected()); ui->hostLineEdit->setText(sshParams.host); ui->pwdLineEdit->setText(sshParams.password); ui->keyFileLineEdit->setPath(sshParams.privateKeyFile); ui->showPasswordCheckBox->setChecked(false); ui->debugToken->setPath(deviceConfiguration()->debugToken()); if (deviceConfiguration()->machineType() == IDevice::Emulator) { ui->debugToken->setEnabled(false); ui->requestButton->setEnabled(false); ui->uploadButton->setEnabled(false); ui->debugTokenLabel->setEnabled(false); } progressDialog->setWindowModality(Qt::WindowModal); progressDialog->setWindowTitle(tr("Operation in Progress")); progressDialog->setCancelButton(0); progressDialog->setLabelText(tr("Uploading debug token")); progressDialog->setMinimum(0); progressDialog->setMaximum(0); ui->connectionLog->setPlainText(BlackBerryDeviceConnectionManager::instance()->connectionLog(device()->id()).trimmed()); } BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfigurationWidget::deviceConfiguration() const { return device().dynamicCast(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrykeyswidget.h0000644000015301777760000000456612321547255030123 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYKEYSWIDGET_H_H #define BLACKBERRYKEYSWIDGET_H_H #include "blackberryconfiguration.h" #include #include namespace Qnx { namespace Internal { class BlackBerryCertificate; class BlackBerrySigningUtils; class Ui_BlackBerryKeysWidget; class BlackBerryKeysWidget : public QWidget { Q_OBJECT public: explicit BlackBerryKeysWidget(QWidget *parent = 0); private slots: void certificateLoaded(int status); void createCertificate(); void clearCertificate(); void loadDefaultCertificate(); protected: void showEvent(QShowEvent *event); private: void updateKeysSection(); void updateCertificateSection(); void setCertificateError(const QString &error); void setCreateCertificateVisible(bool show); BlackBerrySigningUtils &m_utils; Ui_BlackBerryKeysWidget *m_ui; }; } // namespace Internal } // namespeace Qnx #endif // BLACKBERRYKEYSWIDGET_H_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorassetswidget.h0000644000015301777760000000544412321547255032400 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORASSETSWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORASSETSWIDGET_H #include "bardescriptoreditorabstractpanelwidget.h" QT_BEGIN_NAMESPACE class QStandardItem; class QStandardItemModel; QT_END_NAMESPACE namespace Qnx { namespace Internal { namespace Ui { class BarDescriptorEditorAssetsWidget; } class BarDescriptorAsset; class BarDescriptorEditorAssetsWidget : public BarDescriptorEditorAbstractPanelWidget { Q_OBJECT public: explicit BarDescriptorEditorAssetsWidget(QWidget *parent = 0); ~BarDescriptorEditorAssetsWidget(); void clear(); void addAsset(const BarDescriptorAsset &asset); QList assets() const; QStandardItemModel *assetsModel() const; public slots: void addAsset(const QString &fullPath); void removeAsset(const QString &fullPath); private slots: void addNewAsset(); void removeSelectedAsset(); void updateEntryCheckState(QStandardItem *item); private: void connectAssetsModel(); void disconnectAssetsModel(); void addAssetInternal(const BarDescriptorAsset &asset); bool hasAsset(const BarDescriptorAsset &asset); Ui::BarDescriptorEditorAssetsWidget *m_ui; QStandardItemModel *m_assetsModel; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORASSETSWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeployconfigurationfactory.cpp0000644000015301777760000001115512321547255032431 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeployconfigurationfactory.h" #include "qnxconstants.h" #include "qnxdeployconfiguration.h" #include "qnxdeviceconfigurationfactory.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; QnxDeployConfigurationFactory::QnxDeployConfigurationFactory(QObject *parent) : ProjectExplorer::DeployConfigurationFactory(parent) { } QList QnxDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const { QList ids; if (canHandle(parent)) ids << Core::Id(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID); return ids; } QString QnxDeployConfigurationFactory::displayNameForId(const Core::Id id) const { if (id.name().startsWith(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID)) return tr("Deploy to QNX Device"); return QString(); } bool QnxDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const { return canHandle(parent) && id.name().startsWith(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID); } ProjectExplorer::DeployConfiguration *QnxDeployConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id) { if (!canCreate(parent, id)) return 0; ProjectExplorer::DeployConfiguration * const dc = new QnxDeployConfiguration(parent, id, displayNameForId(id)); dc->stepList()->insertStep(0, new ProjectExplorer::DeviceCheckBuildStep(dc->stepList(), ProjectExplorer::DeviceCheckBuildStep::stepId())); dc->stepList()->insertStep(1, new RemoteLinux::GenericDirectUploadStep(dc->stepList(), RemoteLinux::GenericDirectUploadStep::stepId())); return dc; } bool QnxDeployConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const { return canCreate(parent, ProjectExplorer::idFromMap(map)); } ProjectExplorer::DeployConfiguration *QnxDeployConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; Core::Id id = ProjectExplorer::idFromMap(map); QnxDeployConfiguration * const dc = new QnxDeployConfiguration(parent, id, displayNameForId(id)); if (!dc->fromMap(map)) { delete dc; return 0; } return dc; } bool QnxDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const { return canCreate(parent, source->id()); } ProjectExplorer::DeployConfiguration *QnxDeployConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) { if (!canClone(parent, source)) return 0; return new QnxDeployConfiguration(parent, qobject_cast(source)); } bool QnxDeployConfigurationFactory::canHandle(ProjectExplorer::Target *t) const { Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(t->kit()); if (deviceType != QnxDeviceConfigurationFactory::deviceType()) return false; return true; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydevicelistdetector.h0000644000015301777760000000436212321547255031623 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H #define QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H #include #include QT_FORWARD_DECLARE_CLASS(QProcess) namespace Qnx { namespace Internal { class BlackBerryDeviceListDetector : public QObject { Q_OBJECT public: explicit BlackBerryDeviceListDetector(QObject *parent = 0); void detectDeviceList(); signals: void deviceDetected(const QString &deviceName, const QString &deviceHostName, bool isSimulator); void finished(); private slots: void processReadyRead(); void processFinished(); private: const QString readProcessLine(); void processData(const QString &line); QProcess *m_process; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryinstallwizardpages.cpp0000644000015301777760000004247012321547255032202 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryinstallwizardpages.h" #include "blackberryconfigurationmanager.h" #include "blackberryconfiguration.h" #include "ui_blackberryinstallwizardtargetpage.h" #include "ui_blackberryinstallwizardprocesspage.h" #include "ui_blackberryinstallwizardndkpage.h" #include "qnxutils.h" #include #include #include #include #include #include #include #include #include namespace Qnx { namespace Internal { namespace { const QLatin1String targetKeyWord("Native SDK"); } NdkPathChooser::NdkPathChooser(Mode mode, QWidget *parent) : Utils::PathChooser(parent) , m_mode(mode) { if (m_mode == NdkPathChooser::InstallMode) { setExpectedKind(Utils::PathChooser::Directory); } else { setExpectedKind(Utils::PathChooser::File); setPromptDialogFilter(Utils::HostOsInfo::isWindowsHost() ? QLatin1String("*.bat") : QLatin1String("*.sh")); } } bool NdkPathChooser::validatePath(const QString &path, QString *errorMessage) { bool result = PathChooser::validatePath(path, errorMessage); if (!result) return false; if (m_mode == NdkPathChooser::InstallMode) return !(QnxUtils::sdkInstallerPath(path).isEmpty()); QFileInfo fi(path); if (Utils::HostOsInfo::isWindowsHost()) return fi.suffix() == QLatin1String("bat"); return fi.suffix() == QLatin1String("sh"); } //------------------------------------------------------------------ BlackBerryInstallWizardOptionPage::BlackBerryInstallWizardOptionPage(BlackBerryInstallerDataHandler &data, QWidget *parent) : QWizardPage(parent) , m_layout(new QVBoxLayout(this)) , m_installButton(new QRadioButton) , m_addButton(new QRadioButton) , m_envFileChooser(new NdkPathChooser(NdkPathChooser::ManualMode)) , m_data(data) { setTitle(tr("Options")); connect(m_addButton, SIGNAL(toggled(bool)), this, SLOT(handleOptionChanged())); connect(m_envFileChooser, SIGNAL(pathChanged(QString)), this, SLOT(handlePathChanged(QString))); } void BlackBerryInstallWizardOptionPage::initializePage() { m_installButton->setText(tr("Install New Target")); m_addButton->setText(tr("Add Existing Target")); if (m_data.mode == BlackBerryInstallerDataHandler::ManuallMode) m_addButton->setChecked(true); else m_installButton->setChecked(true); m_envFileChooser->setEnabled(m_addButton->isChecked()); m_layout->addWidget(m_installButton); m_layout->addWidget(m_addButton); m_layout->addWidget(m_envFileChooser); } bool BlackBerryInstallWizardOptionPage::isComplete() const { return (m_installButton->isChecked() || (m_addButton->isChecked() && m_envFileChooser->isValid())); } int BlackBerryInstallWizardOptionPage::nextId() const { if (m_addButton->isChecked()) return BlackBerryInstallWizard::FinalPageId; return BlackBerryInstallWizard::NdkPageId; } void BlackBerryInstallWizardOptionPage::handleOptionChanged() { if (m_addButton->isChecked()) m_data.mode = BlackBerryInstallerDataHandler::ManuallMode; else m_data.mode = BlackBerryInstallerDataHandler::InstallMode; m_envFileChooser->setEnabled(m_addButton->isChecked()); emit completeChanged(); } void BlackBerryInstallWizardOptionPage::handlePathChanged(const QString &envFilePath) { if (m_envFileChooser->isValid()) m_data.ndkPath = envFilePath; emit completeChanged(); } //------------------------------------------------------------------ BlackBerryInstallWizardNdkPage::BlackBerryInstallWizardNdkPage(BlackBerryInstallerDataHandler &data, QWidget *parent) : QWizardPage(parent) , m_ui(new Ui_BlackBerryInstallWizardNdkPage) , m_data(data) , m_ndkPathChooser(new NdkPathChooser(NdkPathChooser::InstallMode)) , m_manual(new QListWidgetItem) , m_validNdkPath(false) { m_ui->setupUi(this); setTitle(tr("Native SDK")); m_ui->verticalLayout->addWidget(m_ndkPathChooser); connect(m_ui->ndkPathListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(setNdkPath())); connect(m_ndkPathChooser, SIGNAL(pathChanged(QString)), this, SLOT(setManualNdkPath())); } BlackBerryInstallWizardNdkPage::~BlackBerryInstallWizardNdkPage() { delete m_ui; } void BlackBerryInstallWizardNdkPage::initializePage() { m_manual->setText(tr("Specify 10.2 NDK path manually")); m_ui->ndkPathListWidget->addItem(m_manual); m_manual->setSelected(true); QFont font; font.setItalic(true); m_manual->setFont(font); foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) { bool found = false; for (int i = 0; i < m_ui->ndkPathListWidget->count(); i++) { QListWidgetItem* item = m_ui->ndkPathListWidget->item(i); if (item->text() == ndk.path) { found = true; break; } } if (found) continue; if (!QnxUtils::sdkInstallerPath(ndk.path).isEmpty()) { QListWidgetItem *ndkItem = new QListWidgetItem(m_ui->ndkPathListWidget); ndkItem->setText(ndk.path); } } } void BlackBerryInstallWizardNdkPage::setNdkPath() { if (m_ui->ndkPathListWidget->selectedItems().isEmpty()) return; m_ndkPathChooser->setEnabled(m_manual->isSelected()); QString selected = m_ui->ndkPathListWidget->selectedItems().first()->text(); if (!QnxUtils::sdkInstallerPath(selected).isEmpty()) { m_validNdkPath = true; m_data.ndkPath = selected; } else { m_validNdkPath = false; } emit completeChanged(); } void BlackBerryInstallWizardNdkPage::setManualNdkPath() { if (m_ndkPathChooser->isValid()) { m_validNdkPath = true; m_data.ndkPath = m_ndkPathChooser->path(); } else { m_validNdkPath = false; } emit completeChanged(); } bool BlackBerryInstallWizardNdkPage::isComplete() const { return m_validNdkPath; } //------------------------------------------------------------------ BlackBerryInstallWizardTargetPage::BlackBerryInstallWizardTargetPage(BlackBerryInstallerDataHandler &data, QWidget *parent) : QWizardPage(parent) , m_data(data) , m_ui(new Ui_BlackBerryInstallWizardTargetPage) , m_isTargetValid(false) , m_targetListProcess(new QProcess(this)) { m_ui->setupUi(this); setTitle(tr("Target")); connect(m_targetListProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(targetsListProcessFinished())); connect(m_ui->targetsTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(setTarget())); } BlackBerryInstallWizardTargetPage::~BlackBerryInstallWizardTargetPage() { Utils::SynchronousProcess::stopProcess(*m_targetListProcess); delete m_ui; } void BlackBerryInstallWizardTargetPage::initializePage() { // process may be running if going back and forth if (m_targetListProcess->state() == QProcess::Running) { disconnect(m_targetListProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(targetsListProcessFinished())); Utils::SynchronousProcess::stopProcess(*m_targetListProcess); connect(m_targetListProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(targetsListProcessFinished())); } updateAvailableTargetsList(); } bool BlackBerryInstallWizardTargetPage::isComplete() const { return m_isTargetValid; } bool BlackBerryInstallWizardTargetPage::isProcessRunning() const { return (m_targetListProcess->state() == QProcess::Running); } void BlackBerryInstallWizardTargetPage::targetsListProcessFinished() { initTargetsTreeWidget(); QString output = Utils::SynchronousProcess::normalizeNewlines(QString::fromLatin1(m_targetListProcess->readAll())); QList targetList = output.split(QLatin1Char('\n')); m_ui->targetsTreeWidget->clear(); foreach (const QString &target, targetList) { if (!target.isEmpty() && target.contains(targetKeyWord)) { QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->targetsTreeWidget); QStringList res = target.split(QLatin1Char('-')); if (res.count() > 1) { item->setText(0, res.at(0)); item->setText(1, res.at(1)); } } } m_ui->targetsTreeWidget->sortByColumn(0, Qt::DescendingOrder); } void BlackBerryInstallWizardTargetPage::setTarget() { if (m_ui->targetsTreeWidget->selectedItems().isEmpty()) return; QString version = m_ui->targetsTreeWidget->selectedItems().first()->text(0); QString target = m_ui->targetsTreeWidget->selectedItems().first()->text(1); if (target.contains(targetKeyWord)) { m_data.target = target; m_data.version = version; m_isTargetValid = true; } else { m_isTargetValid = false; } emit completeChanged(); } void BlackBerryInstallWizardTargetPage::initTargetsTreeWidget() { m_ui->targetsTreeWidget->clear(); m_ui->targetsTreeWidget->setHeaderHidden(false); m_ui->targetsTreeWidget->header()->setResizeMode(QHeaderView::ResizeToContents); m_ui->targetsTreeWidget->setHeaderItem(new QTreeWidgetItem(QStringList() << tr("Version") << tr("Target"))); m_ui->targetsTreeWidget->setTextElideMode(Qt::ElideNone); m_ui->targetsTreeWidget->setColumnCount(2); } void BlackBerryInstallWizardTargetPage::updateAvailableTargetsList() { m_ui->targetsTreeWidget->clear(); m_ui->targetsTreeWidget->setHeaderHidden(true); QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->targetsTreeWidget); item->setText(0, tr("Querying available targets. Please wait...")); QFont font; font.setItalic(true); item->setFont(0, font); QString qdeProcess = QnxUtils::qdeInstallProcess(m_data.ndkPath, QLatin1String(" --list")); QTC_ASSERT(!qdeProcess.isEmpty(), return); m_targetListProcess->start(qdeProcess); } //------------------------------------------------------------------ BlackBerryInstallWizardProcessPage::BlackBerryInstallWizardProcessPage(BlackBerryInstallerDataHandler &data, QWidget *parent) : QWizardPage(parent) , m_ui(new Ui_BlackBerryInstallWizardProcessPage) , m_data(data) , m_targetProcess(new QProcess(this)) { m_ui->setupUi(this); if (m_data.mode == BlackBerryInstallerDataHandler::UninstallMode) setTitle(tr("Uninstalling")); else setTitle(tr("Installing")); connect(m_targetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(handleProcessFinished(int,QProcess::ExitStatus))); } BlackBerryInstallWizardProcessPage::~BlackBerryInstallWizardProcessPage() { Utils::SynchronousProcess::stopProcess(*m_targetProcess); delete m_ui; } void BlackBerryInstallWizardProcessPage::initializePage() { if (m_data.mode == BlackBerryInstallerDataHandler::UninstallMode) { if (m_data.version.isEmpty()) { wizard()->next(); return; } foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) { if (ndk.version == m_data.version) { m_data.ndkPath = ndk.path; m_data.target = ndk.name; break; } } m_ui->label->setText(tr("Uninstalling target:") + QLatin1Char('\n') + m_data.target); } else { m_ui->label->setText(tr("Installing target:") + QLatin1Char('\n') + m_data.target); } // m_targetProcess could be running if (m_targetProcess->state() == QProcess::Running) { disconnect(m_targetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(handleProcessFinished(int,QProcess::ExitStatus))); Utils::SynchronousProcess::stopProcess(*m_targetProcess); connect(m_targetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(handleProcessFinished(int,QProcess::ExitStatus))); } processTarget(); } bool BlackBerryInstallWizardProcessPage::isComplete() const { return false; } bool BlackBerryInstallWizardProcessPage::isProcessRunning() const { return (m_targetProcess->state() == QProcess::Running); } void BlackBerryInstallWizardProcessPage::handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { m_data.exitCode = exitCode; m_data.exitStatus = exitStatus; if (wizard()->currentPage() == this) wizard()->next(); } void BlackBerryInstallWizardProcessPage::processTarget() { QString option; if (m_data.mode == BlackBerryInstallerDataHandler::UninstallMode) option = QLatin1String(" --uninstall"); else option = QLatin1String(" --install"); QString version = m_data.version; QTC_ASSERT(!version.isEmpty(), return); // deactivate target if activated before uninstalling if (m_data.mode == BlackBerryInstallerDataHandler::UninstallMode) { foreach (BlackBerryConfiguration *config, BlackBerryConfigurationManager::instance().configurations()) { if (m_data.target.contains((config->targetName())) && config->isActive()) { config->deactivate(); break; } } } // Killing the sdkinstall process won't kill the qde process it launched // thus, let's directly launch the resulting qde process QString qdeProcess = QnxUtils::qdeInstallProcess(m_data.ndkPath, option, version); QTC_ASSERT(!qdeProcess.isEmpty(), return); m_targetProcess->start(qdeProcess); m_ui->progressBar->setMaximum(0); m_ui->progressBar->setMinimum(0); m_ui->progressBar->setValue(0); } // -------------------------------------------------------------------------------- BlackBerryInstallWizardFinalPage::BlackBerryInstallWizardFinalPage(BlackBerryInstallerDataHandler &data, QWidget *parent) : QWizardPage(parent) , m_data(data) { setTitle(tr("Summary")); } void BlackBerryInstallWizardFinalPage::initializePage() { QVBoxLayout *layout = new QVBoxLayout(this); QLabel *label = new QLabel(this); layout->addWidget(label); if (m_data.mode == BlackBerryInstallerDataHandler::ManuallMode) { BlackBerryConfigurationManager &configManager = BlackBerryConfigurationManager::instance(); BlackBerryConfiguration *config = configManager.configurationFromEnvFile(Utils::FileName::fromString(m_data.ndkPath)); if (!config) { config = new BlackBerryConfiguration(Utils::FileName::fromString(m_data.ndkPath), false); if (!configManager.addConfiguration(config)) { delete config; // TODO: more explicit error message! label->setText(tr("An error has occurred while adding target from:\n %1").arg(m_data.ndkPath)); return; } label->setText(tr("Target %1 is being added.").arg(m_data.ndkPath)); emit done(); return; } else { label->setText(tr("Target %1 is already added.").arg(m_data.ndkPath)); return; } } QString message; if (m_data.exitCode == 0 && m_data.exitStatus == QProcess::NormalExit) { message = m_data.mode == BlackBerryInstallerDataHandler::UninstallMode ? tr("Finished uninstalling target:\n %1").arg(m_data.target) : tr("Finished installing target:\n %1").arg(m_data.target); emit done(); } else { message = m_data.mode == BlackBerryInstallerDataHandler::UninstallMode ? tr("An error has occurred while uninstalling target:\n %1").arg(m_data.target) : tr("An error has occurred while installing target:\n %1").arg(m_data.target); } label->setText(message); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxbaseqtconfigwidget.cpp0000644000015301777760000000455512321547255030634 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxbaseqtconfigwidget.h" #include "ui_qnxbaseqtconfigwidget.h" #include "qnxabstractqtversion.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; QnxBaseQtConfigWidget::QnxBaseQtConfigWidget(QnxAbstractQtVersion *version) : QtSupport::QtConfigWidget() , m_version(version) { m_ui = new Ui::QnxBaseQtConfigWidget; m_ui->setupUi(this); m_ui->sdkLabel->setText(version->sdkDescription()); m_ui->sdkPath->setExpectedKind(Utils::PathChooser::ExistingDirectory); m_ui->sdkPath->setPath(version->sdkPath()); connect(m_ui->sdkPath, SIGNAL(changed(QString)), this, SLOT(updateSdkPath(QString))); } QnxBaseQtConfigWidget::~QnxBaseQtConfigWidget() { delete m_ui; m_ui = 0; } void QnxBaseQtConfigWidget::updateSdkPath(const QString &path) { m_version->setSdkPath(path); emit changed(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpermissionswidget.cpp0000644000015301777760000000625412321547255034004 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorpermissionswidget.h" #include "ui_bardescriptoreditorpermissionswidget.h" #include "bardescriptorpermissionsmodel.h" using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorPermissionsWidget::BarDescriptorEditorPermissionsWidget(QWidget *parent) : BarDescriptorEditorAbstractPanelWidget(parent), m_ui(new Ui::BarDescriptorEditorPermissionsWidget) { m_ui->setupUi(this); m_permissionsModel = new BarDescriptorPermissionsModel(this); m_ui->permissionsView->setModel(m_permissionsModel); connect(m_ui->selectAllPermissions, SIGNAL(clicked()), m_permissionsModel, SLOT(checkAll())); connect(m_ui->deselectAllPermissions, SIGNAL(clicked()), m_permissionsModel, SLOT(uncheckAll())); connect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); } BarDescriptorEditorPermissionsWidget::~BarDescriptorEditorPermissionsWidget() { delete m_ui; } void BarDescriptorEditorPermissionsWidget::clear() { disconnect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); m_permissionsModel->uncheckAll(); connect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); } QStringList BarDescriptorEditorPermissionsWidget::checkedPermissions() const { return m_permissionsModel->checkedIdentifiers(); } void BarDescriptorEditorPermissionsWidget::checkPermission(const QString &identifier) { disconnect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); m_permissionsModel->checkPermission(identifier); connect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed())); } ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardconfigpage.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardconfi0000644000015301777760000001101112321547255033764 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryDeviceConfigurationWizardConfigPage 0 0 477 348 Form Debug Token Location: Generate 0 0 true Debug token is needed for deploying applications to BlackBerry devices. true Qt::Vertical 20 40 0 0 QFrame::StyledPanel QFrame::Raised Type: 0 0 Host name or IP address: Configuration name: Utils::PathChooser QWidget
utils/pathchooser.h
1 editingFinished() browsingFinished()
generateButton
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryrunconfigurationfactory.cpp0000644000015301777760000001250712321547255033255 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryrunconfigurationfactory.h" #include "qnxconstants.h" #include "blackberryrunconfiguration.h" #include "blackberrydeviceconfigurationfactory.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; static QString pathFromId(const Core::Id id) { return id.suffixAfter(Constants::QNX_BB_RUNCONFIGURATION_PREFIX); } BlackBerryRunConfigurationFactory::BlackBerryRunConfigurationFactory(QObject *parent) : ProjectExplorer::IRunConfigurationFactory(parent) { } QList BlackBerryRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const { QList ids; if (!canHandle(parent)) return ids; QmakeProjectManager::QmakeProject *qt4Project = qobject_cast(parent->project()); if (!qt4Project) return ids; QStringList proFiles = qt4Project->applicationProFilePathes(QLatin1String(Constants::QNX_BB_RUNCONFIGURATION_PREFIX)); foreach (const QString &pf, proFiles) ids << Core::Id::fromString(pf); return ids; } QString BlackBerryRunConfigurationFactory::displayNameForId(const Core::Id id) const { const QString path = pathFromId(id); if (path.isEmpty()) return QString(); if (id.name().startsWith(Constants::QNX_BB_RUNCONFIGURATION_PREFIX)) return QFileInfo(path).completeBaseName(); return QString(); } bool BlackBerryRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const { if (!canHandle(parent)) return false; QmakeProjectManager::QmakeProject *qt4Project = qobject_cast(parent->project()); if (!qt4Project) return false; if (!id.name().startsWith(Constants::QNX_BB_RUNCONFIGURATION_PREFIX)) return false; return qt4Project->hasApplicationProFile(pathFromId(id)); } ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::doCreate(ProjectExplorer::Target *parent, const Core::Id id) { return new BlackBerryRunConfiguration(parent, id, pathFromId(id)); } bool BlackBerryRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const { if (!canHandle(parent)) return false; return ProjectExplorer::idFromMap(map).name().startsWith(Constants::QNX_BB_RUNCONFIGURATION_PREFIX); } ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::doRestore( ProjectExplorer::Target *parent, const QVariantMap &map) { Q_UNUSED(map); return new BlackBerryRunConfiguration(parent, Core::Id(Constants::QNX_BB_RUNCONFIGURATION_PREFIX), QString()); } bool BlackBerryRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const { return canCreate(parent, source->id()); } ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::clone( ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) { if (!canClone(parent, source)) return 0; BlackBerryRunConfiguration *old = static_cast(source); return new BlackBerryRunConfiguration(parent, old); } bool BlackBerryRunConfigurationFactory::canHandle(ProjectExplorer::Target *t) const { if (!t->project()->supportsKit(t->kit())) return false; if (!qobject_cast(t->project())) return false; Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(t->kit()); if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType()) return false; return true; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugsupport.h0000644000015301777760000000516012321547255030456 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEBUGSUPPORT_H #define QNX_INTERNAL_BLACKBERRYDEBUGSUPPORT_H #include #include #include #include namespace Debugger { class DebuggerEngine; class DebuggerRunControl; } namespace Qnx { namespace Internal { class BlackBerryConnect; class BlackBerryRunConfiguration; class BlackBerryApplicationRunner; class BlackBerryDebugSupport : public QObject { Q_OBJECT public: explicit BlackBerryDebugSupport(BlackBerryRunConfiguration *runConfig, Debugger::DebuggerRunControl *runControl); signals: void output(const QString &msg, Utils::OutputFormat format); private slots: void launchRemoteApplication(); void handleStarted(); void handleStartFailed(const QString &message); void handleDebuggerStateChanged(Debugger::DebuggerState state); void handleApplicationOutput(const QString &msg, Utils::OutputFormat format); private: Debugger::DebuggerEngine *m_engine; BlackBerryApplicationRunner *m_runner; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEBUGSUPPORT_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorfactory.cpp0000644000015301777760000000553712321547255031677 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorfactory.h" #include "qnxconstants.h" #include "bardescriptoreditorwidget.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; class BarDescriptorActionHandler : public TextEditor::TextEditorActionHandler { public: BarDescriptorActionHandler() : TextEditor::TextEditorActionHandler(Constants::QNX_BAR_DESCRIPTOR_EDITOR_CONTEXT) { } protected: TextEditor::BaseTextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const { BarDescriptorEditorWidget *w = qobject_cast(editor->widget()); return w ? w->sourceWidget() : 0; } }; BarDescriptorEditorFactory::BarDescriptorEditorFactory(QObject *parent) : Core::IEditorFactory(parent) , m_actionHandler(new BarDescriptorActionHandler) { setId(Constants::QNX_BAR_DESCRIPTOR_EDITOR_ID); setDisplayName(tr("Bar descriptor editor")); addMimeType(Constants::QNX_BAR_DESCRIPTOR_MIME_TYPE); } BarDescriptorEditorFactory::~BarDescriptorEditorFactory() { delete m_actionHandler; } Core::IEditor *BarDescriptorEditorFactory::createEditor(QWidget *parent) { BarDescriptorEditorWidget *editorWidget = new BarDescriptorEditorWidget(parent, m_actionHandler); return editorWidget->editor(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryndksettingswidget.h0000644000015301777760000000623112321547255031474 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYNDKSETTINGSWIDGET_H #define BLACKBERRYNDKSETTINGSWIDGET_H #include "blackberryinstallwizard.h" #include QT_BEGIN_NAMESPACE class QStandardItemModel; class QTreeWidgetItem; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BlackBerryConfiguration; class BlackBerryConfigurationManager; class Ui_BlackBerryNDKSettingsWidget; class BlackBerryNDKSettingsWidget : public QWidget { Q_OBJECT public: explicit BlackBerryNDKSettingsWidget(QWidget *parent = 0); void setWizardMessageVisible(bool visible); bool hasActiveNdk() const; QList activatedTargets(); QList deactivatedTargets(); signals: void targetsUpdated(); public slots: void launchBlackBerrySetupWizard() const; void updateInfoTable(QTreeWidgetItem* currentItem); void updateNdkList(); void addNdkTarget(); void removeNdkTarget(); void activateNdkTarget(); void deactivateNdkTarget(); void uninstallNdkTarget(); void handleInstallationFinished(); void handleUninstallationFinished(); void updateUi(QTreeWidgetItem* item, BlackBerryConfiguration* config); private: void launchBlackBerryInstallerWizard(BlackBerryInstallerDataHandler::Mode mode, const QString& tagetVersion = QString()); Ui_BlackBerryNDKSettingsWidget *m_ui; BlackBerryConfigurationManager *m_bbConfigManager; QTreeWidgetItem *m_autoDetectedNdks; QTreeWidgetItem *m_manualNdks; QList m_activatedTargets; QList m_deactivatedTargets; }; } // namespace Internal } // namespeace Qnx #endif // BLACKBERRYNDKSETTINGSWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxconstants.h0000644000015301777760000001167512321547255026445 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_QNXCONSTANTS_H #define QNX_QNXCONSTANTS_H #include namespace Qnx { enum QnxArchitecture { X86, ArmLeV7, UnknownArch }; namespace Constants { const int QNX_BB_QT_FACTORY_PRIO = 60; const int QNX_QNX_QT_FACTORY_PRIO = 50; const char QNX_TARGET_KEY[] = "QNX_TARGET"; const char QNX_HOST_KEY[] = "QNX_HOST"; const char QNX_BB_QT[] = "Qt4ProjectManager.QtVersion.QNX.BlackBerry"; const char QNX_QNX_QT[] = "Qt4ProjectManager.QtVersion.QNX.QNX"; const char QNX_BB_FEATURE[] = "QtSupport.Wizards.FeatureBlackBerry"; const char QNX_QNX_FEATURE[] = "QtSupport.Wizards.FeatureQNX"; const char QNX_BB_X86_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.BBX86Target"; const char QNX_BB_ARMLEV7_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.BBArmLeV7Target"; const char QNX_QNX_X86_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.QNXX86Target"; const char QNX_QNX_ARMLEV7_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.QNXArmLeV7Target"; const char QNX_BB_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.BBDeployConfiguration"; const char QNX_QNX_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.QNXDeployConfiguration"; const char QNX_BB_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.BBRunConfiguration."; const char QNX_QNX_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.QNXRunConfiguration."; const char QNX_CREATE_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxCreatePackageBuildStep"; const char QNX_DEPLOY_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxDeployPackageBuildStep"; const char QNX_CHECK_DEVELOPMENT_MODE_BS_ID[] = "Qt4ProjectManager.QnxCheckDevelopmentModeBuildStep"; const char QNX_PROFILEPATH_KEY[] = "Qt4ProjectManager.QnxRunConfiguration.ProFilePath"; const char QNX_BB_OS_TYPE[] = "BBOsType"; const char QNX_QNX_OS_TYPE[] = "QnxOsType"; const char QNX_DEBUG_TOKEN_KEY[] = "debugToken"; const char QNX_BLACKBERRY_CASCADES_WIZARD_ID[] = "Q.QnxBlackBerryCascadesApp"; const char QNX_BAR_DESCRIPTOR_WIZARD_ID[] = "Q.QnxBlackBerryBarDescriptor"; const char QNX_BLACKBERRY_QTQUICK_APP_WIZARD_ID[] = "Q.QnxBlackBerryQQApp"; const char QNX_BLACKBERRY_QTQUICK2_APP_WIZARD_ID[] = "Q.QnxBlackBerryQQ2App"; const char QNX_BLACKBERRY_GUI_APP_WIZARD_ID[] = "Q.QnxBlackBerryGuiApp"; const char QNX_BLACKBERRY_SETUP_WIZARD_ID[] = "Q.QnxBlackBerrySetupWizardId"; const char QNX_QNX_PLATFORM_NAME[] = "QNX"; const char QNX_BB_PLATFORM_NAME[] = "BlackBerry"; const char QNX_DEBUG_EXECUTABLE[] = "pdebug"; const char QNX_TOOLCHAIN_ID[] = "Qnx.QccToolChain"; // BlackBerry settings constants const char QNX_BB_CATEGORY[] = "XF.BlackBerry"; const char QNX_BB_CATEGORY_TR[] = QT_TRANSLATE_NOOP("BlackBerry", "BlackBerry"); const char QNX_BB_CATEGORY_ICON[] = ":/qnx/images/target.png"; const char QNX_BB_NDK_SETTINGS_ID[] = "ZZ.BlackBerry NDK Configuration"; const char QNX_BB_SIGNING_ID[] = "ZZ.BlackBerry Signing Infrastructure Configuration"; const char QNX_BAR_DESCRIPTOR_MIME_TYPE[] = "application/vnd.rim.qnx.bar_descriptor"; const char QNX_BAR_DESCRIPTOR_EDITOR_ID[] = "Qnx.BarDescriptorEditor"; const char QNX_BAR_DESCRIPTOR_EDITOR_CONTEXT[] = "Qnx.BarDescriptorEditor"; const char QNX_TASK_CATEGORY_BARDESCRIPTOR[] = "Task.Category.BarDescriptor"; const char QNX_KEY_AUTHOR[] = "author"; const char QNX_KEY_PATH[] = "path"; const char QNX_KEY_ACTIVE[] = "active"; const char QNX_BLACKBERRY_DEPLOY_CMD[] = "blackberry-deploy"; const char QNX_BLACKBERRY_CASCADESIMPORTER_VERSION[] = "0.0.1"; } // namespace Constants } // namespace Qnx #endif // QNX_QNXCONSTANTS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryndkprocess.cpp0000644000015301777760000001176412321547255030450 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryndkprocess.h" #include "blackberryconfiguration.h" #include "blackberryconfigurationmanager.h" #include #include namespace Qnx { namespace Internal { BlackBerryNdkProcess::BlackBerryNdkProcess(const QString &command, QObject *parent) : QObject(parent), m_process(new QProcess(this)), m_command(command) { m_process->setProcessChannelMode(QProcess::MergedChannels); m_process->setEnvironment(Utils::EnvironmentItem::toStringList( BlackBerryConfigurationManager::instance().defaultQnxEnv())); connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished())); connect(m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); } const QString BlackBerryNdkProcess::resolveNdkToolPath(const QString &tool) { QString toolPath; QList qnxEnv = BlackBerryConfigurationManager::instance().defaultQnxEnv(); foreach (const Utils::EnvironmentItem &item, qnxEnv) { if (item.name == QLatin1String("QNX_HOST") && !item.value.isEmpty()) { toolPath = item.value + (QLatin1String("/usr/bin/")) + tool; if (Utils::HostOsInfo::isWindowsHost()) toolPath += QLatin1String(".bat"); break; } } return toolPath; } QString BlackBerryNdkProcess::command() const { return resolveNdkToolPath(m_command); } void BlackBerryNdkProcess::start(const QStringList &arguments) { if (m_process->state() != QProcess::NotRunning) return; resetResults(); m_process->start(command(), arguments); } void BlackBerryNdkProcess::addErrorStringMapping( const QString &message, int errorCode) { m_errorStringMap.insert(message, errorCode); } void BlackBerryNdkProcess::processFinished() { QTextStream processOutput(m_process); if (m_process->exitCode() == 0) { while (!processOutput.atEnd()) processData(processOutput.readLine()); emit finished(Success); return; } int returnStatus = UnknownError; while (!processOutput.atEnd()) { returnStatus = errorLineToReturnStatus(processOutput.readLine()); if (returnStatus >= 0) break; } emit finished(returnStatus); } void BlackBerryNdkProcess::processError(QProcess::ProcessError error) { int errorCode; switch (error) { case QProcess::FailedToStart: errorCode = FailedToStartInferiorProcess; break; case QProcess::Timedout: errorCode = InferiorProcessTimedOut; break; case QProcess::Crashed: errorCode = InferiorProcessCrashed; break; case QProcess::WriteError: errorCode = InferiorProcessWriteError; break; case QProcess::ReadError: errorCode = InferiorProcessReadError; break; case QProcess::UnknownError: default: errorCode = UnknownError; break; } emit finished(errorCode); } int BlackBerryNdkProcess::errorLineToReturnStatus(const QString &line) const { typedef QMap::ConstIterator ConstIt; const ConstIt cend = m_errorStringMap.constEnd(); for (ConstIt it = m_errorStringMap.constBegin(); it != cend; ++it) { if (line.contains(it.key())) return it.value(); } return -1; } void BlackBerryNdkProcess::processData(const QString &line) { Q_UNUSED(line); } void BlackBerryNdkProcess::resetResults() { } } // namespace Internal } // namespace Qnx ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorauthorinformationwidget.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorauthorinformationwidg0000644000015301777760000000460412321547255034064 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORAUTHORINFORMATIONWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORAUTHORINFORMATIONWIDGET_H #include "bardescriptoreditorabstractpanelwidget.h" namespace Qnx { namespace Internal { namespace Ui { class BarDescriptorEditorAuthorInformationWidget; } class BarDescriptorEditorAuthorInformationWidget : public BarDescriptorEditorAbstractPanelWidget { Q_OBJECT public: explicit BarDescriptorEditorAuthorInformationWidget(QWidget *parent = 0); ~BarDescriptorEditorAuthorInformationWidget(); void clear(); QString author() const; void setAuthor(const QString &author); QString authorId() const; void setAuthorId(const QString &authorId); private slots: void setAuthorFromDebugToken(); private: Ui::BarDescriptorEditorAuthorInformationWidget *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORAUTHORINFORMATIONWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizard.h0000644000015301777760000001036212321547255030314 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYSETUPWIZARD_H #define BLACKBERRYSETUPWIZARD_H #include #include #include #include namespace QSsh { class SshKeyGenerator; } namespace Qnx { namespace Internal { class BlackBerrySetupWizardWelcomePage; class BlackBerrySetupWizardNdkPage; class BlackBerrySetupWizardKeysPage; class BlackBerrySetupWizardCertificatePage; class BlackBerrySetupWizardDevicePage; class BlackBerrySetupWizardFinishPage; class BlackBerryCertificate; class BlackBerryDeviceInformation; class BlackBerryDebugTokenRequester; class BlackBerryDebugTokenUploader; class BlackBerrySigningUtils; class BlackBerrySetupWizard : public Utils::Wizard { Q_OBJECT public: explicit BlackBerrySetupWizard(QWidget *parent = 0); virtual ~BlackBerrySetupWizard(); public slots: void accept(); signals: void stepFinished(); void ndkTargetsUpdated(); private slots: void processNextStep(); void deviceInfoFinished(int status); void certificateCreated(int status); void debugTokenArrived(int status); void uploaderFinished(int status); void requestDevicePin(); void generateDeveloperCertificate(); void generateSshKeys(); void requestDebugToken(); void uploadDebugToken(); void writeDeviceInformation(); private: enum PageId { WelcomePageId, NdkPageId, KeysPageId, CertificatePageId, DevicePageId, FinishPageId }; struct Step { QByteArray slot; QString message; }; void registerStep(const QByteArray &slot, const QString &message); void setBusy(bool busy); void cleanupFiles() const; void reset(); QString privateKeyPath() const; QString publicKeyPath() const; QString deviceName() const; QString storeLocation() const; QString certificatePassword() const; QString certificateAuthor() const; QString devicePassword() const; QString hostName() const; bool isPhysicalDevice() const; ProjectExplorer::IDevice::Ptr device(); BlackBerrySetupWizardWelcomePage *m_welcomePage; BlackBerrySetupWizardNdkPage *m_ndkPage; BlackBerrySetupWizardKeysPage *m_keysPage; BlackBerrySetupWizardCertificatePage *m_certificatePage; BlackBerrySetupWizardDevicePage *m_devicePage; BlackBerrySetupWizardFinishPage *m_finishPage; BlackBerryCertificate *m_certificate; BlackBerryDeviceInformation *m_deviceInfo; BlackBerryDebugTokenRequester *m_requester; BlackBerryDebugTokenUploader *m_uploader; BlackBerrySigningUtils &m_utils; QSsh::SshKeyGenerator *m_keyGenerator; QString m_devicePin; QList m_stepList; int m_currentStep; int m_stepOffset; }; } // namespace Qnx } // namespace Internal #endif // BLACKBERRYSETUPWIZARD_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryimportcertificatedialog.ui0000644000015301777760000000371312321547255033020 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryImportCertificateDialog 0 0 412 88 Import Certificate Path: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password QDialogButtonBox::Cancel|QDialogButtonBox::Ok Utils::PathChooser QWidget
utils/pathchooser.h
1
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeploystep.cpp0000644000015301777760000001315112321547255030455 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeploystep.h" #include "qnxconstants.h" #include "blackberrydeployconfiguration.h" #include "blackberrydeploystepconfigwidget.h" #include "qnxutils.h" #include "blackberrydeployinformation.h" #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeployStep::BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl) : BlackBerryAbstractDeployStep(bsl, Core::Id(Constants::QNX_DEPLOY_PACKAGE_BS_ID)) { setDisplayName(tr("Deploy packages")); } BlackBerryDeployStep::BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryDeployStep *bs) : BlackBerryAbstractDeployStep(bsl, bs) { setDisplayName(tr("Deploy packages")); } BlackBerryDeployStep::~BlackBerryDeployStep() { } bool BlackBerryDeployStep::init() { if (!BlackBerryAbstractDeployStep::init()) return false; QString deployCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD)); if (deployCmd.isEmpty()) { raiseError(tr("Could not find deploy command '%1' in the build environment") .arg(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD))); return false; } if (deviceHost().isEmpty()) { raiseError(tr("No hostname specified for device")); return false; } BlackBerryDeployConfiguration *deployConfig = qobject_cast(deployConfiguration()); QTC_ASSERT(deployConfig, return false); QList packagesToDeploy = deployConfig->deploymentInfo()->enabledPackages(); if (packagesToDeploy.isEmpty()) { raiseError(tr("No packages enabled for deployment")); return false; } foreach (const BarPackageDeployInformation &info, packagesToDeploy) { QStringList args; args << QLatin1String("-installApp"); args << QLatin1String("-device") << deviceHost(); if (!password().isEmpty()) args << QLatin1String("-password") << password(); args << QnxUtils::addQuotes(QDir::toNativeSeparators(info.packagePath())); addCommand(deployCmd, args); } return true; } void BlackBerryDeployStep::run(QFutureInterface &fi) { BlackBerryDeployConfiguration *deployConfig = qobject_cast(deployConfiguration()); QTC_ASSERT(deployConfig, return); QList packagesToDeploy = deployConfig->deploymentInfo()->enabledPackages(); foreach (const BarPackageDeployInformation &info, packagesToDeploy) { if (!QFileInfo(info.packagePath()).exists()) { raiseError(tr("Package '%1' does not exist. Create the package first.").arg(info.packagePath())); fi.reportResult(false); return; } } BlackBerryAbstractDeployStep::run(fi); } void BlackBerryDeployStep::cleanup() { } void BlackBerryDeployStep::processStarted(const ProjectExplorer::ProcessParameters ¶ms) { QString arguments = params.prettyArguments(); if (!password().isEmpty()) { const QString passwordLine = QLatin1String(" -password ") + password(); const QString hiddenPasswordLine = QLatin1String(" -password "); arguments.replace(passwordLine, hiddenPasswordLine); } emitOutputInfo(params, arguments); } ProjectExplorer::BuildStepConfigWidget *BlackBerryDeployStep::createConfigWidget() { return new BlackBerryDeployStepConfigWidget(); } QString BlackBerryDeployStep::deviceHost() const { BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit()); if (device) return device->sshParameters().host; return QString(); } QString BlackBerryDeployStep::password() const { BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit()); if (device) return device->sshParameters().password; return QString(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditor.cpp0000644000015301777760000001230112321547255030272 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditor.h" #include "qnxconstants.h" #include "bardescriptoreditorwidget.h" #include "bardescriptordocument.h" #include #include #include #include #include #include #include #include using namespace ProjectExplorer; namespace Qnx { namespace Internal { BarDescriptorEditor::BarDescriptorEditor(BarDescriptorEditorWidget *editorWidget) { setWidget(editorWidget); m_file = new BarDescriptorDocument(editorWidget); m_toolBar = new QToolBar(editorWidget); m_actionGroup = new QActionGroup(this); connect(m_actionGroup, SIGNAL(triggered(QAction*)), this, SLOT(changeEditorPage(QAction*))); QAction *generalAction = m_toolBar->addAction(tr("General")); generalAction->setData(General); generalAction->setCheckable(true); m_actionGroup->addAction(generalAction); QAction *applicationAction = m_toolBar->addAction(tr("Application")); applicationAction->setData(Application); applicationAction->setCheckable(true); m_actionGroup->addAction(applicationAction); QAction *assetsAction = m_toolBar->addAction(tr("Assets")); assetsAction->setData(Assets); assetsAction->setCheckable(true); m_actionGroup->addAction(assetsAction); QAction *sourceAction = m_toolBar->addAction(tr("XML Source")); sourceAction->setData(Source); sourceAction->setCheckable(true); m_actionGroup->addAction(sourceAction); generalAction->setChecked(true); setContext(Core::Context(Constants::QNX_BAR_DESCRIPTOR_EDITOR_CONTEXT, TextEditor::Constants::C_TEXTEDITOR)); } bool BarDescriptorEditor::open(QString *errorString, const QString &fileName, const QString &realFileName) { QTC_ASSERT(fileName == realFileName, return false); return m_file->open(errorString, fileName); } Core::IDocument *BarDescriptorEditor::document() { return m_file; } Core::Id BarDescriptorEditor::id() const { return Constants::QNX_BAR_DESCRIPTOR_EDITOR_ID; } QWidget *BarDescriptorEditor::toolBar() { return m_toolBar; } BarDescriptorEditor::EditorPage BarDescriptorEditor::activePage() const { BarDescriptorEditorWidget *editorWidget = qobject_cast(widget()); QTC_ASSERT(editorWidget, return static_cast(-1)); return static_cast(editorWidget->currentIndex()); } void BarDescriptorEditor::changeEditorPage(QAction *action) { setActivePage(static_cast(action->data().toInt())); } void BarDescriptorEditor::setActivePage(BarDescriptorEditor::EditorPage page) { BarDescriptorEditorWidget *editorWidget = qobject_cast(widget()); QTC_ASSERT(editorWidget, return); int prevPage = editorWidget->currentIndex(); if (prevPage == page) return; if (page == Source) { editorWidget->setXmlSource(m_file->xmlSource()); } else if (prevPage == Source) { TaskHub::clearTasks(Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR); QString errorMsg; int errorLine; if (!m_file->loadContent(editorWidget->xmlSource(), &errorMsg, &errorLine)) { TaskHub::addTask(Task::Error, errorMsg, Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR, Utils::FileName::fromString(m_file->filePath()), errorLine); TaskHub::requestPopup(); foreach (QAction *action, m_actionGroup->actions()) if (action->data().toInt() == Source) action->setChecked(true); return; } } editorWidget->setCurrentIndex(page); } } // namespace Internal } // namespace Qnx ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpackageinformationwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpackageinformationwid0000644000015301777760000000742412321547255034011 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorpackageinformationwidget.h" #include "ui_bardescriptoreditorpackageinformationwidget.h" using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorPackageInformationWidget::BarDescriptorEditorPackageInformationWidget(QWidget *parent) : BarDescriptorEditorAbstractPanelWidget(parent), m_ui(new Ui::BarDescriptorEditorPackageInformationWidget) { m_ui->setupUi(this); QRegExp versionNumberRegExp(QLatin1String("(\\d{1,3}\\.)?(\\d{1,3}\\.)?(\\d{1,3})")); QRegExpValidator *versionNumberValidator = new QRegExpValidator(versionNumberRegExp, this); m_ui->packageVersion->setValidator(versionNumberValidator); connect(m_ui->packageId, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); connect(m_ui->packageVersion, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); connect(m_ui->packageBuildId, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); } BarDescriptorEditorPackageInformationWidget::~BarDescriptorEditorPackageInformationWidget() { delete m_ui; } void BarDescriptorEditorPackageInformationWidget::clear() { setLineEditBlocked(m_ui->packageId, QString()); setLineEditBlocked(m_ui->packageVersion, QString()); setLineEditBlocked(m_ui->packageBuildId, QString()); } QString BarDescriptorEditorPackageInformationWidget::packageId() const { return m_ui->packageId->text(); } void BarDescriptorEditorPackageInformationWidget::setPackageId(const QString &packageId) { setLineEditBlocked(m_ui->packageId, packageId); } QString BarDescriptorEditorPackageInformationWidget::packageVersion() const { QString version = m_ui->packageVersion->text(); int pos = 0; if (m_ui->packageVersion->validator()->validate(version, pos) == QValidator::Intermediate) { if (version.endsWith(QLatin1Char('.'))) version = version.left(version.size() - 1); } return version; } void BarDescriptorEditorPackageInformationWidget::setPackageVersion(const QString &packageVersion) { setLineEditBlocked(m_ui->packageVersion, packageVersion); } QString BarDescriptorEditorPackageInformationWidget::packageBuildId() const { return m_ui->packageBuildId->text(); } void BarDescriptorEditorPackageInformationWidget::setPackageBuildId(const QString &packageBuildId) { setLineEditBlocked(m_ui->packageBuildId, packageBuildId); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryndkprocess.h0000644000015301777760000000561312321547255030111 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYNDKPROCESS_H #define QNX_INTERNAL_BLACKBERRYNDKPROCESS_H #include #include #include namespace Qnx { namespace Internal { class BlackBerryNdkProcess : public QObject { Q_OBJECT public: enum ProcessStatus { Success, FailedToStartInferiorProcess, InferiorProcessTimedOut, InferiorProcessCrashed, InferiorProcessWriteError, InferiorProcessReadError, UnknownError, UserStatus }; /** * @brief Resolves full path to an NDK cmd-line tool. * @return a full-path to the NDK cmd-line tool; * or empty QString when no default QNX configuration is found. */ static const QString resolveNdkToolPath(const QString &tool); signals: void finished(int status); protected: explicit BlackBerryNdkProcess(const QString &command, QObject *parent = 0); void start(const QStringList &arguments); void addErrorStringMapping(const QString &message, int errorCode); QString command() const; private slots: void processFinished(); void processError(QProcess::ProcessError error); private: int errorLineToReturnStatus(const QString &line) const; virtual void processData(const QString &line); virtual void resetResults(); QProcess *m_process; QString m_command; QMap m_errorStringMap; }; } } #endif // QNX_INTERNAL_BLACKBERRYNDKPROCESS_H ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpackageinformationwidget.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpackageinformationwid0000644000015301777760000000472412321547255034011 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORPACKAGEINFORMATIONWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORPACKAGEINFORMATIONWIDGET_H #include "bardescriptoreditorabstractpanelwidget.h" namespace Qnx { namespace Internal { namespace Ui { class BarDescriptorEditorPackageInformationWidget; } class BarDescriptorEditorPackageInformationWidget : public BarDescriptorEditorAbstractPanelWidget { Q_OBJECT public: explicit BarDescriptorEditorPackageInformationWidget(QWidget *parent = 0); ~BarDescriptorEditorPackageInformationWidget(); void clear(); QString packageId() const; void setPackageId(const QString &packageId); QString packageVersion() const; void setPackageVersion(const QString &packageVersion); QString packageBuildId() const; void setPackageBuildId(const QString &packageBuildId); private: Ui::BarDescriptorEditorPackageInformationWidget *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORPACKAGEINFORMATIONWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryruncontrolfactory.cpp0000644000015301777760000001537412321547255032073 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryruncontrolfactory.h" #include "blackberryrunconfiguration.h" #include "blackberryruncontrol.h" #include "blackberrydeployconfiguration.h" #include "blackberrydebugsupport.h" #include "blackberryqtversion.h" #include "blackberrydeviceconnectionmanager.h" #include "qnxutils.h" #include #include #include #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryRunControlFactory::BlackBerryRunControlFactory(QObject *parent) : ProjectExplorer::IRunControlFactory(parent) { } bool BlackBerryRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const { Q_UNUSED(mode); BlackBerryRunConfiguration *rc = qobject_cast(runConfiguration); if (!rc) return false; BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(rc->target()->kit()); if (!device) return false; // The device can only run the same application once, any subsequent runs will // not launch a second instance. Disable the Run button if the application is already // running on the device. if (m_activeRunControls.contains(rc->key())) { QPointer activeRunControl = m_activeRunControls[rc->key()]; if (activeRunControl && activeRunControl.data()->isRunning()) return false; else m_activeRunControls.remove(rc->key()); } BlackBerryDeployConfiguration *activeDeployConf = qobject_cast( rc->target()->activeDeployConfiguration()); return activeDeployConf != 0; } ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, QString *errorMessage) { BlackBerryRunConfiguration *rc = qobject_cast(runConfiguration); if (!rc) return 0; BlackBerryDeployConfiguration *activeDeployConf = qobject_cast( rc->target()->activeDeployConfiguration()); if (!activeDeployConf) { if (errorMessage) *errorMessage = tr("No active deploy configuration"); return 0; } if (mode == ProjectExplorer::NormalRunMode) { BlackBerryRunControl *runControl = new BlackBerryRunControl(rc); m_activeRunControls[rc->key()] = runControl; return runControl; } Debugger::DebuggerRunControl * const runControl = Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration, errorMessage); if (!runControl) return 0; new BlackBerryDebugSupport(rc, runControl); m_activeRunControls[rc->key()] = runControl; return runControl; } Debugger::DebuggerStartParameters BlackBerryRunControlFactory::startParameters( const BlackBerryRunConfiguration *runConfig) { Debugger::DebuggerStartParameters params; ProjectExplorer::Target *target = runConfig->target(); ProjectExplorer::Kit *k = target->kit(); params.startMode = Debugger::AttachToRemoteServer; params.debuggerCommand = Debugger::DebuggerKitInformation::debuggerCommand(k).toString(); params.sysRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k).toString(); params.useCtrlCStub = true; if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k)) params.toolChainAbi = tc->targetAbi(); params.executable = runConfig->localExecutableFilePath(); params.displayName = runConfig->displayName(); params.remoteSetupNeeded = true; Debugger::DebuggerRunConfigurationAspect *aspect = runConfig->extraAspect(); if (aspect->useQmlDebugger()) { BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfig->target()->kit()); if (device) { params.qmlServerAddress = device->sshParameters().host; params.qmlServerPort = aspect->qmlDebugServerPort(); params.languages |= Debugger::QmlLanguage; } } if (aspect->useCppDebugger()) params.languages |= Debugger::CppLanguage; if (const ProjectExplorer::Project *project = runConfig->target()->project()) { params.projectSourceDirectory = project->projectDirectory(); if (const ProjectExplorer::BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration()) params.projectBuildDirectory = buildConfig->buildDirectory().toString(); params.projectSourceFiles = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles); } BlackBerryQtVersion *qtVersion = dynamic_cast(QtSupport::QtKitInformation::qtVersion(k)); if (qtVersion) params.solibSearchPath = QnxUtils::searchPaths(qtVersion); return params; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployconfigurationfactory.cpp0000644000015301777760000001172012321547255033741 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeployconfigurationfactory.h" #include "qnxconstants.h" #include "blackberrycheckdevmodestep.h" #include "blackberrydeployconfiguration.h" #include "blackberrycreatepackagestep.h" #include "blackberrydeploystep.h" #include "blackberrydeviceconfigurationfactory.h" #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeployConfigurationFactory::BlackBerryDeployConfigurationFactory(QObject *parent) : ProjectExplorer::DeployConfigurationFactory(parent) { } BlackBerryDeployConfigurationFactory::~BlackBerryDeployConfigurationFactory() { } QList BlackBerryDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const { QList result; QmakeProjectManager::QmakeProject *project = qobject_cast(parent->project()); if (!project) return result; Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit()); if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType()) return result; result << Core::Id(Constants::QNX_BB_DEPLOYCONFIGURATION_ID); return result; } QString BlackBerryDeployConfigurationFactory::displayNameForId(const Core::Id id) const { if (id == Constants::QNX_BB_DEPLOYCONFIGURATION_ID) return tr("Deploy to BlackBerry Device"); return QString(); } bool BlackBerryDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const { return availableCreationIds(parent).contains(id); } ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::create( ProjectExplorer::Target *parent, const Core::Id id) { if (!canCreate(parent, id)) return 0; BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent); dc->stepList()->insertStep(0, new BlackBerryCheckDevModeStep(dc->stepList())); dc->stepList()->insertStep(1, new BlackBerryCreatePackageStep(dc->stepList())); dc->stepList()->insertStep(2, new BlackBerryDeployStep(dc->stepList())); return dc; } bool BlackBerryDeployConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const { return canCreate(parent, ProjectExplorer::idFromMap(map)); } ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::restore( ProjectExplorer::Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent); if (dc->fromMap(map)) return dc; delete dc; return 0; } bool BlackBerryDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const { return canCreate(parent, source->id()); } ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::clone( ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) { if (!canClone(parent, source)) return 0; BlackBerryDeployConfiguration *old = static_cast(source); return new BlackBerryDeployConfiguration(parent, old); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwidget.ui0000644000015301777760000001154312321547255033356 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryDeviceConfigurationWidget 0 0 458 308 QFormLayout::AllNonFixedFieldsGrow 0 0 0 0 &Device name: hostLineEdit IP or host name of the device Device &password: pwdLineEdit QLineEdit::Password Show password Debug token: debugToken Private key file: keyFileLineEdit Connection log: connectionLog true Qt::Horizontal 40 20 Request Upload debugToken keyFileLineEdit hostNameLabel hostLineEdit passwordLabel keyLabel debugTokenLabel label connectionLog Utils::PathChooser QWidget
utils/pathchooser.h
1 editingFinished() browsingFinished()
hostLineEdit pwdLineEdit showPasswordCheckBox requestButton uploadButton connectionLog
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpermissionswidget.ui0000644000015301777760000000305612321547255033634 0ustar pbusernogroup00000000000000 Qnx::Internal::BarDescriptorEditorPermissionsWidget 0 0 314 171 Form false false Qt::Horizontal 40 20 Select All Deselect All qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/Qnx.pluginspec.in0000644000015301777760000000203512321547255026765 0ustar pbusernogroup00000000000000 BlackBerry (C) 2014 BlackBerry Commercial Usage Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Digia. GNU Lesser General Public License Usage Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. Adds support for QNX and BlackBerry 10 to Qt Creator Device Support http://www.blackberry.com $$dependencyList qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysshkeysgenerator.cpp0000644000015301777760000000551412321547255031671 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrysshkeysgenerator.h" #include using namespace Qnx::Internal; BlackBerrySshKeysGenerator::BlackBerrySshKeysGenerator() : QThread(0) , m_keyGen(new QSsh::SshKeyGenerator) { connect(this, SIGNAL(finished()), this, SLOT(deleteLater())); } BlackBerrySshKeysGenerator::~BlackBerrySshKeysGenerator() { delete m_keyGen; m_keyGen = 0; } void BlackBerrySshKeysGenerator::run() { const bool success = m_keyGen->generateKeys(QSsh::SshKeyGenerator::Rsa, QSsh::SshKeyGenerator::Mixed, 4096, QSsh::SshKeyGenerator::DoNotOfferEncryption); if (success) { // BB10 devices allow to use public key with no comment // or a comment in username@hostname format // QSsh::SshKeyGenerator class creates comments in 'QtCreator/TIMEZONE' format // therefore stripping this comment out QByteArray publicKey = m_keyGen->publicKey(); int firstSpace = publicKey.indexOf(' '); if (firstSpace >= 0) { int secondSpace = publicKey.indexOf(' ', firstSpace + 1); if (secondSpace >= 0) publicKey.truncate(secondSpace); } emit sshKeysGenerationFinished(m_keyGen->privateKey(), publicKey); } else emit sshKeysGenerationFailed(m_keyGen->error()); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryabstractdeploystep.h0000644000015301777760000000655712321547255031662 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYABSTRACTDEPLOYSTEP_H #define QNX_INTERNAL_BLACKBERRYABSTRACTDEPLOYSTEP_H #include "blackberryprocessparser.h" #include #include #include QT_BEGIN_NAMESPACE class QEventLoop; QT_END_NAMESPACE namespace Utils { class QtcProcess; } namespace Qnx { namespace Internal { class BlackBerryAbstractDeployStep : public ProjectExplorer::BuildStep { Q_OBJECT public: explicit BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, Core::Id id); ~BlackBerryAbstractDeployStep(); bool init(); void run(QFutureInterface &fi); protected: BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryAbstractDeployStep *bs); void addCommand(const QString &command, const QStringList &arguments); virtual void stdOutput(const QString &line); virtual void stdError(const QString &line); virtual void processStarted(const ProjectExplorer::ProcessParameters ¶m); void emitOutputInfo(const ProjectExplorer::ProcessParameters ¶ms, const QString& arguments); void raiseError(const QString &errorMessage); private slots: void reportProgress(int progress); void processReadyReadStdOutput(); void processReadyReadStdError(); void checkForCancel(); void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); private: void ctor(); void runCommands(); void runNextCommand(); QList m_params; int m_processCounter; Utils::QtcProcess *m_process; Utils::Environment m_environment; QString m_buildDirectory; QTimer *m_timer; QFutureInterface *m_futureInterface; QEventLoop *m_eventLoop; BlackBerryProcessParser m_outputParser; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYABSTRACTDEPLOYSTEP_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorabstractpanelwidget.h0000644000015301777760000000472212321547255033717 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORABSTRACTPANELWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORABSTRACTPANELWIDGET_H #include namespace Utils { class PathChooser; } QT_BEGIN_NAMESPACE class QCheckBox; class QComboBox; class QLineEdit; class QTextEdit; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BarDescriptorEditorAbstractPanelWidget : public QWidget { Q_OBJECT public: explicit BarDescriptorEditorAbstractPanelWidget(QWidget *parent = 0); virtual void clear() = 0; signals: void changed(); protected: void setComboBoxBlocked(QComboBox *comboBox, int index); void setCheckBoxBlocked(QCheckBox *checkBox, bool checked); void setLineEditBlocked(QLineEdit *lineEdit, const QString &text); void setTextEditBlocked(QTextEdit *textEdit, const QString &text); void setPathChooserBlocked(Utils::PathChooser *pathChooser, const QString &path); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORABSTRACTPANELWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryconfiguration.h0000644000015301777760000000744712321547255030614 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYCONFIGURATIONS_H #define BLACKBERRYCONFIGURATIONS_H #include "qnxconstants.h" #include #include #include #include #include #include namespace QtSupport { class BaseQtVersion; } namespace Debugger { class DebuggerItem; } namespace Qnx { namespace Internal { class QnxAbstractQtVersion; class QnxToolChain; class BlackBerryConfiguration { Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryConfiguration) public: BlackBerryConfiguration(const Utils::FileName &ndkEnvFile, bool isAutoDetected, const QString &displayName = QString()); bool activate(); void deactivate(); QString ndkPath() const; QString displayName() const; QString targetName() const; QString qnxHost() const; bool isAutoDetected() const; bool isActive() const; bool isValid() const; Utils::FileName ndkEnvFile() const; Utils::FileName qmake4BinaryFile() const; Utils::FileName qmake5BinaryFile() const; Utils::FileName gccCompiler() const; Utils::FileName deviceDebuger() const; Utils::FileName simulatorDebuger() const; Utils::FileName sysRoot() const; QList qnxEnv() const; private: QString m_displayName; QString m_targetName; QString m_qnxHost; bool m_isAutoDetected; Utils::FileName m_ndkEnvFile; Utils::FileName m_qmake4BinaryFile; Utils::FileName m_qmake5BinaryFile; Utils::FileName m_gccCompiler; Utils::FileName m_deviceDebugger; Utils::FileName m_simulatorDebugger; Utils::FileName m_sysRoot; QList m_qnxEnv; QnxAbstractQtVersion* createQtVersion( const Utils::FileName &qmakePath, Qnx::QnxArchitecture arch, const QString &versionName); QnxToolChain* createToolChain( ProjectExplorer::Abi abi, const QString &versionName); QVariant createDebuggerItem( QList abis, Qnx::QnxArchitecture arch, const QString &versionName); ProjectExplorer::Kit* createKit( QnxAbstractQtVersion* version, QnxToolChain* toolChain, const QVariant &debuggerItemId); QList findRegisteredQtVersions() const; }; } // namespace Internal } // namespace Qnx #endif // BLACKBERRYCONFIGURATIONS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepfactory.cpp0000644000015301777760000001062012321547255033326 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycreatepackagestepfactory.h" #include "qnxconstants.h" #include "blackberrycreatepackagestep.h" #include "blackberrydeviceconfigurationfactory.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryCreatePackageStepFactory::BlackBerryCreatePackageStepFactory(QObject *parent) : ProjectExplorer::IBuildStepFactory(parent) { } BlackBerryCreatePackageStepFactory::~BlackBerryCreatePackageStepFactory() { } QList BlackBerryCreatePackageStepFactory::availableCreationIds( ProjectExplorer::BuildStepList *parent) const { if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) return QList(); Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->target()->kit()); if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType()) return QList(); return QList() << Core::Id(Constants::QNX_CREATE_PACKAGE_BS_ID); } QString BlackBerryCreatePackageStepFactory::displayNameForId(const Core::Id id) const { if (id == Constants::QNX_CREATE_PACKAGE_BS_ID) return tr("Create BAR Packages"); return QString(); } bool BlackBerryCreatePackageStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const { return availableCreationIds(parent).contains(id); } ProjectExplorer::BuildStep *BlackBerryCreatePackageStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) { if (!canCreate(parent, id)) return 0; return new BlackBerryCreatePackageStep(parent); } bool BlackBerryCreatePackageStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, ProjectExplorer::idFromMap(map)); } ProjectExplorer::BuildStep *BlackBerryCreatePackageStepFactory::restore( ProjectExplorer::BuildStepList *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; BlackBerryCreatePackageStep *bs = new BlackBerryCreatePackageStep(parent); if (bs->fromMap(map)) return bs; delete bs; return 0; } bool BlackBerryCreatePackageStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const { return canCreate(parent, source->id()); } ProjectExplorer::BuildStep *BlackBerryCreatePackageStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) { if (!canClone(parent, source)) return 0; return new BlackBerryCreatePackageStep(parent, static_cast(source)); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfiguration.h0000644000015301777760000000617112321547255030453 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEVICECONFIGURATION_H #define QNX_INTERNAL_QNXDEVICECONFIGURATION_H #include namespace Qnx { namespace Internal { class QnxDeviceConfiguration : public RemoteLinux::LinuxDevice { Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxDeviceConfiguration) public: typedef QSharedPointer Ptr; typedef QSharedPointer ConstPtr; static Ptr create(); static Ptr create(const QString &name, Core::Id type, MachineType machineType, Origin origin = ManuallyAdded, Core::Id id = Core::Id()); ProjectExplorer::IDevice::Ptr clone() const; ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const; ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; ProjectExplorer::DeviceTester *createDeviceTester() const; QString displayType() const; int qnxVersion() const; void fromMap(const QVariantMap &map); QVariantMap toMap() const; protected: QnxDeviceConfiguration(); QnxDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id); QnxDeviceConfiguration(const QnxDeviceConfiguration &other); QString interruptProcessByNameCommandLine(const QString &filePath) const; QString killProcessByNameCommandLine(const QString &filePath) const; private: void updateVersionNumber() const; mutable int m_versionNumber; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEVICECONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceinformation.h0000644000015301777760000000546212321547255031445 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICEINFO_H #define QNX_INTERNAL_BLACKBERRYDEVICEINFO_H #include "blackberryndkprocess.h" namespace Qnx { namespace Internal { class BlackBerryDeviceInformation : public BlackBerryNdkProcess { Q_OBJECT public: enum ReturnStatus { NoRouteToHost = UserStatus, AuthenticationFailed, DevelopmentModeDisabled, FailedToStartInferiorProcess, InferiorProcessTimedOut, InferiorProcessCrashed, InferiorProcessWriteError, InferiorProcessReadError }; explicit BlackBerryDeviceInformation(QObject *parent = 0); void setDeviceTarget(const QString &deviceIp, const QString &devicePassword); QString devicePin() const; QString deviceOS() const; QString hardwareId() const; QString debugTokenAuthor() const; bool debugTokenValid() const; QString scmBundle() const; QString hostName() const; bool isSimulator() const; bool isProductionDevice() const; private: QString m_devicePin; QString m_deviceOS; QString m_hardwareId; QString m_debugTokenAuthor; QString m_scmBundle; QString m_hostName; bool m_debugTokenValid; bool m_isSimulator; bool m_isProductionDevice; void processData(const QString &line); void resetResults(); }; } } #endif // QNX_INTERNAL_BLACKBERRYDEBUGTOKENUPLOADER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenrequester.h0000644000015301777760000000431512321547255032023 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEBUGTOKENREQUESTER_H #define QNX_INTERNAL_BLACKBERRYDEBUGTOKENREQUESTER_H #include "blackberryndkprocess.h" namespace Qnx { namespace Internal { class BlackBerryDebugTokenRequester : public BlackBerryNdkProcess { Q_OBJECT public: enum ReturnStatus { WrongCskPassword = UserStatus, WrongKeystorePassword, NetworkUnreachable, IllegalPin, NotYetRegistered }; explicit BlackBerryDebugTokenRequester(QObject *parent = 0); void requestDebugToken(const QString &path, const QString &cskPassword, const QString &keyStore, const QString &keyStorePassword, const QString &devicePin); }; } } #endif // QNX_INTERNAL_BLACKBERRYDEBUGTOKENREQUESTER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceprocesssignaloperation.h0000644000015301777760000000506012321547255032375 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNXDEVICEPROCESSSIGNALOPERATION_H #define QNXDEVICEPROCESSSIGNALOPERATION_H #include namespace Qnx { namespace Internal { class QnxDeviceProcessSignalOperation : public RemoteLinux::RemoteLinuxSignalOperation { Q_OBJECT protected: explicit QnxDeviceProcessSignalOperation(const QSsh::SshConnectionParameters sshParameters); private: QString killProcessByNameCommandLine(const QString &filePath) const; QString interruptProcessByNameCommandLine(const QString &filePath) const; friend class QnxDeviceConfiguration; }; class BlackBerryDeviceProcessSignalOperation : public RemoteLinux::RemoteLinuxSignalOperation { Q_OBJECT protected: explicit BlackBerryDeviceProcessSignalOperation(const QSsh::SshConnectionParameters sshParameters); private: QString killProcessByNameCommandLine(const QString &filePath) const; QString interruptProcessByNameCommandLine(const QString &filePath) const; friend class BlackBerryDeviceConfiguration; }; } // namespace Internal } // namespace Qnx #endif // QNXDEVICEPROCESSSIGNALOPERATION_H ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepconfigwidget.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepconfigwidget.0000644000015301777760000000465212321547255033635 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPCONFIGWIDGET_H #define QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPCONFIGWIDGET_H #include namespace Qnx { namespace Internal { namespace Ui { class BlackBerryCreatePackageStepConfigWidget; } class BlackBerryCreatePackageStep; class BlackBerryCreatePackageStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget { Q_OBJECT public: explicit BlackBerryCreatePackageStepConfigWidget(BlackBerryCreatePackageStep *step); ~BlackBerryCreatePackageStepConfigWidget(); QString displayName() const; QString summaryText() const; bool showWidget() const; private slots: void setPackageMode(bool signPackagesChecked); void showPasswords(bool show); private: BlackBerryCreatePackageStep *m_step; Ui::BlackBerryCreatePackageStepConfigWidget *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPCONFIGWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryconfiguration.cpp0000644000015301777760000003307512321547255031143 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryconfiguration.h" #include "blackberryqtversion.h" #include "qnxtoolchain.h" #include "qnxutils.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace QtSupport; using namespace Utils; using namespace Debugger; namespace Qnx { namespace Internal { BlackBerryConfiguration::BlackBerryConfiguration(const FileName &ndkEnvFile, bool isAutoDetected, const QString &displayName) { Q_ASSERT(!QFileInfo(ndkEnvFile.toString()).isDir()); m_ndkEnvFile = ndkEnvFile; m_isAutoDetected = isAutoDetected; QString ndkPath = ndkEnvFile.parentDir().toString(); m_displayName = displayName.isEmpty() ? ndkPath.split(QDir::separator()).last() : displayName; m_qnxEnv = QnxUtils::qnxEnvironmentFromNdkFile(m_ndkEnvFile.toString()); QString ndkTarget; foreach (const Utils::EnvironmentItem &item, m_qnxEnv) { if (item.name == QLatin1String("QNX_TARGET")) ndkTarget = item.value; else if (item.name == QLatin1String("QNX_HOST")) m_qnxHost = item.value; } // The QNX_TARGET value is using Unix-like separator on all platforms. QString sep = QString::fromLatin1("/qnx6"); m_targetName = ndkTarget.split(sep).first().split(QLatin1Char('/')).last(); if (QDir(ndkTarget).exists()) m_sysRoot = FileName::fromString(ndkTarget); FileName qmake4Path = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/qmake"))); FileName qmake5Path = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/qt5/qmake"))); FileName gccPath = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/qcc"))); FileName deviceGdbPath = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/ntoarm-gdb"))); FileName simulatorGdbPath = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/ntox86-gdb"))); if (qmake4Path.toFileInfo().exists()) m_qmake4BinaryFile = qmake4Path; if (qmake5Path.toFileInfo().exists()) m_qmake5BinaryFile = qmake5Path; if (gccPath.toFileInfo().exists()) m_gccCompiler = gccPath; if (deviceGdbPath.toFileInfo().exists()) m_deviceDebugger = deviceGdbPath; if (simulatorGdbPath.toFileInfo().exists()) m_simulatorDebugger = simulatorGdbPath; } QString BlackBerryConfiguration::ndkPath() const { return m_ndkEnvFile.parentDir().toString(); } QString BlackBerryConfiguration::displayName() const { return m_displayName; } QString BlackBerryConfiguration::targetName() const { return m_targetName; } QString BlackBerryConfiguration::qnxHost() const { return m_qnxHost; } bool BlackBerryConfiguration::isAutoDetected() const { return m_isAutoDetected; } bool BlackBerryConfiguration::isActive() const { return !findRegisteredQtVersions().isEmpty(); } bool BlackBerryConfiguration::isValid() const { return !((m_qmake4BinaryFile.isEmpty() && m_qmake5BinaryFile.isEmpty()) || m_gccCompiler.isEmpty() || m_deviceDebugger.isEmpty() || m_simulatorDebugger.isEmpty()); } FileName BlackBerryConfiguration::ndkEnvFile() const { return m_ndkEnvFile; } FileName BlackBerryConfiguration::qmake4BinaryFile() const { return m_qmake4BinaryFile; } FileName BlackBerryConfiguration::qmake5BinaryFile() const { return m_qmake5BinaryFile; } FileName BlackBerryConfiguration::gccCompiler() const { return m_gccCompiler; } FileName BlackBerryConfiguration::deviceDebuger() const { return m_deviceDebugger; } FileName BlackBerryConfiguration::simulatorDebuger() const { return m_simulatorDebugger; } FileName BlackBerryConfiguration::sysRoot() const { return m_sysRoot; } QList BlackBerryConfiguration::qnxEnv() const { return m_qnxEnv; } QnxAbstractQtVersion *BlackBerryConfiguration::createQtVersion( const FileName &qmakePath, Qnx::QnxArchitecture arch, const QString &versionName) { QnxAbstractQtVersion *version = new BlackBerryQtVersion( arch, qmakePath, true, QString(), m_ndkEnvFile.toString()); version->setDisplayName(tr("Qt %1 for %2").arg(version->qtVersionString(), versionName)); QtVersionManager::addVersion(version); return version; } QnxToolChain *BlackBerryConfiguration::createToolChain( ProjectExplorer::Abi abi, const QString &versionName) { QnxToolChain* toolChain = new QnxToolChain(ToolChain::AutoDetection); toolChain->setDisplayName(tr("QCC for %1").arg(versionName)); toolChain->setCompilerCommand(m_gccCompiler); toolChain->setNdkPath(ndkPath()); if (abi.isValid()) toolChain->setTargetAbi(abi); ToolChainManager::registerToolChain(toolChain); return toolChain; } QVariant BlackBerryConfiguration::createDebuggerItem( QList abis, Qnx::QnxArchitecture arch, const QString &versionName) { Utils::FileName command = arch == X86 ? m_simulatorDebugger : m_deviceDebugger; DebuggerItem debugger; debugger.setCommand(command); debugger.setEngineType(GdbEngineType); debugger.setAutoDetected(true); debugger.setAbis(abis); debugger.setDisplayName(tr("Debugger for %1").arg(versionName)); return DebuggerItemManager::registerDebugger(debugger); } Kit *BlackBerryConfiguration::createKit( QnxAbstractQtVersion *version, QnxToolChain *toolChain, const QVariant &debuggerItemId) { Kit *kit = new Kit; bool isSimulator = version->architecture() == X86; QtKitInformation::setQtVersion(kit, version); ToolChainKitInformation::setToolChain(kit, toolChain); if (debuggerItemId.isValid()) DebuggerKitInformation::setDebugger(kit, debuggerItemId); if (isSimulator) QmakeProjectManager::QmakeKitInformation::setMkspec( kit, FileName::fromString(QLatin1String("blackberry-x86-qcc"))); DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE); SysRootKitInformation::setSysRoot(kit, m_sysRoot); kit->setDisplayName(version->displayName()); kit->setIconPath(FileName::fromString(QLatin1String(Constants::QNX_BB_CATEGORY_ICON))); kit->setAutoDetected(true); kit->setMutable(DeviceKitInformation::id(), true); kit->setSticky(QtKitInformation::id(), true); kit->setSticky(ToolChainKitInformation::id(), true); kit->setSticky(DeviceTypeKitInformation::id(), true); kit->setSticky(SysRootKitInformation::id(), true); kit->setSticky(DebuggerKitInformation::id(), true); kit->setSticky(QmakeProjectManager::QmakeKitInformation::id(), true); KitManager::registerKit(kit); return kit; } bool BlackBerryConfiguration::activate() { if (!isValid()) { if (m_isAutoDetected) return false; QString errorMessage = tr("The following errors occurred while activating target: %1").arg(m_targetName); if (m_qmake4BinaryFile.isEmpty() && m_qmake5BinaryFile.isEmpty()) errorMessage += QLatin1Char('\n') + tr("- No Qt version found."); if (m_gccCompiler.isEmpty()) errorMessage += QLatin1Char('\n') + tr("- No GCC compiler found."); if (m_deviceDebugger.isEmpty()) errorMessage += QLatin1Char('\n') + tr("- No GDB debugger found for BB10 Device."); if (!m_simulatorDebugger.isEmpty()) errorMessage += QLatin1Char('\n') + tr("- No GDB debugger found for BB10 Simulator."); QMessageBox::warning(0, tr("Cannot Set up BB10 Configuration"), errorMessage, QMessageBox::Ok); return false; } if (isActive()) return true; deactivate(); // cleaning-up artifacts autodetected by old QtCreator versions QString armVersionName = tr("BlackBerry Device - %1").arg(m_targetName); QString x86VersionName = tr("BlackBerry Simulator - %1").arg(m_targetName); // create versions QnxAbstractQtVersion *qt4ArmVersion = 0; QnxAbstractQtVersion *qt4X86Version = 0; QnxAbstractQtVersion *qt5ArmVersion = 0; QnxAbstractQtVersion *qt5X86Version = 0; QList armAbis; QList x86Abis; if (!m_qmake4BinaryFile.isEmpty()) { qt4ArmVersion = createQtVersion(m_qmake4BinaryFile, Qnx::ArmLeV7, armVersionName); armAbis << qt4ArmVersion->qtAbis(); qt4X86Version = createQtVersion(m_qmake4BinaryFile, Qnx::X86, x86VersionName); x86Abis << qt4X86Version->qtAbis(); } if (!m_qmake5BinaryFile.isEmpty()) { qt5ArmVersion = createQtVersion(m_qmake5BinaryFile, Qnx::ArmLeV7, armVersionName); foreach (Abi abi, qt5ArmVersion->qtAbis()) if (!armAbis.contains(abi)) armAbis << abi; qt5X86Version = createQtVersion(m_qmake5BinaryFile, Qnx::X86, x86VersionName); foreach (Abi abi, qt5X86Version->qtAbis()) if (!x86Abis.contains(abi)) x86Abis << abi; } // create toolchains QnxToolChain *armToolChain = createToolChain( !armAbis.isEmpty() ? armAbis.first() : Abi(), armVersionName); QnxToolChain *x86ToolChain = createToolChain( !x86Abis.isEmpty() ? x86Abis.first() : Abi(), x86VersionName); // create debuggers QVariant armDebuggerItemId = createDebuggerItem(armAbis, Qnx::ArmLeV7, armVersionName); QVariant x86DebuggerItemId = createDebuggerItem(x86Abis, Qnx::X86, x86VersionName); // create kits if (qt4ArmVersion) createKit(qt4ArmVersion, armToolChain, armDebuggerItemId); if (qt4X86Version) createKit(qt4X86Version, x86ToolChain, x86DebuggerItemId); if (qt5ArmVersion) createKit(qt5ArmVersion, armToolChain, armDebuggerItemId); if (qt5X86Version) createKit(qt5X86Version, x86ToolChain, x86DebuggerItemId); return true; } QList BlackBerryConfiguration::findRegisteredQtVersions() const { QList versions; foreach (BaseQtVersion *version, QtVersionManager::versions()) { if (version->type() == QLatin1String(Constants::QNX_BB_QT)) { QnxAbstractQtVersion *qnxVersion = dynamic_cast(version); if (qnxVersion && qnxVersion->isAutodetected() && (qnxVersion->qmakeCommand() == qmake4BinaryFile() || qnxVersion->qmakeCommand() == qmake5BinaryFile())) versions << qnxVersion; } } return versions; } void BlackBerryConfiguration::deactivate() { QList versions = findRegisteredQtVersions(); QList toolChains; foreach (Kit *kit, KitManager::kits()) { if (kit->isAutoDetected()) { BaseQtVersion *version = QtKitInformation::qtVersion(kit); if (versions.contains(version)) { ToolChain *toolChain = ToolChainKitInformation::toolChain(kit); if (toolChain) toolChains << toolChain; KitManager::deregisterKit(kit); } } } foreach (const DebuggerItem &item, DebuggerItemManager::debuggers()) if (item.isAutoDetected() && (item.command() == m_simulatorDebugger || item.command() == m_deviceDebugger)) DebuggerItemManager::deregisterDebugger(item.id()); foreach (ToolChain *toolChain, ToolChainManager::toolChains()) if (toolChain->isAutoDetected() && (toolChains.contains(toolChain) || toolChain->compilerCommand() == m_gccCompiler)) ToolChainManager::deregisterToolChain(toolChain); foreach (BaseQtVersion *version, versions) QtVersionManager::removeVersion(version); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeployconfiguration.cpp0000644000015301777760000000373512321547255031046 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeployconfiguration.h" using namespace Qnx; using namespace Qnx::Internal; QnxDeployConfiguration::QnxDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id, const QString &defaultDisplayName) : RemoteLinux::RemoteLinuxDeployConfiguration(target, id, defaultDisplayName) { } QnxDeployConfiguration::QnxDeployConfiguration(ProjectExplorer::Target *target, QnxDeployConfiguration *source) : RemoteLinux::RemoteLinuxDeployConfiguration(target, source) { cloneSteps(source); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysigningpasswordsdialog.h0000644000015301777760000000431312321547255032516 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYSIGNINGPASSWORDSDIALOG_H #define QNX_INTERNAL_BLACKBERRYSIGNINGPASSWORDSDIALOG_H #include namespace Qnx { namespace Internal { namespace Ui { class BlackBerrySigningPasswordsDialog; } class BlackBerrySigningPasswordsDialog : public QDialog { Q_OBJECT public: explicit BlackBerrySigningPasswordsDialog(QWidget *parent = 0); ~BlackBerrySigningPasswordsDialog(); void setCskPassword(const QString &cskPassword); void setStorePassword(const QString &storePassword); QString cskPassword() const; QString storePassword() const; private: Ui::BlackBerrySigningPasswordsDialog *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYSIGNINGPASSWORDSDIALOG_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorgeneralwidget.cpp0000644000015301777760000001114112321547255033035 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorgeneralwidget.h" #include "ui_bardescriptoreditorgeneralwidget.h" #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorGeneralWidget::BarDescriptorEditorGeneralWidget(QWidget *parent) : BarDescriptorEditorAbstractPanelWidget(parent), m_ui(new Ui::BarDescriptorEditorGeneralWidget) { m_ui->setupUi(this); m_ui->orientation->addItem(tr("Default"), QLatin1String("")); m_ui->orientation->addItem(tr("Auto-orient"), QLatin1String("auto-orient")); m_ui->orientation->addItem(tr("Landscape"), QLatin1String("landscape")); m_ui->orientation->addItem(tr("Portrait"), QLatin1String("portrait")); m_ui->chrome->addItem(tr("Standard"), QLatin1String("standard")); m_ui->chrome->addItem(tr("None"), QLatin1String("none")); connect(m_ui->orientation, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); connect(m_ui->chrome, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); connect(m_ui->transparentMainWindow, SIGNAL(toggled(bool)), this, SIGNAL(changed())); connect(m_ui->applicationArguments, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); } BarDescriptorEditorGeneralWidget::~BarDescriptorEditorGeneralWidget() { delete m_ui; } void BarDescriptorEditorGeneralWidget::clear() { setComboBoxBlocked(m_ui->orientation, m_ui->orientation->findData(QLatin1String(""))); setComboBoxBlocked(m_ui->chrome, m_ui->chrome->findData(QLatin1String("none"))); setCheckBoxBlocked(m_ui->transparentMainWindow, false); setLineEditBlocked(m_ui->applicationArguments, QString()); } QString BarDescriptorEditorGeneralWidget::orientation() const { return m_ui->orientation->itemData(m_ui->orientation->currentIndex()).toString(); } void BarDescriptorEditorGeneralWidget::setOrientation(const QString &orientation) { int index = m_ui->orientation->findData(orientation); QTC_ASSERT(index >= 0, return); setComboBoxBlocked(m_ui->orientation, index); } QString BarDescriptorEditorGeneralWidget::chrome() const { return m_ui->chrome->itemData(m_ui->chrome->currentIndex()).toString(); } void BarDescriptorEditorGeneralWidget::setChrome(const QString &chrome) { int index = m_ui->chrome->findData(chrome); QTC_ASSERT(index >= 0, return); setComboBoxBlocked(m_ui->chrome, index); } bool BarDescriptorEditorGeneralWidget::transparent() const { return m_ui->transparentMainWindow->isChecked(); } void BarDescriptorEditorGeneralWidget::setTransparent(bool transparent) { setCheckBoxBlocked(m_ui->transparentMainWindow, transparent); } void BarDescriptorEditorGeneralWidget::appendApplicationArgument(const QString &argument) { QString completeArguments = m_ui->applicationArguments->text(); if (!completeArguments.isEmpty()) completeArguments.append(QLatin1Char(' ')); completeArguments.append(argument); setLineEditBlocked(m_ui->applicationArguments, completeArguments); } QStringList BarDescriptorEditorGeneralWidget::applicationArguments() const { // TODO: Should probably handle "argument with spaces within quotes" return m_ui->applicationArguments->text().split(QLatin1Char(' ')); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeployconfigurationfactory.h0000644000015301777760000000556712321547255032110 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H #define QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H #include namespace Qnx { namespace Internal { class QnxDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory { Q_OBJECT public: explicit QnxDeployConfigurationFactory(QObject *parent = 0); QList availableCreationIds(ProjectExplorer::Target *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id); bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const; ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source); bool canHandle(ProjectExplorer::Target *t) const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfiguration.cpp0000644000015301777760000001555412321547255031013 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeviceconfiguration.h" #include "qnxdevicetester.h" #include "qnxdeviceprocesslist.h" #include "qnxdeviceprocesssignaloperation.h" #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char QnxVersionKey[] = "QnxVersion"; } class QnxPortsGatheringMethod : public ProjectExplorer::PortsGatheringMethod { // TODO: The command is probably needlessly complicated because the parsing method // used to be fixed. These two can now be matched to each other. QByteArray commandLine(QAbstractSocket::NetworkLayerProtocol protocol) const { Q_UNUSED(protocol); return "netstat -na " "| sed 's/[a-z]\\+\\s\\+[0-9]\\+\\s\\+[0-9]\\+\\s\\+\\(\\*\\|[0-9\\.]\\+\\)\\.\\([0-9]\\+\\).*/\\2/g' " "| while read line; do " "if [[ $line != udp* ]] && [[ $line != Active* ]]; then " "printf '%x\n' $line; " "fi; " "done"; } QList usedPorts(const QByteArray &output) const { QList ports; QList portStrings = output.split('\n'); portStrings.removeFirst(); foreach (const QByteArray &portString, portStrings) { if (portString.isEmpty()) continue; bool ok; const int port = portString.toInt(&ok, 16); if (ok) { if (!ports.contains(port)) ports << port; } else { qWarning("%s: Unexpected string '%s' is not a port.", Q_FUNC_INFO, portString.data()); } } return ports; } }; QnxDeviceConfiguration::QnxDeviceConfiguration() : RemoteLinux::LinuxDevice() , m_versionNumber(0) { } QnxDeviceConfiguration::QnxDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id) : RemoteLinux::LinuxDevice(name, type, machineType, origin, id) , m_versionNumber(0) { } QnxDeviceConfiguration::QnxDeviceConfiguration(const QnxDeviceConfiguration &other) : RemoteLinux::LinuxDevice(other) , m_versionNumber(other.m_versionNumber) { } QnxDeviceConfiguration::Ptr QnxDeviceConfiguration::create() { return Ptr(new QnxDeviceConfiguration); } QnxDeviceConfiguration::Ptr QnxDeviceConfiguration::create(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id) { return Ptr(new QnxDeviceConfiguration(name, type, machineType, origin, id)); } QString QnxDeviceConfiguration::displayType() const { return tr("QNX"); } int QnxDeviceConfiguration::qnxVersion() const { if (m_versionNumber == 0) updateVersionNumber(); return m_versionNumber; } void QnxDeviceConfiguration::updateVersionNumber() const { QEventLoop eventLoop; ProjectExplorer::SshDeviceProcess versionNumberProcess(sharedFromThis()); QObject::connect(&versionNumberProcess, SIGNAL(finished()), &eventLoop, SLOT(quit())); QObject::connect(&versionNumberProcess, SIGNAL(error(QProcess::ProcessError)), &eventLoop, SLOT(quit())); QStringList arguments; arguments << QLatin1String("-r"); versionNumberProcess.start(QLatin1String("uname"), arguments); bool isGuiThread = QThread::currentThread() == QCoreApplication::instance()->thread(); if (isGuiThread) QApplication::setOverrideCursor(Qt::WaitCursor); eventLoop.exec(QEventLoop::ExcludeUserInputEvents); QByteArray output = versionNumberProcess.readAllStandardOutput(); QString versionMessage = QString::fromLatin1(output); QRegExp versionNumberRegExp = QRegExp(QLatin1String("(\\d+)\\.(\\d+)\\.(\\d+)")); if (versionNumberRegExp.indexIn(versionMessage) > -1 && versionNumberRegExp.captureCount() == 3) { int major = versionNumberRegExp.cap(1).toInt(); int minor = versionNumberRegExp.cap(2).toInt(); int patch = versionNumberRegExp.cap(3).toInt(); m_versionNumber = (major << 16)|(minor<<8)|(patch); } if (isGuiThread) QApplication::restoreOverrideCursor(); } void QnxDeviceConfiguration::fromMap(const QVariantMap &map) { m_versionNumber = map.value(QLatin1String(QnxVersionKey), 0).toInt(); RemoteLinux::LinuxDevice::fromMap(map); } QVariantMap QnxDeviceConfiguration::toMap() const { QVariantMap map(RemoteLinux::LinuxDevice::toMap()); map.insert(QLatin1String(QnxVersionKey), m_versionNumber); return map; } ProjectExplorer::IDevice::Ptr QnxDeviceConfiguration::clone() const { return Ptr(new QnxDeviceConfiguration(*this)); } ProjectExplorer::PortsGatheringMethod::Ptr QnxDeviceConfiguration::portsGatheringMethod() const { return ProjectExplorer::PortsGatheringMethod::Ptr(new QnxPortsGatheringMethod); } ProjectExplorer::DeviceProcessList *QnxDeviceConfiguration::createProcessListModel(QObject *parent) const { return new QnxDeviceProcessList(sharedFromThis(), parent); } ProjectExplorer::DeviceTester *QnxDeviceConfiguration::createDeviceTester() const { return new QnxDeviceTester; } ProjectExplorer::DeviceProcessSignalOperation::Ptr QnxDeviceConfiguration::signalOperation() const { return ProjectExplorer::DeviceProcessSignalOperation::Ptr( new QnxDeviceProcessSignalOperation(sshParameters())); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatecertificatedialog.ui0000644000015301777760000000606012321547255032747 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryCreateCertificateDialog 0 0 495 191 Create Certificate Author: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password Confirm password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password Show password 75 true Status Qt::AlignCenter 0 -1 QDialogButtonBox::Cancel|QDialogButtonBox::Ok qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptordocumentnodehandlers.cpp0000644000015301777760000005637012321547255033227 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptordocumentnodehandlers.h" #include "bardescriptoreditorwidget.h" #include "bardescriptoreditorassetswidget.h" #include "bardescriptoreditorauthorinformationwidget.h" #include "bardescriptoreditorentrypointwidget.h" #include "bardescriptoreditorenvironmentwidget.h" #include "bardescriptoreditorgeneralwidget.h" #include "bardescriptoreditorpackageinformationwidget.h" #include "bardescriptoreditorpermissionswidget.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorDocumentAbstractNodeHandler::BarDescriptorDocumentAbstractNodeHandler(BarDescriptorEditorWidget *editorWidget) : m_editorWidget(editorWidget) , m_order(0xFFFF) { } BarDescriptorDocumentAbstractNodeHandler::~BarDescriptorDocumentAbstractNodeHandler() { } bool BarDescriptorDocumentAbstractNodeHandler::handle(const QDomNode &node) { if (m_order == 0xFFFF) m_order = node.lineNumber(); return fromNode(node); } void BarDescriptorDocumentAbstractNodeHandler::clear() { m_order = 0xFFFF; } int BarDescriptorDocumentAbstractNodeHandler::order() const { return m_order; } BarDescriptorEditorPackageInformationWidget *BarDescriptorDocumentAbstractNodeHandler::packageInformationWidget() const { return m_editorWidget->packageInformationWidget(); } BarDescriptorEditorAuthorInformationWidget *BarDescriptorDocumentAbstractNodeHandler::authorInformationWidget() const { return m_editorWidget->authorInformationWidget(); } BarDescriptorEditorEntryPointWidget *BarDescriptorDocumentAbstractNodeHandler::entryPointWidget() const { return m_editorWidget->entryPointWidget(); } BarDescriptorEditorGeneralWidget *BarDescriptorDocumentAbstractNodeHandler::generalWidget() const { return m_editorWidget->generalWidget(); } BarDescriptorEditorPermissionsWidget *BarDescriptorDocumentAbstractNodeHandler::permissionsWidget() const { return m_editorWidget->permissionsWidget(); } BarDescriptorEditorEnvironmentWidget *BarDescriptorDocumentAbstractNodeHandler::environmentWidget() const { return m_editorWidget->environmentWidget(); } BarDescriptorEditorAssetsWidget *BarDescriptorDocumentAbstractNodeHandler::assetsWidget() const { return m_editorWidget->assetsWidget(); } bool BarDescriptorDocumentAbstractNodeHandler::canHandleSimpleTextElement(const QDomNode &node, const QString &tagName) const { QDomElement element = node.toElement(); if (element.isNull()) return false; if (element.tagName().toLower() != tagName.toLower()) return false; QDomText textNode = element.firstChild().toText(); if (textNode.isNull()) return false; return true; } QString BarDescriptorDocumentAbstractNodeHandler::loadSimpleTextElement(const QDomNode &node) { QDomElement element = node.toElement(); QDomText textNode = element.firstChild().toText(); return textNode.data(); } QDomElement BarDescriptorDocumentAbstractNodeHandler::createSimpleTextElement(QDomDocument &doc, const QString &tagName, const QString &textValue) const { if (textValue.isEmpty()) return QDomElement(); QDomElement elem = doc.createElement(tagName); elem.appendChild(doc.createTextNode(textValue)); return elem; } // ---------------------------------------------------------------------------- BarDescriptorDocumentIdNodeHandler::BarDescriptorDocumentIdNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentIdNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("id")); } bool BarDescriptorDocumentIdNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; packageInformationWidget()->setPackageId(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentIdNodeHandler::toNode(QDomDocument &doc) const { return createSimpleTextElement(doc, QLatin1String("id"), packageInformationWidget()->packageId()); } // ---------------------------------------------------------------------------- BarDescriptorDocumentVersionNumberNodeHandler::BarDescriptorDocumentVersionNumberNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentVersionNumberNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("versionNumber")); } bool BarDescriptorDocumentVersionNumberNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; packageInformationWidget()->setPackageVersion(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentVersionNumberNodeHandler::toNode(QDomDocument &doc) const { return createSimpleTextElement(doc, QLatin1String("versionNumber"), packageInformationWidget()->packageVersion()); } // ---------------------------------------------------------------------------- BarDescriptorDocumentBuildIdNodeHandler::BarDescriptorDocumentBuildIdNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentBuildIdNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("buildId")); } bool BarDescriptorDocumentBuildIdNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; packageInformationWidget()->setPackageBuildId(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentBuildIdNodeHandler::toNode(QDomDocument &doc) const { return createSimpleTextElement(doc, QLatin1String("buildId"), packageInformationWidget()->packageBuildId()); } // ---------------------------------------------------------------------------- BarDescriptorDocumentApplicationNameNodeHandler::BarDescriptorDocumentApplicationNameNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentApplicationNameNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("name")); } bool BarDescriptorDocumentApplicationNameNodeHandler::fromNode(const QDomNode &node) { // TODO: Add support for localization if (!canHandle(node)) return false; entryPointWidget()->setApplicationName(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentApplicationNameNodeHandler::toNode(QDomDocument &doc) const { // TODO: Add support for localization return createSimpleTextElement(doc, QLatin1String("name"), entryPointWidget()->applicationName()); } // ---------------------------------------------------------------------------- BarDescriptorDocumentApplicationDescriptionNodeHandler::BarDescriptorDocumentApplicationDescriptionNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentApplicationDescriptionNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("description")); } bool BarDescriptorDocumentApplicationDescriptionNodeHandler::fromNode(const QDomNode &node) { // TODO: Add support for localization if (!canHandle(node)) return false; entryPointWidget()->setApplicationDescription(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentApplicationDescriptionNodeHandler::toNode(QDomDocument &doc) const { return createSimpleTextElement(doc, QLatin1String("description"), entryPointWidget()->applicationDescription()); } // ---------------------------------------------------------------------------- BarDescriptorDocumentApplicationIconNodeHandler::BarDescriptorDocumentApplicationIconNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentApplicationIconNodeHandler::canHandle(const QDomNode &node) const { QDomElement element = node.toElement(); if (element.isNull()) return false; if (element.tagName() != QLatin1String("icon")) return false; QDomElement imageElement = element.firstChild().toElement(); if (imageElement.isNull()) return false; if (imageElement.tagName() != QLatin1String("image")) return false; QDomText imageTextNode = imageElement.firstChild().toText(); if (imageTextNode.isNull()) return false; return true; } bool BarDescriptorDocumentApplicationIconNodeHandler::fromNode(const QDomNode &node) { // TODO: Add support for localization if (!canHandle(node)) return false; QDomNode imageNode = node.firstChild(); QDomText imageTextNode = imageNode.firstChild().toText(); entryPointWidget()->setApplicationIcon(imageTextNode.data()); return true; } QDomNode BarDescriptorDocumentApplicationIconNodeHandler::toNode(QDomDocument &doc) const { // TODO: Add support for localization const QString iconFileName = entryPointWidget()->applicationIconFileName(); if (iconFileName.isEmpty()) return QDomElement(); QDomElement iconElement = doc.createElement(QLatin1String("icon")); iconElement.appendChild(createSimpleTextElement(doc, QLatin1String("image"), iconFileName)); return iconElement; } // ---------------------------------------------------------------------------- BarDescriptorDocumentSplashScreenNodeHandler::BarDescriptorDocumentSplashScreenNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentSplashScreenNodeHandler::canHandle(const QDomNode &node) const { QDomElement element = node.toElement(); if (element.isNull()) return false; if (element.tagName().toLower() != QLatin1String("splashscreens")) return false; QDomElement imageElement = element.firstChild().toElement(); if (imageElement.isNull()) return false; if (imageElement.tagName().toLower() != QLatin1String("image")) return false; QDomText imageTextNode = imageElement.firstChild().toText(); if (imageTextNode.isNull()) return false; return true; } bool BarDescriptorDocumentSplashScreenNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; QDomElement imageNode = node.firstChildElement(); while (!imageNode.isNull()) { if (imageNode.tagName().toLower() == QLatin1String("image")) { QDomText imageTextNode = imageNode.firstChild().toText(); entryPointWidget()->appendSplashScreen(imageTextNode.data()); } imageNode = imageNode.nextSiblingElement(); } return true; } QDomNode BarDescriptorDocumentSplashScreenNodeHandler::toNode(QDomDocument &doc) const { QStringList splashScreens = entryPointWidget()->splashScreens(); if (splashScreens.isEmpty()) return QDomElement(); QDomElement splashScreenElement = doc.createElement(QLatin1String("splashScreens")); foreach (const QString &splashScreen, splashScreens) splashScreenElement.appendChild(createSimpleTextElement(doc, QLatin1String("image"), splashScreen)); return splashScreenElement; } // ---------------------------------------------------------------------------- BarDescriptorDocumentAssetNodeHandler::BarDescriptorDocumentAssetNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentAssetNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("asset")); } bool BarDescriptorDocumentAssetNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; QDomElement element = node.toElement(); QString path = element.attribute(QLatin1String("path")); QString entry = element.attribute(QLatin1String("entry")); QDomText destNode = element.firstChild().toText(); QString dest = destNode.data(); BarDescriptorAsset asset; asset.source = path; asset.destination = dest; asset.entry = entry == QLatin1String("true"); assetsWidget()->addAsset(asset); return true; } QDomNode BarDescriptorDocumentAssetNodeHandler::toNode(QDomDocument &doc) const { QDomDocumentFragment fragment = doc.createDocumentFragment(); QList assets = assetsWidget()->assets(); foreach (const BarDescriptorAsset &asset, assets) { QDomElement assetElem = doc.createElement(QLatin1String("asset")); assetElem.setAttribute(QLatin1String("path"), asset.source); if (asset.entry) { assetElem.setAttribute(QLatin1String("type"), QLatin1String("Qnx/Elf")); assetElem.setAttribute(QLatin1String("entry"), QLatin1String("true")); } assetElem.appendChild(doc.createTextNode(asset.destination)); fragment.appendChild(assetElem); } return fragment; } // ---------------------------------------------------------------------------- BarDescriptorDocumentInitialWindowNodeHandler::BarDescriptorDocumentInitialWindowNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentInitialWindowNodeHandler::canHandle(const QDomNode &node) const { QDomElement element = node.toElement(); if (element.isNull()) return false; if (element.tagName() != QLatin1String("initialWindow")) return false; return true; } bool BarDescriptorDocumentInitialWindowNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; QDomElement child = node.firstChildElement(); while (!child.isNull()) { if (child.tagName() == QLatin1String("aspectRatio")) { generalWidget()->setOrientation(loadSimpleTextElement(child)); } else if (child.tagName() == QLatin1String("autoOrients")) { if (loadSimpleTextElement(child) == QLatin1String("true")) generalWidget()->setOrientation(QLatin1String("auto-orient")); } else if (child.tagName() == QLatin1String("systemChrome")) { generalWidget()->setChrome(loadSimpleTextElement(child)); } else if (child.tagName() == QLatin1String("transparent")) { const QString transparent = loadSimpleTextElement(child); generalWidget()->setTransparent(transparent == QLatin1String("true")); } child = child.nextSiblingElement(); } return true; } QDomNode BarDescriptorDocumentInitialWindowNodeHandler::toNode(QDomDocument &doc) const { QDomElement element = doc.createElement(QLatin1String("initialWindow")); if (generalWidget()->orientation() == QLatin1String("auto-orient")) { element.appendChild(createSimpleTextElement(doc, QLatin1String("autoOrients"), QLatin1String("true"))); } else if (!generalWidget()->orientation().isEmpty()) { element.appendChild(createSimpleTextElement(doc, QLatin1String("aspectRatio"), generalWidget()->orientation())); element.appendChild(createSimpleTextElement(doc, QLatin1String("autoOrients"), QLatin1String("false"))); } element.appendChild(createSimpleTextElement(doc, QLatin1String("systemChrome"), generalWidget()->chrome())); element.appendChild(createSimpleTextElement(doc, QLatin1String("transparent"), generalWidget()->transparent() ? QLatin1String("true") : QLatin1String("false"))); return element; } // ---------------------------------------------------------------------------- BarDescriptorDocumentActionNodeHandler::BarDescriptorDocumentActionNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentActionNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("action")); } bool BarDescriptorDocumentActionNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; QString value = loadSimpleTextElement(node); if (value != QLatin1String("run_native")) // This has no representation in the GUI, and is always added permissionsWidget()->checkPermission(value); return true; } QDomNode BarDescriptorDocumentActionNodeHandler::toNode(QDomDocument &doc) const { QDomDocumentFragment frag = doc.createDocumentFragment(); QDomElement runNativeElement = doc.createElement(QLatin1String("action")); runNativeElement.setAttribute(QLatin1String("system"), QLatin1String("true")); runNativeElement.appendChild(doc.createTextNode(QLatin1String("run_native"))); frag.appendChild(runNativeElement); QStringList checkedIdentifiers = permissionsWidget()->checkedPermissions(); foreach (const QString &identifier, checkedIdentifiers) frag.appendChild(createSimpleTextElement(doc, QLatin1String("action"), identifier)); return frag; } // ---------------------------------------------------------------------------- BarDescriptorDocumentArgNodeHandler::BarDescriptorDocumentArgNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentArgNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("arg")); } bool BarDescriptorDocumentArgNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; generalWidget()->appendApplicationArgument(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentArgNodeHandler::toNode(QDomDocument &doc) const { QDomDocumentFragment frag = doc.createDocumentFragment(); QStringList arguments = generalWidget()->applicationArguments(); foreach (const QString &argument, arguments) frag.appendChild(createSimpleTextElement(doc, QLatin1String("arg"), argument)); return frag; } // ---------------------------------------------------------------------------- BarDescriptorDocumentEnvNodeHandler::BarDescriptorDocumentEnvNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentEnvNodeHandler::canHandle(const QDomNode &node) const { QDomElement element = node.toElement(); if (element.isNull()) return false; if (element.tagName() != QLatin1String("env")) return false; if (!element.hasAttribute(QLatin1String("var")) || !element.hasAttribute(QLatin1String("value"))) return false; return true; } bool BarDescriptorDocumentEnvNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; QDomElement element = node.toElement(); QString var = element.attribute(QLatin1String("var")); QString value = element.attribute(QLatin1String("value")); Utils::EnvironmentItem item(var, value); environmentWidget()->appendEnvironmentItem(item); return true; } QDomNode BarDescriptorDocumentEnvNodeHandler::toNode(QDomDocument &doc) const { QDomDocumentFragment frag = doc.createDocumentFragment(); QList environmentItems = environmentWidget()->environment(); foreach (const Utils::EnvironmentItem &item, environmentItems) { QDomElement element = doc.createElement(QLatin1String("env")); element.setAttribute(QLatin1String("var"), item.name); element.setAttribute(QLatin1String("value"), item.value); frag.appendChild(element); } return frag; } // ---------------------------------------------------------------------------- BarDescriptorDocumentAuthorNodeHandler::BarDescriptorDocumentAuthorNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentAuthorNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("author")) || canHandleSimpleTextElement(node, QLatin1String("publisher")); } bool BarDescriptorDocumentAuthorNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; authorInformationWidget()->setAuthor(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentAuthorNodeHandler::toNode(QDomDocument &doc) const { return createSimpleTextElement(doc, QLatin1String("author"), authorInformationWidget()->author()); } // ---------------------------------------------------------------------------- BarDescriptorDocumentAuthorIdNodeHandler::BarDescriptorDocumentAuthorIdNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentAuthorIdNodeHandler::canHandle(const QDomNode &node) const { return canHandleSimpleTextElement(node, QLatin1String("authorId")); } bool BarDescriptorDocumentAuthorIdNodeHandler::fromNode(const QDomNode &node) { if (!canHandle(node)) return false; authorInformationWidget()->setAuthorId(loadSimpleTextElement(node)); return true; } QDomNode BarDescriptorDocumentAuthorIdNodeHandler::toNode(QDomDocument &doc) const { return createSimpleTextElement(doc, QLatin1String("authorId"), authorInformationWidget()->authorId()); } // ---------------------------------------------------------------------------- BarDescriptorDocumentUnknownNodeHandler::BarDescriptorDocumentUnknownNodeHandler(BarDescriptorEditorWidget *editorWidget) : BarDescriptorDocumentAbstractNodeHandler(editorWidget) { } bool BarDescriptorDocumentUnknownNodeHandler::canHandle(const QDomNode &node) const { Q_UNUSED(node); return true; } bool BarDescriptorDocumentUnknownNodeHandler::fromNode(const QDomNode &node) { m_node = node.cloneNode(); return true; } QDomNode BarDescriptorDocumentUnknownNodeHandler::toNode(QDomDocument &doc) const { Q_UNUSED(doc); return m_node; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptordocument.h0000644000015301777760000000606312321547255030277 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTORDOCUMENT_H #define QNX_INTERNAL_BARDESCRIPTORDOCUMENT_H #include #include namespace Qnx { namespace Internal { class BarDescriptorAsset { public: QString source; QString destination; bool entry; }; class BarDescriptorEditorWidget; class BarDescriptorDocumentAbstractNodeHandler; class BarDescriptorDocument : public Core::TextDocument { Q_OBJECT public: explicit BarDescriptorDocument(BarDescriptorEditorWidget *editorWidget); ~BarDescriptorDocument(); bool open(QString *errorString, const QString &fileName); bool save(QString *errorString, const QString &fileName = QString(), bool autoSave = false); QString defaultPath() const; QString suggestedFileName() const; QString mimeType() const; bool shouldAutoSave() const; bool isModified() const; bool isSaveAsAllowed() const; ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const; bool reload(QString *errorString, ReloadFlag flag, ChangeType type); QString xmlSource() const; bool loadContent(const QString &xmlSource, QString *errorMessage = 0, int *errorLine = 0); private: void registerNodeHandler(BarDescriptorDocumentAbstractNodeHandler *nodeHandler); BarDescriptorDocumentAbstractNodeHandler *nodeHandlerForDomNode(const QDomNode &node); void removeUnknownNodeHandlers(); QList m_nodeHandlers; BarDescriptorEditorWidget *m_editorWidget; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTORDOCUMENT_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizardpages.h0000644000015301777760000001100712321547255031331 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYSETUPWIZARDPAGES_H #define QNX_INTERNAL_BLACKBERRYSETUPWIZARDPAGES_H #include namespace Utils { class PathChooser; } namespace Qnx { namespace Internal { namespace Ui { class BlackBerrySetupWizardKeysPage; class BlackBerrySetupWizardDevicePage; class BlackBerrySetupWizardCertificatePage; class BlackBerrySetupWizardFinishPage; } // namespace Ui class BlackBerryCertificate; class BlackBerryNDKSettingsWidget; class BlackBerrySetupWizardWelcomePage : public QWizardPage { Q_OBJECT public: explicit BlackBerrySetupWizardWelcomePage(QWidget *parent = 0); }; //----------------------------------------------------------------------------- class BlackBerrySetupWizardNdkPage : public QWizardPage { Q_OBJECT public: explicit BlackBerrySetupWizardNdkPage(QWidget *parent = 0); virtual ~BlackBerrySetupWizardNdkPage(); bool isComplete() const; signals: void targetsUpdated(); private: BlackBerryNDKSettingsWidget *m_widget; }; //----------------------------------------------------------------------------- class BlackBerrySetupWizardKeysPage : public QWizardPage { Q_OBJECT public: explicit BlackBerrySetupWizardKeysPage(QWidget *parent = 0); virtual ~BlackBerrySetupWizardKeysPage(); bool isComplete() const; private slots: void showKeysMessage(const QString &url); private: void initUi(); void setComplete(bool complete); Ui::BlackBerrySetupWizardKeysPage *m_ui; bool m_complete; }; //----------------------------------------------------------------------------- class BlackBerrySetupWizardCertificatePage : public QWizardPage { Q_OBJECT public: static const char AuthorField[]; static const char PasswordField[]; static const char PasswordField2[]; explicit BlackBerrySetupWizardCertificatePage(QWidget *parent = 0); bool isComplete() const; private slots: void validate(); void checkBoxChanged(int state); private: void setComplete(bool complete); void initUi(); Ui::BlackBerrySetupWizardCertificatePage *m_ui; bool m_complete; }; //----------------------------------------------------------------------------- class BlackBerrySetupWizardDevicePage : public QWizardPage { Q_OBJECT public: static const char NameField[]; static const char IpAddressField[]; static const char PasswordField[]; static const char PhysicalDeviceField[]; explicit BlackBerrySetupWizardDevicePage(QWidget *parent = 0); bool isComplete() const; private: Ui::BlackBerrySetupWizardDevicePage *m_ui; }; //----------------------------------------------------------------------------- class BlackBerrySetupWizardFinishPage : public QWizardPage { Q_OBJECT public: explicit BlackBerrySetupWizardFinishPage(QWidget *parent = 0); void setProgress(const QString &status, int progress); private: Ui::BlackBerrySetupWizardFinishPage *m_ui; }; //----------------------------------------------------------------------------- } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYSETUPWIZARDPAGES_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptorpermissionsmodel.h0000644000015301777760000000603512321547255032054 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTORPERMISSIONSMODEL_H #define QNX_INTERNAL_BARDESCRIPTORPERMISSIONSMODEL_H #include namespace Qnx { namespace Internal { class BarDescriptorPermission { public: BarDescriptorPermission(const QString &perm, const QString &ident, const QString &desc) : checked(false) , permission(perm) , identifier(ident) , description(desc) { } bool checked; QString permission; QString identifier; QString description; }; class BarDescriptorPermissionsModel : public QAbstractTableModel { Q_OBJECT public: explicit BarDescriptorPermissionsModel(QObject *parent = 0); Qt::ItemFlags flags(const QModelIndex &index) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; void checkPermission(const QString &identifier); QStringList checkedIdentifiers() const; public slots: void uncheckAll(); void checkAll(); private: enum DataRole { IdentifierRole = Qt::UserRole }; void setCheckStateAll(Qt::CheckState checkState); void initModel(); QList m_permissions; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTORPERMISSIONSMODEL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwidget.h0000644000015301777760000000603512321547255033170 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIDGET_H #define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIDGET_H #include #include "blackberrydeviceconfiguration.h" QT_BEGIN_NAMESPACE class QProgressDialog; class QAbstractButton; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BlackBerryDebugTokenUploader; namespace Ui { class BlackBerryDeviceConfigurationWidget; } class BlackBerryDeviceConfigurationWidget : public ProjectExplorer::IDeviceWidget { Q_OBJECT public: explicit BlackBerryDeviceConfigurationWidget(const ProjectExplorer::IDevice::Ptr &device, QWidget *parent = 0); ~BlackBerryDeviceConfigurationWidget(); private slots: void hostNameEditingFinished(); void passwordEditingFinished(); void keyFileEditingFinished(); void showPassword(bool showClearText); void debugTokenEditingFinished(); void requestDebugToken(); void uploadDebugToken(); void updateUploadButton(); void uploadFinished(int status); void appendConnectionLog(Core::Id deviceId, const QString &line); void clearConnectionLog(Core::Id deviceId); private: void updateDeviceFromUi(); void initGui(); BlackBerryDeviceConfiguration::Ptr deviceConfiguration() const; Ui::BlackBerryDeviceConfigurationWidget *ui; QAbstractButton *uploadButton; QProgressDialog *progressDialog; BlackBerryDebugTokenUploader *uploader; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/images/0000755000015301777760000000000012321547742024765 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/images/target.png0000644000015301777760000002506112321547255026764 0ustar pbusernogroup00000000000000PNG  IHDRus]MsRGB pHYs  tIME4Fe IDATx}yp\yߛ{p kp$ uPmrlY'7*yZRdly+5*)0DK,G. Aq9 @HW5̛~_wݡO6|짰v (.Rr0{7;LA0X/ܻ.@il?'RYU'e"()Ue#$@|^^~!"QY F:322m!ۖl[ COd4s 7?녞1{nԔns[nNM$LUX*Ft8016$BE1ZNEZ&g`8z壤eWϥ8w#$5a1Q/#~^01[%o?4ۂ¢p4#Dˌr s$U jņT߀M X,`%0VN#0ҩ oy^~rQo7m~?T(JRw'#Cqmv}s1ܵ -܏\<&CC_z09> oA~</bh  Ht<^~yt ^{]Z[$bb| N~ٙib*r\[fADdee޷oYֹ=.cHgvA=O2^QB8B\}g8H8n8j\;;3ΎEEe%,fs$7oڷ^ߕaY$AZ=/Ըm֌*QS\x1L; { xfgy$*)cD+o޽&g\LBk?} I4n"J$wW^neCxťˋ/#K2Lfsw{z&FgicT8Ob @h4yTQq`X,ʲ{N!DWXHYTP$I¿>3LO9p"D8J "''e vd!'7'aCscy|kC9+kF݌S^1[zp;P,C0{q`hsblt|'A+JG_/,dD 8~i_{&"_  I$I$B~S\̦5ԧzʶiȔfPD(z=xṟB;(jH|&5#|7ܩ%㊧lԝ40*!IUp_D)U46@e_bh"΋PΝ=g]`LyC%EuWU>o4V%ug;Oclt[p]D~2A?(AAA /"+ `㪈߿"L|>/$ww!EQxѰu;$Ȕp9911?/ rÜz{r[dE17B]g0>: (E$%<1t-ܪ[˃XT KOrN]RFmmUFx<(לKۯz},܊OǡJy(=ھ|sy'JR~B76kM/z 8;oߐ_*/5YJ)!0L?yL&:uj{۷<@-uzY3ͨƁqΜ9sM"2|>ߚg%R});nzR9!N u8lڴ TmrY!_C-;inݚG h*>(MzD[r:&0߫lRbQ`V["}]Ԡw,nԼ<'q ,i 2Z[[w1l߾Ā^o{QJ|eYS]B>|]Oqe!<߲"P_xEd,aɏ703VSX DwUUUy>mfI\&Y>k'ZגCMDظz2m9K-iA|s+)CL 7IJ)mۖār$IIܣwQUUјhO|$NZM 0I|nT_{A9u-{ o~ʍ1u}$Iim۶8.ykUEdYN2q(|7r\zt:jiEyE҈0j,ԧ~Zkw$9s"s%/^Ey)Ԯ{Β`˖-IVܪWY#&)X{+g@oN lٹMY6[Rp8ё^#***He9!RST0ꫯ.9DVjA{m__x㍤ I- Le@x@СC^e(`AF g4466& T+6 !x'!’D6{S+O@~$%Z4դKy}N獥L;'Qj/Z'Jg2lfC;sRR$PO>mO_%i1 5FGG3U$Q099˗/t^ӄ$ GM{KN'.]ӹ`0(455ᡇJj_i15:aI s-4:<{94$ac݆S^y&FyRZP+*+fK"y]U#GYS7<"18p555xǖWZ\}kG)ɶ[O?gFf)J⪪kE<*GGa?cAr)El۶mun Ϗ|ɲ^㣐%I52\&kjGG_PX=0=5ȼIeB%|^^JJJ"Y|Vjq㵂ٙ^,heFEZA)Ml?83ӷCJ)ؘZDž9VAW5qJ)zu+1"pTdY1Aߦ]Suťe&jQD{N5wֲkT$HrԶ VAKUVwC4RD)EN-{~fƔ4TB)+33SYe($Q@0X}.˜???,bزصkvڕW{o~Gŏe_^ٔWw:N}G4,bX 2eZ,9/Ifs*Oi}󪬬Llt)ij?p,VۼysO^V*2AqhmmSO=_V(&E~Ϡ}&}cpX,vCy(L`\bԆTtzQjQ%>@nOZP\Eڵ KqJ;-߻w/ZZZUT^^*-ŋx1::zKX4,~myfn'iy#_",))j]> ѵTGIg?~ꄚԜUrv{/;;{ Iܒ:1l߬B3g]ڎ}5EIyTu$+AIUYХ&]/MzKXUxmMEYZ(WTT`0,Ufz*$>"5v;t:ݢDpm&Vk'(W_k SİX4&+)- bQ=%qčpj?j8횧"`ttO?4$V*G~ޏy ?Ԗ FHrY[}~_EhD< z^bnXnAŹ)2r!ҥK8y$566& ՅIA$ID"p\|2;%>߂Kb1>>X,&\oͰFssAHBSB---P(j23Vz~YմGxg)%"$񝮿j_k=jjjҚ[:D"+U1,TքB ¡&DyZbέ4ҿηki_Vv=)6k]լ[ZZg:t~Cv 4~S; B=C/199!IDI,K̸O~@WJ6lHJQ+5!%÷- ,#''O= c~X+~_Q5)xc)En^"?zx-7&>T*c<ݻb$uU*GBaq%ufc Eí)jnwƍ YFKӍj d6b̀,I;vGeA\iA5Da0 ӂηy<{ւ8CMMM|is Rm:6]PT\೎o Q7cė֣"ss3Ҳ,Ueζ f7M̾FFFFZ3I۷h4iLMM%wRO{#\xqT\k7,JO, 2iAmmm\}ťexg4{FӅXm *& jD"߲lllLYTGLծN':;;ܸ^YS ™iH9G.1 q 791v^EeU\M:9_*ꑊxŰZi7R*2 ߏ~_V񪫫[2pڵD0:̮"^fdeecӄWJݥyJA|8{ߚIAS˾]8n$ ZolE- BGυ <`Sݹ{{oɚ$"~/r˺Fzp:K&GE~aay={B8cx}󖭛 ne`Z3u]8y?Kl y4WpBq ]!)²kǒ~;::`CDAY^U]GbhZ=ڱ յD1ܮyvGT_lǢ貃7:2|99!j9^7mET(S]b,v {Uϲ{zz`B ml AoJ|8|G*ʪ 2ƎG"cmpe@owc ܏̬; mqJJ\(~峧=Tpv_vsi:::s8[ʪ IDAT.*)ffp: 0߻3+`O%ݔQtwp; ɫjn%Q{Ee)1XV&LNAhdZG1p3'G)/Ʒ|>5kYt8`O9Ԭ qAj˧>0rrd.¡>]o$ dY]Qz`v=eޚi y e^NUT-(8ѱqGAiM@/ʲ,]y%%U9p AEU5V{Zv>c|[~;^XXgg[s33yy&h+Tl뽃^ t:ܷ5+p|[xyFfp8|]V jgg'Z[[#===h$.((,*7D=yTV@A2NF >y튳92z..vB26I;_ϏzzzXssspch+/((.2MqUnsZ3(/yeWz 纆) ~CCC즂Wn~$zEEF K '֎g24N00Kvɒ&#vܹs7o~_~B1=(lm`Nn21916+;?0,$)(@ouf\xn_p@U Cْl[Nd",, Řr^UTU?Œ8 D9ez\׈$IoxU DBs339E6q9e֌LToC(wjzM{wpR> buVtq@| u:܂-U5E%0IOé B]y=xD׼^,:Vksrm˅-[nt:}"vB%'~r.(qyn;fK[R okkjH*C`?HbZ h @Ȓ `07a67Dyԥ>1P{Yu191&M;'=Ph@?>0xСp|/>ܬȁr`[!,V¢R)'7FYH|-4/={H\%V@s3l1z<3.n[[[mmmtκZ7&6t5"/ 7И WײŬ,T{-K}[$QD0b3ΨE#^]hmm j0)b @:*x/3L͖c-V+L&38=8 Fr4 4c$!"#1-H800 Kv|KKKm]벾I[[pdA9W(y@L,dX̛-ޠӃ8p<)HJ#!cPPŢ4 bHTŰ$Ƙ <k\kkkmnC_Ev}GG@8' 8 c0t8*eRY11000s2innos[Cnbba`4+R?B :D`zri+V{IENDB`qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/images/target-small.png0000644000015301777760000000121712321547255030067 0ustar pbusernogroup00000000000000PNG  IHDRasRGBbKGD pHYs B(xtIME$9P`IDAT8œ;nSa3 ?2ұ*DX- HDEڸ8Nk?6B@IiN3gihtTq) "$J3{^7{Y?l(*ʊ._^ !@fnby{5zM.( 4?bdH[Y?dYBHP9Oh:݄^ҹKb61 Du@ !'O 4MCENNOX.W\-6E)$̄' O[(|ppIl4d" l=pwꦢV,חDw2̐Dږ Xd;1WoMs wp $HҘe1Qa!Mκ)ʊi̩i AN `VpUQ %؍pC't]L߳v/kIniIf{qBUU5BǸq ? IENDB`qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceprocesslist.h0000644000015301777760000000430412321547255030152 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEVICEPROCESSLIST_H #define QNX_INTERNAL_QNXDEVICEPROCESSLIST_H #include #include namespace Qnx { namespace Internal { class QnxDeviceProcessList : public ProjectExplorer::SshDeviceProcessList { Q_OBJECT public: explicit QnxDeviceProcessList( const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent = 0); private: virtual QString listProcessesCommandLine() const; virtual QList buildProcessList( const QString &listProcessesReply) const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEVICEPROCESSLIST_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxrunconfigurationfactory.cpp0000644000015301777760000001162312321547255031741 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxrunconfigurationfactory.h" #include "qnxconstants.h" #include "qnxrunconfiguration.h" #include "qnxdeviceconfigurationfactory.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; static QString pathFromId(const Core::Id id) { return id.suffixAfter(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX); } QnxRunConfigurationFactory::QnxRunConfigurationFactory(QObject *parent) : ProjectExplorer::IRunConfigurationFactory(parent) { } QList QnxRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const { QList ids; if (!canHandle(parent)) return ids; QmakeProjectManager::QmakeProject *qt4Project = qobject_cast(parent->project()); if (!qt4Project) return ids; QStringList proFiles = qt4Project->applicationProFilePathes(QLatin1String(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)); foreach (const QString &pf, proFiles) ids << Core::Id::fromString(pf); return ids; } QString QnxRunConfigurationFactory::displayNameForId(const Core::Id id) const { const QString path = pathFromId(id); if (path.isEmpty()) return QString(); if (id.name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)) return tr("%1 on QNX Device").arg(QFileInfo(path).completeBaseName()); return QString(); } bool QnxRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const { if (!canHandle(parent) || !id.name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)) return false; QmakeProjectManager::QmakeProject *qt4Project = qobject_cast(parent->project()); if (!qt4Project) return false; return qt4Project->hasApplicationProFile(pathFromId(id)); } ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::doCreate(ProjectExplorer::Target *parent, const Core::Id id) { return new QnxRunConfiguration(parent, id, pathFromId(id)); } bool QnxRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const { return canHandle(parent) && ProjectExplorer::idFromMap(map).name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX); } ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::doRestore(ProjectExplorer::Target *parent, const QVariantMap &map) { Q_UNUSED(map); return new QnxRunConfiguration(parent, Core::Id(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX), QString()); } bool QnxRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const { return canCreate(parent, source->id()); } ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) { if (!canClone(parent, source)) return 0; QnxRunConfiguration *old = static_cast(source); return new QnxRunConfiguration(parent, old); } bool QnxRunConfigurationFactory::canHandle(ProjectExplorer::Target *t) const { Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(t->kit()); if (deviceType != QnxDeviceConfigurationFactory::deviceType()) return false; return true; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxruncontrol.h0000644000015301777760000000404112321547255026623 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXRUNCONTROL_H #define QNX_INTERNAL_QNXRUNCONTROL_H #include namespace Qnx { namespace Internal { class Slog2InfoRunner; class QnxRunControl : public RemoteLinux::RemoteLinuxRunControl { Q_OBJECT public: explicit QnxRunControl(ProjectExplorer::RunConfiguration *runConfig); RemoteLinux::RemoteLinuxRunControl::StopResult stop(); private slots: void printMissingWarning(); private: Slog2InfoRunner *m_slog2Info; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXRUNCONTROL_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorassetswidget.ui0000644000015301777760000000264512321547255032566 0ustar pbusernogroup00000000000000 Qnx::Internal::BarDescriptorEditorAssetsWidget 0 0 380 245 Form false Add... Remove Qt::Vertical 20 40 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatecertificatedialog.h0000644000015301777760000000475712321547255032574 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCREATECERTIFICATEDIALOG_H #define QNX_INTERNAL_BLACKBERRYCREATECERTIFICATEDIALOG_H #include QT_BEGIN_NAMESPACE class QPushButton; QT_END_NAMESPACE namespace Qnx { namespace Internal { class Ui_BlackBerryCreateCertificateDialog; class BlackBerryCertificate; class BlackBerryCreateCertificateDialog : public QDialog { Q_OBJECT public: explicit BlackBerryCreateCertificateDialog(QWidget *parent = 0, Qt::WindowFlags f = 0); QString author() const; QString certPath() const; QString keystorePassword() const; BlackBerryCertificate *certificate() const; private slots: void validate(); void createCertificate(); void checkBoxChanged(int state); void certificateCreated(int status); private: void setBusy(bool busy); Ui_BlackBerryCreateCertificateDialog *m_ui; BlackBerryCertificate *m_certificate; QPushButton *m_cancelButton; QPushButton *m_okButton; }; } } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCREATECERTIFICATEDIALOG_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrylogprocessrunner.cpp0000644000015301777760000000736712321547255031713 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrylogprocessrunner.h" #include "slog2inforunner.h" #include #include using namespace Qnx::Internal; BlackBerryLogProcessRunner::BlackBerryLogProcessRunner(QObject *parent, const QString& appId, const BlackBerryDeviceConfiguration::ConstPtr &device) : QObject(parent) { Q_ASSERT(!appId.isEmpty() && device); m_appId = appId; m_device = device; m_slog2InfoRunner = new Slog2InfoRunner(appId, m_device, this); connect(m_slog2InfoRunner, SIGNAL(finished()), this, SIGNAL(finished())); connect(m_slog2InfoRunner, SIGNAL(output(QString,Utils::OutputFormat)), this, SIGNAL(output(QString,Utils::OutputFormat))); m_tailProcess = new ProjectExplorer::SshDeviceProcess(m_device, this); connect(m_tailProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readTailStandardOutput())); connect(m_tailProcess, SIGNAL(readyReadStandardError()), this, SLOT(readTailStandardError())); connect(m_tailProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(handleTailProcessError())); } void BlackBerryLogProcessRunner::start() { m_slog2InfoRunner->start(); launchTailProcess(); } void BlackBerryLogProcessRunner::readTailStandardOutput() { const QString message = QString::fromLatin1(m_tailProcess->readAllStandardOutput()); emit output(message, Utils::StdOutFormat); } void BlackBerryLogProcessRunner::readTailStandardError() { const QString message = QString::fromLatin1(m_tailProcess->readAllStandardError()); emit output(message, Utils::StdErrFormat); } void BlackBerryLogProcessRunner::handleTailProcessError() { emit output(tr("Cannot show debug output. Error: %1").arg(m_tailProcess->errorString()), Utils::StdErrFormat); } void BlackBerryLogProcessRunner::launchTailProcess() { if (m_tailProcess->state() == QProcess::Running) return; QStringList parameters; parameters << QLatin1String("-c") << QLatin1String("+1") << QLatin1String("-f") << QLatin1String("/accounts/1000/appdata/") + m_appId + QLatin1String("/logs/log"); m_tailProcess->start(QLatin1String("tail"), parameters); } void BlackBerryLogProcessRunner::stop() { m_slog2InfoRunner->stop(); m_tailProcess->kill(); emit finished(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconnectionmanager.cpp0000644000015301777760000003467612321547255033156 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceconnectionmanager.h" #include "blackberrydeviceconfiguration.h" #include "blackberrydeviceconnection.h" #include "blackberryconfigurationmanager.h" #include "qnxconstants.h" #include #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeviceConnectionManager *BlackBerryDeviceConnectionManager::m_instance = 0; BlackBerryDeviceConnectionManager::BlackBerryDeviceConnectionManager() : QObject() { } BlackBerryDeviceConnectionManager::~BlackBerryDeviceConnectionManager() { killAllConnections(); } void BlackBerryDeviceConnectionManager::initialize() { ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance(); connect(deviceManager, SIGNAL(deviceAdded(Core::Id)), this, SLOT(connectDevice(Core::Id))); connect(deviceManager, SIGNAL(deviceRemoved(Core::Id)), this, SLOT(disconnectDevice(Core::Id))); connect(deviceManager, SIGNAL(deviceListReplaced()), this, SLOT(handleDeviceListChanged())); } void BlackBerryDeviceConnectionManager::killAllConnections() { QList connections = m_connections.uniqueKeys(); foreach (BlackBerryDeviceConnection *connection, connections) { connection->disconnect(); connection->disconnectDevice(); delete connection; } } BlackBerryDeviceConnectionManager *BlackBerryDeviceConnectionManager::instance() { if (m_instance == 0) m_instance = new BlackBerryDeviceConnectionManager(); return m_instance; } bool BlackBerryDeviceConnectionManager::isConnected(Core::Id deviceId) { BlackBerryDeviceConnection *connection = m_connections.key(deviceId); if (!connection) return false; return connection->connectionState() == BlackBerryDeviceConnection::Connected; } QString BlackBerryDeviceConnectionManager::connectionLog(Core::Id deviceId) const { BlackBerryDeviceConnection *connection = m_connections.key(deviceId); if (!connection) return QString(); return connection->messageLog(); } void BlackBerryDeviceConnectionManager::connectDevice(Core::Id deviceId) { ProjectExplorer::IDevice::ConstPtr device = ProjectExplorer::DeviceManager::instance()->find(deviceId); if (device.isNull()) return; // BlackBerry Device connection needs the Qnx environments to be set // in order to find the Connect.jar package. // Let's delay the device connections at startup till the Qnx settings are loaded. if (BlackBerryConfigurationManager::instance().configurations().isEmpty()) { m_pendingDeviceConnections << device; connect(&BlackBerryConfigurationManager::instance(), SIGNAL(settingsLoaded()), this, SLOT(processPendingDeviceConnections()), Qt::UniqueConnection); return; } connectDevice(device); } void BlackBerryDeviceConnectionManager::connectDevice(const ProjectExplorer::IDevice::ConstPtr &device) { if (device->type() != Core::Id(Constants::QNX_BB_OS_TYPE)) return; ProjectExplorer::DeviceManager::instance()->setDeviceState(device->id(), ProjectExplorer::IDevice::DeviceStateUnknown); // Disconnect existing connection if it only belongs to this device, // and if the host has changed BlackBerryDeviceConnection *connection = m_connections.key(device->id()); if (connection && connection->host() != device->sshParameters().host) { if (connectionUsageCount(device->id()) == 1) disconnectDevice(device); m_connections.remove(connection, device->id()); connection = 0; } if (!connection) connection = connectionForHost(device->sshParameters().host); if (!connection) { connection = new BlackBerryDeviceConnection(); m_connections.insertMulti(connection, device->id()); connect(connection, SIGNAL(deviceConnected()), this, SLOT(handleDeviceConnected())); connect(connection, SIGNAL(deviceDisconnected()), this, SLOT(handleDeviceDisconnected())); connect(connection, SIGNAL(processOutput(QString)), this, SLOT(handleProcessOutput(QString))); connect(connection, SIGNAL(deviceAboutToConnect()), this, SLOT(handleDeviceAboutToConnect())); connection->connectDevice(device); } else { if (!m_connections.values(connection).contains(device->id())) m_connections.insertMulti(connection, device->id()); switch (connection->connectionState()) { case BlackBerryDeviceConnection::Connected: ProjectExplorer::DeviceManager::instance()->setDeviceState(device->id(), ProjectExplorer::IDevice::DeviceReadyToUse); break; case BlackBerryDeviceConnection::Connecting: ProjectExplorer::DeviceManager::instance()->setDeviceState(device->id(), ProjectExplorer::IDevice::DeviceStateUnknown); break; case BlackBerryDeviceConnection::Disconnected: connection->connectDevice(device); break; } } } void BlackBerryDeviceConnectionManager::disconnectDevice(const ProjectExplorer::IDevice::ConstPtr &device) { disconnectDevice(device->id()); } /*! * @brief Returns default private key path in local settings. * @return the default private key path */ const QString BlackBerryDeviceConnectionManager::privateKeyPath() const { return QFileInfo(Core::ICore::settings()->fileName()).absolutePath() + QLatin1String("/qtcreator/qnx/id_rsa"); } /*! * @brief Checks validity of default SSH keys used for connecting to a device. * @return true, if the default SSH keys are valid */ bool BlackBerryDeviceConnectionManager::hasValidSSHKeys() const { const QString privateKey = privateKeyPath(); QFileInfo privateKeyFileInfo(privateKey); QFileInfo publicKeyFileInfo(privateKey + QLatin1String(".pub")); return privateKeyFileInfo.exists() && privateKeyFileInfo.isReadable() && publicKeyFileInfo.exists() && publicKeyFileInfo.isReadable(); } /*! * @brief Stores a new private and public SSH key in local settings. * @param privateKeyContent the private key content * @param publicKeyContent the public key content */ bool BlackBerryDeviceConnectionManager::setSSHKeys(const QByteArray privateKeyContent, const QByteArray publicKeyContent, QString *error) { const QString privateKey = privateKeyPath(); const QString publicKey = privateKey + QLatin1String(".pub"); QFileInfo fileInfo(privateKey); QDir dir = fileInfo.dir(); if (!dir.exists()) dir.mkpath(QLatin1String(".")); Utils::FileSaver privSaver(privateKey); privSaver.write(privateKeyContent); if (!privSaver.finalize(error)) return false; QFile::setPermissions(privateKey, QFile::ReadOwner | QFile::WriteOwner); Utils::FileSaver pubSaver(publicKey); pubSaver.write(publicKeyContent); if (!pubSaver.finalize(error)) return false; return true; } void BlackBerryDeviceConnectionManager::disconnectDevice(Core::Id deviceId) { BlackBerryDeviceConnection *connection = m_connections.key(deviceId); if (!connection) return; connection->disconnectDevice(); } void BlackBerryDeviceConnectionManager::handleDeviceListChanged() { disconnectRemovedDevices(); reconnectChangedDevices(); connectAddedDevices(); } void BlackBerryDeviceConnectionManager::handleDeviceConnected() { BlackBerryDeviceConnection *connection = qobject_cast(sender()); QTC_ASSERT(connection, return); QList knownDevices = m_connections.values(connection); foreach (Core::Id id, knownDevices) ProjectExplorer::DeviceManager::instance()->setDeviceState(id, ProjectExplorer::IDevice::DeviceReadyToUse); QList sameHostDevices = devicesForHost(connection->host()); foreach (Core::Id id, sameHostDevices) { if (!knownDevices.contains(id)) { m_connections.insertMulti(connection, id); ProjectExplorer::DeviceManager::instance()->setDeviceState(id, ProjectExplorer::IDevice::DeviceReadyToUse); } } emit deviceConnected(); } void BlackBerryDeviceConnectionManager::handleDeviceDisconnected() { BlackBerryDeviceConnection *connection = qobject_cast(sender()); QTC_ASSERT(connection, return); QList disconnectedDevices = m_connections.values(connection); foreach (Core::Id id, disconnectedDevices) { ProjectExplorer::DeviceManager::instance()->setDeviceState(id, ProjectExplorer::IDevice::DeviceDisconnected); emit deviceDisconnected(id); } } void BlackBerryDeviceConnectionManager::handleDeviceAboutToConnect() { BlackBerryDeviceConnection *connection = qobject_cast(sender()); QTC_ASSERT(connection, return); QList deviceIds = m_connections.values(connection); foreach (Core::Id deviceId, deviceIds) emit deviceAboutToConnect(deviceId); } void BlackBerryDeviceConnectionManager::handleProcessOutput(const QString &output) { BlackBerryDeviceConnection *connection = qobject_cast(sender()); QTC_ASSERT(connection, return); QList deviceIds = m_connections.values(connection); foreach (Core::Id deviceId, deviceIds) emit connectionOutput(deviceId, output); } void BlackBerryDeviceConnectionManager::processPendingDeviceConnections() { if (m_pendingDeviceConnections.isEmpty() || BlackBerryConfigurationManager::instance().configurations().isEmpty()) return; foreach (ProjectExplorer::IDevice::ConstPtr device, m_pendingDeviceConnections) connectDevice(device); m_pendingDeviceConnections.clear(); disconnect(&BlackBerryConfigurationManager::instance(), SIGNAL(settingsLoaded()), this, SLOT(processPendingDeviceConnections())); } BlackBerryDeviceConnection *BlackBerryDeviceConnectionManager::connectionForHost(const QString &host) const { QList connections = m_connections.uniqueKeys(); foreach (BlackBerryDeviceConnection *connection, connections) { if (connection->host() == host) return connection; } return 0; } QList BlackBerryDeviceConnectionManager::devicesForHost(const QString &host) const { QList result; ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance(); for (int i = 0; i < deviceManager->deviceCount(); ++i) { ProjectExplorer::IDevice::ConstPtr device = deviceManager->deviceAt(i); if (device->type() == Core::Id(Constants::QNX_BB_OS_TYPE) && device->sshParameters().host == host) result << device->id(); } return result; } int BlackBerryDeviceConnectionManager::connectionUsageCount(Core::Id deviceId) { BlackBerryDeviceConnection *connection = m_connections.key(deviceId); return m_connections.count(connection); } void BlackBerryDeviceConnectionManager::disconnectRemovedDevices() { ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance(); QList knownDevices = m_connections.values(); foreach (Core::Id id, knownDevices) { ProjectExplorer::IDevice::ConstPtr device = deviceManager->find(id); if (device.isNull() && connectionUsageCount(id) <= 1) disconnectDevice(id); } } void BlackBerryDeviceConnectionManager::reconnectChangedDevices() { ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance(); QList connectedDevices = m_connections.values(); for (int i = 0; i < deviceManager->deviceCount(); ++i) { ProjectExplorer::IDevice::ConstPtr device = deviceManager->deviceAt(i); if (!connectedDevices.contains(device->id())) continue; BlackBerryDeviceConnection *connection = m_connections.key(device->id()); QTC_ASSERT(connection, continue); if (connection->host() == device->sshParameters().host) continue; if (connectionUsageCount(device->id()) <= 1) disconnectDevice(device->id()); m_connections.remove(connection, device->id()); connectDevice(device->id()); } } void BlackBerryDeviceConnectionManager::connectAddedDevices() { ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance(); QList knownDevices = m_connections.values(); for (int i = 0; i < deviceManager->deviceCount(); ++i) { Core::Id deviceId = deviceManager->deviceAt(i)->id(); if (!knownDevices.contains(deviceId)) connectDevice(deviceId); } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorfactory.h0000644000015301777760000000413612321547255031336 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORFACTORY_H #define QNX_INTERNAL_BARDESCRIPTOREDITORFACTORY_H #include namespace TextEditor { class TextEditorActionHandler; } namespace Qnx { namespace Internal { class BarDescriptorEditorFactory : public Core::IEditorFactory { Q_OBJECT public: explicit BarDescriptorEditorFactory(QObject *parent = 0); ~BarDescriptorEditorFactory(); Core::IEditor *createEditor(QWidget *parent); private: TextEditor::TextEditorActionHandler *m_actionHandler; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryprocessparser.cpp0000644000015301777760000001137012321547255031161 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryprocessparser.h" #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char ERROR_MESSAGE_START[] = "Error: "; const char WARNING_MESSAGE_START[] = "Warning: "; const char PROGRESS_MESSAGE_START[] = "Info: Progress "; const char PID_MESSAGE_START[] = "result::"; const char APPLICATION_ID_MESSAGE_START[] = "Info: Launching "; const char AUTHENTICATION_ERROR[] = "Authentication failed."; } BlackBerryProcessParser::BlackBerryProcessParser() { m_messageReplacements[QLatin1String(AUTHENTICATION_ERROR)] = tr("Authentication failed. Please make sure the password for the device is correct."); } void BlackBerryProcessParser::stdOutput(const QString &line) { parse(line); IOutputParser::stdOutput(line); } void BlackBerryProcessParser::stdError(const QString &line) { parse(line); IOutputParser::stdError(line); } void BlackBerryProcessParser::parse(const QString &line) { bool isErrorMessage = line.startsWith(QLatin1String(ERROR_MESSAGE_START)); bool isWarningMessage = line.startsWith(QLatin1String(WARNING_MESSAGE_START)); if (isErrorMessage || isWarningMessage) parseErrorAndWarningMessage(line, isErrorMessage); else if (line.startsWith(QLatin1String(PROGRESS_MESSAGE_START))) parseProgress(line); else if (line.startsWith(QLatin1String(PID_MESSAGE_START))) parsePid(line); else if (line.startsWith(QLatin1String(APPLICATION_ID_MESSAGE_START))) parseApplicationId(line); } void BlackBerryProcessParser::parseErrorAndWarningMessage(const QString &line, bool isErrorMessage) { QString message = line.mid(line.indexOf(QLatin1String(": ")) + 2).trimmed(); foreach (const QString &key, m_messageReplacements.keys()) { if (message.startsWith(key)) { message = m_messageReplacements[key]; break; } } ProjectExplorer::Task task(isErrorMessage ? ProjectExplorer::Task::Error : ProjectExplorer::Task::Warning, message, Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); emit addTask(task); } void BlackBerryProcessParser::parseProgress(const QString &line) { const QString startOfLine = QLatin1String(PROGRESS_MESSAGE_START); const int percentPos = line.indexOf(QLatin1Char('%')); const QString progressStr = line.mid(startOfLine.length(), percentPos - startOfLine.length()); bool ok; const int progress = progressStr.toInt(&ok); if (ok) emit progressParsed(progress); } void BlackBerryProcessParser::parsePid(const QString &line) { int pidIndex = -1; if (line.contains(QLatin1String("running"))) // "result::running," pidIndex = 16; else // "result::" pidIndex = 8; bool ok; const qint64 pid = line.mid(pidIndex).toInt(&ok); if (ok) emit pidParsed(pid); } void BlackBerryProcessParser::parseApplicationId(const QString &line) { const int endOfId = line.indexOf(QLatin1String("...")); const QString applicationId = line.mid(16, endOfId - 16); emit applicationIdParsed(applicationId); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryinstallwizard.cpp0000644000015301777760000000711212321547255031154 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryinstallwizard.h" #include "blackberryinstallwizardpages.h" #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryInstallWizard::BlackBerryInstallWizard(BlackBerryInstallerDataHandler::Mode mode, const QString& version, QWidget *parent) : Utils::Wizard(parent) , m_ndkPage(0) , m_targetPage(0) { setWindowTitle(tr("BlackBerry NDK Installation Wizard")); m_data.mode = mode; m_data.version = version; if (m_data.mode != BlackBerryInstallerDataHandler::UninstallMode) { m_optionPage = new BlackBerryInstallWizardOptionPage(m_data, this); m_ndkPage = new BlackBerryInstallWizardNdkPage(m_data, this); m_targetPage = new BlackBerryInstallWizardTargetPage(m_data, this); setPage(OptionPage, m_optionPage); setPage(NdkPageId, m_ndkPage); setPage(TargetPageId, m_targetPage); } m_processPage = new BlackBerryInstallWizardProcessPage(m_data, this); m_finalPage = new BlackBerryInstallWizardFinalPage(m_data, this); connect(m_finalPage, SIGNAL(done()), this, SIGNAL(processFinished())); disconnect(button(CancelButton), SIGNAL(clicked()), this, SLOT(reject())); connect(button(CancelButton), SIGNAL(clicked()), this, SLOT(handleProcessCancelled())); setPage(ProcessPageId, m_processPage); setPage(FinalPageId, m_finalPage); m_finalPage->setCommitPage(true); setOption(DisabledBackButtonOnLastPage, true); } void BlackBerryInstallWizard::handleProcessCancelled() { if ((m_targetPage && m_targetPage->isProcessRunning()) || m_processPage->isProcessRunning()) { const QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Confirmation"), tr("Are you sure you want to cancel?"), QMessageBox::Yes | QMessageBox::No); if (answer == QMessageBox::No) return; } reject(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryrunconfigurationwidget.cpp0000644000015301777760000000443512321547255033072 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryrunconfigurationwidget.h" #include "ui_blackberryrunconfigurationwidget.h" #include "blackberryrunconfiguration.h" using namespace Qnx; using namespace Qnx::Internal; BlackBerryRunConfigurationWidget::BlackBerryRunConfigurationWidget(BlackBerryRunConfiguration *config, QWidget *parent) : QWidget(parent) , m_ui(new Ui::BlackBerryRunConfigurationWidget) , m_runConfiguration(config) { m_ui->setupUi(this); updateUi(); connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this, SLOT(updateUi())); } BlackBerryRunConfigurationWidget::~BlackBerryRunConfigurationWidget() { delete m_ui; } void BlackBerryRunConfigurationWidget::updateUi() { m_ui->deviceLabel->setText(m_runConfiguration->deviceName()); m_ui->packageLabel->setText(m_runConfiguration->barPackage()); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeployconfiguration.h0000644000015301777760000000423612321547255030510 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H #define QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H #include namespace Qnx { namespace Internal { class QnxDeployConfiguration : public RemoteLinux::RemoteLinuxDeployConfiguration { Q_OBJECT public: QnxDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id, const QString &defaultDisplayName); QnxDeployConfiguration(ProjectExplorer::Target *target, QnxDeployConfiguration *source); private: friend class QnxDeployConfigurationFactory; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryprocessparser.h0000644000015301777760000000457112321547255030633 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYPROCESSPARSER_H #define QNX_INTERNAL_BLACKBERRYPROCESSPARSER_H #include namespace Qnx { namespace Internal { class BlackBerryProcessParser : public ProjectExplorer::IOutputParser { Q_OBJECT public: BlackBerryProcessParser(); void stdOutput(const QString &line); void stdError(const QString &line); signals: void progressParsed(int progress); void pidParsed(qint64 pid); void applicationIdParsed(const QString &applicationId); private: void parse(const QString &line); void parseErrorAndWarningMessage(const QString &line, bool isErrorMessage); void parseProgress(const QString &line); void parsePid(const QString &line); void parseApplicationId(const QString &line); QMap m_messageReplacements; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYPROCESSPARSER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeployconfiguration.h0000644000015301777760000000527012321547255032021 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATION_H #define QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATION_H #include #include "blackberrydeviceconfiguration.h" namespace ProjectExplorer { class Target; } namespace Qnx { namespace Internal { class BlackBerryDeployInformation; class BlackBerryDeployConfiguration : public ProjectExplorer::DeployConfiguration { Q_OBJECT friend class BlackBerryDeployConfigurationFactory; public: explicit BlackBerryDeployConfiguration(ProjectExplorer::Target *parent); virtual ~BlackBerryDeployConfiguration(); ProjectExplorer::NamedWidget *createConfigWidget(); BlackBerryDeployInformation *deploymentInfo() const; QVariantMap toMap() const; protected: BlackBerryDeployConfiguration(ProjectExplorer::Target *parent, BlackBerryDeployConfiguration *source); bool fromMap(const QVariantMap &map); private slots: void setupBarDescriptor(); private: void ctor(); void addBarDescriptorToProject(const QString& barDescriptorPath); BlackBerryDeployInformation *m_deployInformation; bool m_appBarDesciptorSetup; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceinformation.cpp0000644000015301777760000001263112321547255031774 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeviceinformation.h" namespace { static const char PROCESS_NAME[] = "blackberry-deploy"; static const char ERR_NO_ROUTE_HOST[] = "Cannot connect"; static const char ERR_AUTH_FAILED[] = "Authentication failed"; static const char ERR_DEVELOPMENT_MODE_DISABLED[] = "Device is not in the Development Mode"; } namespace Qnx { namespace Internal { BlackBerryDeviceInformation::BlackBerryDeviceInformation(QObject *parent) : BlackBerryNdkProcess(QLatin1String(PROCESS_NAME), parent) { addErrorStringMapping(QLatin1String(ERR_NO_ROUTE_HOST), NoRouteToHost); addErrorStringMapping(QLatin1String(ERR_AUTH_FAILED), AuthenticationFailed); addErrorStringMapping(QLatin1String(ERR_DEVELOPMENT_MODE_DISABLED), DevelopmentModeDisabled); } void BlackBerryDeviceInformation::setDeviceTarget(const QString &deviceIp, const QString &devicePassword) { QStringList arguments; arguments << QLatin1String("-listDeviceInfo") << QLatin1String("-device") << deviceIp << QLatin1String("-password") << devicePassword; start(arguments); } void BlackBerryDeviceInformation::resetResults() { m_devicePin.clear(); m_deviceOS.clear(); m_hardwareId.clear(); m_debugTokenAuthor.clear(); m_scmBundle.clear(); m_hostName.clear(); m_debugTokenValid = false; m_isSimulator = false; m_isProductionDevice = true; } QString BlackBerryDeviceInformation::devicePin() const { return m_devicePin; } QString BlackBerryDeviceInformation::deviceOS() const { return m_deviceOS; } QString BlackBerryDeviceInformation::hardwareId() const { return m_hardwareId; } QString BlackBerryDeviceInformation::debugTokenAuthor() const { return m_debugTokenAuthor; } QString BlackBerryDeviceInformation::scmBundle() const { return m_scmBundle; } QString BlackBerryDeviceInformation::hostName() const { return m_hostName; } bool BlackBerryDeviceInformation::debugTokenValid() const { return m_debugTokenValid; } bool BlackBerryDeviceInformation::isSimulator() const { return m_isSimulator; } bool BlackBerryDeviceInformation::isProductionDevice() const { return m_isProductionDevice; } void BlackBerryDeviceInformation::processData(const QString &line) { static const QString devicepin = QLatin1String("devicepin::0x"); static const QString device_os = QLatin1String("device_os::"); static const QString hardwareid = QLatin1String("hardwareid::"); static const QString debug_token_author = QLatin1String("debug_token_author::"); static const QString debug_token_valid = QLatin1String("debug_token_valid:b:"); static const QString simulator = QLatin1String("simulator:b:"); static const QString scmbundle = QLatin1String("scmbundle::"); static const QString hostname = QLatin1String("hostname::"); static const QString production_device = QLatin1String("production_device:b:"); if (line.startsWith(devicepin)) m_devicePin = line.mid(devicepin.size()).trimmed(); else if (line.startsWith(device_os)) m_deviceOS = line.mid(device_os.size()).trimmed(); else if (line.startsWith(hardwareid)) m_hardwareId = line.mid(hardwareid.size()).trimmed(); else if (line.startsWith(debug_token_author)) m_debugTokenAuthor = line.mid(debug_token_author.size()).trimmed(); else if (line.startsWith(debug_token_valid)) m_debugTokenValid = line.mid(debug_token_valid.size()).trimmed() == QLatin1String("true"); else if (line.startsWith(simulator)) m_isSimulator = line.mid(simulator.size()).trimmed() == QLatin1String("true"); else if (line.startsWith(scmbundle)) m_scmBundle = line.mid(scmbundle.size()).trimmed(); else if (line.startsWith(hostname)) m_hostName = line.mid(hostname.size()).trimmed(); else if (line.startsWith(production_device)) m_isProductionDevice = line.mid(production_device.size()).trimmed() == QLatin1String("true"); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeploystepfactory.cpp0000644000015301777760000001025112321547255032043 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydeploystepfactory.h" #include "qnxconstants.h" #include "blackberrydeploystep.h" #include "blackberrydeviceconfigurationfactory.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDeployStepFactory::BlackBerryDeployStepFactory() { } QList BlackBerryDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const { if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) return QList(); Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->target()->kit()); if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType()) return QList(); return QList() << Core::Id(Constants::QNX_DEPLOY_PACKAGE_BS_ID); } QString BlackBerryDeployStepFactory::displayNameForId(const Core::Id id) const { if (id == Constants::QNX_DEPLOY_PACKAGE_BS_ID) return tr("Deploy Package"); return QString(); } bool BlackBerryDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const { return availableCreationIds(parent).contains(id); } ProjectExplorer::BuildStep *BlackBerryDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) { if (!canCreate(parent, id)) return 0; return new BlackBerryDeployStep(parent); } bool BlackBerryDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, ProjectExplorer::idFromMap(map)); } ProjectExplorer::BuildStep *BlackBerryDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; BlackBerryDeployStep *bs = new BlackBerryDeployStep(parent); if (bs->fromMap(map)) return bs; delete bs; return 0; } bool BlackBerryDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const { return canCreate(parent, product->id()); } ProjectExplorer::BuildStep *BlackBerryDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) { if (!canClone(parent, product)) return 0; return new BlackBerryDeployStep(parent, static_cast(product)); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrykeyswidget.cpp0000644000015301777760000001550312321547255030447 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrykeyswidget.h" #include "blackberryconfigurationmanager.h" #include "blackberrycertificate.h" #include "blackberrysigningutils.h" #include "blackberrycreatecertificatedialog.h" #include "ui_blackberrykeyswidget.h" #include #include namespace Qnx { namespace Internal { BlackBerryKeysWidget::BlackBerryKeysWidget(QWidget *parent) : QWidget(parent), m_utils(BlackBerrySigningUtils::instance()), m_ui(new Ui_BlackBerryKeysWidget) { m_ui->setupUi(this); m_ui->keyStatus->setTextFormat(Qt::RichText); m_ui->keyStatus->setTextInteractionFlags(Qt::TextBrowserInteraction); m_ui->keyStatus->setOpenExternalLinks(true); m_ui->openCertificateButton->setVisible(false); connect(m_ui->createCertificateButton, SIGNAL(clicked()), this, SLOT(createCertificate())); connect(m_ui->clearCertificateButton, SIGNAL(clicked()), this, SLOT(clearCertificate())); connect(m_ui->openCertificateButton, SIGNAL(clicked()), this, SLOT(loadDefaultCertificate())); } void BlackBerryKeysWidget::certificateLoaded(int status) { disconnect(&m_utils, SIGNAL(defaultCertificateLoaded(int)), this, SLOT(certificateLoaded(int))); switch (status) { case BlackBerryCertificate::Success: m_ui->certificateAuthor->setText(m_utils.defaultCertificate()->author()); m_ui->openCertificateButton->setVisible(false); break; case BlackBerryCertificate::WrongPassword: if (QMessageBox::question(this, tr("Qt Creator"), tr("Invalid certificate password. Try again?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { loadDefaultCertificate(); } else { m_ui->certificateAuthor->clear(); m_ui->openCertificateButton->setVisible(true); } break; case BlackBerryCertificate::Busy: case BlackBerryCertificate::InvalidOutputFormat: case BlackBerryCertificate::Error: setCertificateError(tr("Error loading certificate.")); m_ui->openCertificateButton->setVisible(true); break; } } void BlackBerryKeysWidget::createCertificate() { BlackBerryCreateCertificateDialog dialog; const int result = dialog.exec(); if (result == QDialog::Rejected) return; BlackBerryCertificate *certificate = dialog.certificate(); if (certificate) { m_utils.setDefaultCertificate(certificate); updateCertificateSection(); } } void BlackBerryKeysWidget::clearCertificate() { if (QMessageBox::warning(this, tr("Qt Creator"), tr("This action cannot be undone. Would you like to continue?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { m_utils.deleteDefaultCertificate(); updateCertificateSection(); } } void BlackBerryKeysWidget::showEvent(QShowEvent *) { updateKeysSection(); updateCertificateSection(); } void BlackBerryKeysWidget::updateCertificateSection() { if (m_utils.hasDefaultCertificate()) { setCreateCertificateVisible(false); BlackBerryConfigurationManager &configManager = BlackBerryConfigurationManager::instance(); m_ui->certificatePath->setText(configManager.defaultKeystorePath()); m_ui->certificateAuthor->setText(tr("Loading...")); loadDefaultCertificate(); } else { setCreateCertificateVisible(true); } } void BlackBerryKeysWidget::updateKeysSection() { if (m_utils.hasLegacyKeys()) { m_ui->keyStatus->setText(tr("It appears you are using legacy key files. " "Please refer to the " "" "BlackBerry website to find out how to update your keys.")); } else if (m_utils.hasRegisteredKeys()) { m_ui->keyStatus->setText(tr("Your keys are ready to be used")); } else { m_ui->keyStatus->setText(tr("No keys found. Please refer to the " "BlackBerry website " "to find out how to request your keys.")); } } void BlackBerryKeysWidget::loadDefaultCertificate() { const BlackBerryCertificate *certificate = m_utils.defaultCertificate(); if (certificate) { m_ui->certificateAuthor->setText(certificate->author()); m_ui->openCertificateButton->setVisible(false); return; } connect(&m_utils, SIGNAL(defaultCertificateLoaded(int)), this, SLOT(certificateLoaded(int))); m_utils.openDefaultCertificate(); } void BlackBerryKeysWidget::setCertificateError(const QString &error) { m_ui->certificateAuthor->clear(); QMessageBox::critical(this, tr("Qt Creator"), error); } void BlackBerryKeysWidget::setCreateCertificateVisible(bool visible) { m_ui->pathLabel->setVisible(!visible); m_ui->authorLabel->setVisible(!visible); m_ui->certificatePath->setVisible(!visible); m_ui->certificateAuthor->setVisible(!visible); m_ui->clearCertificateButton->setVisible(!visible); m_ui->openCertificateButton->setVisible(!visible); m_ui->noCertificateLabel->setVisible(visible); m_ui->createCertificateButton->setVisible(visible); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorenvironmentwidget.h0000644000015301777760000000445112321547255033437 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORENVIRONMENTWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORENVIRONMENTWIDGET_H #include "bardescriptoreditorabstractpanelwidget.h" #include namespace Qnx { namespace Internal { namespace Ui { class BarDescriptorEditorEnvironmentWidget; } class BarDescriptorEditorEnvironmentWidget : public BarDescriptorEditorAbstractPanelWidget { Q_OBJECT public: explicit BarDescriptorEditorEnvironmentWidget(QWidget *parent = 0); ~BarDescriptorEditorEnvironmentWidget(); void clear(); QList environment() const; void appendEnvironmentItem(const Utils::EnvironmentItem &envItem); private: Ui::BarDescriptorEditorEnvironmentWidget *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORENVIRONMENTWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnx.qrc0000644000015301777760000000022012321547255025026 0ustar pbusernogroup00000000000000 images/target-small.png images/target.png qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryqtversion.cpp0000644000015301777760000001215312321547255030320 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryqtversion.h" #include "qnxutils.h" #include "qnxconstants.h" #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const QLatin1String NndkEnvFile("ndkEnvFile"); } BlackBerryQtVersion::BlackBerryQtVersion() : QnxAbstractQtVersion() { } BlackBerryQtVersion::BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected, const QString &autoDetectionSource, const QString &sdkPath) : QnxAbstractQtVersion(arch, path, isAutoDetected, autoDetectionSource) { if (!sdkPath.isEmpty()) { if (QFileInfo(sdkPath).isDir()) { setSdkPath(sdkPath); } else { m_ndkEnvFile = sdkPath; setSdkPath(QFileInfo(sdkPath).absolutePath()); } } else { setDefaultSdkPath(); } } BlackBerryQtVersion::~BlackBerryQtVersion() { } BlackBerryQtVersion *BlackBerryQtVersion::clone() const { return new BlackBerryQtVersion(*this); } QString BlackBerryQtVersion::type() const { return QLatin1String(Constants::QNX_BB_QT); } QString BlackBerryQtVersion::description() const { return tr("BlackBerry %1", "Qt Version is meant for BlackBerry").arg(archString()); } QVariantMap BlackBerryQtVersion::toMap() const { QVariantMap result = QnxAbstractQtVersion::toMap(); result.insert(NndkEnvFile, m_ndkEnvFile); return result; } void BlackBerryQtVersion::fromMap(const QVariantMap &map) { QnxAbstractQtVersion::fromMap(map); m_ndkEnvFile = map.value(NndkEnvFile).toString(); } QList BlackBerryQtVersion::environment() const { QTC_CHECK(!sdkPath().isEmpty()); if (sdkPath().isEmpty()) return QList(); QString envFile = m_ndkEnvFile.isEmpty() ? QnxUtils::envFilePath(sdkPath()) : m_ndkEnvFile; QList env = QnxUtils::qnxEnvironmentFromNdkFile(envFile); // BB NDK Host is having qmake executable which is using qt.conf file to specify // base information. The qt.conf file is using 'CPUVARDIR' environment variable // to provide correct information for both x86 and armle-v7 architectures. // BlackBerryQtVersion represents as specific environment for each Qt4/Qt5 // and x86/armle-v7 combination. Therefore we need to explicitly specify // CPUVARDIR to match expected architecture() otherwise qmake environment is // always resolved to be for armle-v7 architecture only as it is specified // BB NDK environment file. env.append(Utils::EnvironmentItem(QLatin1String("CPUVARDIR"), architecture() == X86 ? QLatin1String("x86") : QLatin1String("armle-v7"))); return env; } void BlackBerryQtVersion::setDefaultSdkPath() { QHash info = versionInfo(); QString qtHostPrefix; if (info.contains(QLatin1String("QT_HOST_PREFIX"))) qtHostPrefix = info.value(QLatin1String("QT_HOST_PREFIX")); else return; if (QnxUtils::isValidNdkPath(qtHostPrefix)) setSdkPath(qtHostPrefix); } Core::FeatureSet BlackBerryQtVersion::availableFeatures() const { Core::FeatureSet features = QnxAbstractQtVersion::availableFeatures(); features |= Core::FeatureSet(Constants::QNX_BB_FEATURE); return features; } QString BlackBerryQtVersion::platformName() const { return QLatin1String(Constants::QNX_BB_PLATFORM_NAME); } QString BlackBerryQtVersion::platformDisplayName() const { return tr("BlackBerry"); } QString BlackBerryQtVersion::sdkDescription() const { return tr("BlackBerry Native SDK:"); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditor.h0000644000015301777760000000477412321547255027756 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITOR_H #define QNX_INTERNAL_BARDESCRIPTOREDITOR_H #include QT_BEGIN_NAMESPACE class QActionGroup; class QToolBar; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BarDescriptorDocument; class BarDescriptorEditorWidget; class BarDescriptorEditor : public Core::IEditor { Q_OBJECT public: enum EditorPage { General = 0, Application, Assets, Source }; explicit BarDescriptorEditor(BarDescriptorEditorWidget *editorWidget); bool open(QString *errorString, const QString &fileName, const QString &realFileName); Core::IDocument *document(); Core::Id id() const; QWidget *toolBar(); EditorPage activePage() const; private slots: void changeEditorPage(QAction *action); private: void setActivePage(EditorPage page); BarDescriptorDocument *m_file; QToolBar *m_toolBar; QActionGroup *m_actionGroup; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITOR_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizardpages.cpp0000644000015301777760000002603512321547255031673 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrysetupwizardpages.h" #include "blackberryndksettingswidget.h" #include "blackberryconfiguration.h" #include "blackberrysigningutils.h" #include "ui_blackberrysetupwizardkeyspage.h" #include "ui_blackberrysetupwizardcertificatepage.h" #include "ui_blackberrysetupwizarddevicepage.h" #include "ui_blackberrysetupwizardfinishpage.h" #include #include #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerrySetupWizardWelcomePage::BlackBerrySetupWizardWelcomePage(QWidget *parent) : QWizardPage(parent) { const QString welcomeMessage = tr("Welcome to the BlackBerry Development " "Environment Setup Wizard.\nThis wizard will guide you through " "the essential steps to deploy a ready-to-go development environment " "for BlackBerry 10 devices."); setTitle(tr("BlackBerry Development Environment Setup")); QLabel *label = new QLabel(this); label->setWordWrap(true); label->setText(welcomeMessage); QVBoxLayout *layout = new QVBoxLayout; layout->addStretch(); layout->addWidget(label); layout->addStretch(); setLayout(layout); } //----------------------------------------------------------------------------- BlackBerrySetupWizardNdkPage::BlackBerrySetupWizardNdkPage(QWidget *parent) : QWizardPage(parent), m_widget(0) { setTitle(tr("Configure the NDK Path")); m_widget = new BlackBerryNDKSettingsWidget(this); m_widget->setWizardMessageVisible(false); connect(m_widget, SIGNAL(targetsUpdated()), this, SIGNAL(completeChanged())); connect(m_widget, SIGNAL(targetsUpdated()), this, SIGNAL(targetsUpdated())); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(m_widget); setLayout(layout); } BlackBerrySetupWizardNdkPage::~BlackBerrySetupWizardNdkPage() { } bool BlackBerrySetupWizardNdkPage::isComplete() const { return m_widget->hasActiveNdk(); } //----------------------------------------------------------------------------- BlackBerrySetupWizardKeysPage::BlackBerrySetupWizardKeysPage(QWidget *parent) : QWizardPage(parent), m_ui(0), m_complete(false) { setTitle(tr("Setup Signing Keys")); initUi(); } BlackBerrySetupWizardKeysPage::~BlackBerrySetupWizardKeysPage() { delete m_ui; m_ui = 0; } void BlackBerrySetupWizardKeysPage::showKeysMessage(const QString &url) { const QMessageBox::StandardButton button = QMessageBox::question(this, tr("Qt Creator"), tr("This wizard will be closed and you will be taken to the BlackBerry " "key request web page. Do you want to continue?"), QMessageBox::Yes | QMessageBox::No); if (button == QMessageBox::Yes) { QDesktopServices::openUrl(QUrl(url)); wizard()->reject(); } } bool BlackBerrySetupWizardKeysPage::isComplete() const { return m_complete; } void BlackBerrySetupWizardKeysPage::initUi() { BlackBerrySigningUtils &utils = BlackBerrySigningUtils::instance(); m_ui = new Ui::BlackBerrySetupWizardKeysPage; m_ui->setupUi(this); if (utils.hasLegacyKeys()) { m_ui->linkLabel->setVisible(false); m_ui->legacyLabel->setVisible(true); m_ui->statusLabel->setVisible(false); setComplete(false); } else if (utils.hasRegisteredKeys()) { m_ui->linkLabel->setVisible(false); m_ui->legacyLabel->setVisible(false); m_ui->statusLabel->setVisible(true); setComplete(true); } else { m_ui->linkLabel->setVisible(true); m_ui->legacyLabel->setVisible(false); m_ui->statusLabel->setVisible(false); setComplete(false); } connect(m_ui->linkLabel, SIGNAL(linkActivated(QString)), this, SLOT(showKeysMessage(QString))); connect(m_ui->legacyLabel, SIGNAL(linkActivated(QString)), this, SLOT(showKeysMessage(QString))); } void BlackBerrySetupWizardKeysPage::setComplete(bool complete) { if (m_complete != complete) { m_complete = complete; m_ui->linkLabel->setVisible(!complete); m_ui->statusLabel->setVisible(complete); emit completeChanged(); } } //----------------------------------------------------------------------------- const char BlackBerrySetupWizardCertificatePage::AuthorField[] = "CertificatePage::Author"; const char BlackBerrySetupWizardCertificatePage::PasswordField[] = "CertificatePage::Password"; const char BlackBerrySetupWizardCertificatePage::PasswordField2[] = "CertificatePage::Password2"; BlackBerrySetupWizardCertificatePage::BlackBerrySetupWizardCertificatePage(QWidget *parent) : QWizardPage(parent), m_ui(0), m_complete(false) { setTitle(tr("Create Developer Certificate")); initUi(); } bool BlackBerrySetupWizardCertificatePage::isComplete() const { return m_complete; } void BlackBerrySetupWizardCertificatePage::validate() { if (m_ui->author->text().isEmpty() || m_ui->password->text().isEmpty() || m_ui->password2->text().isEmpty()) { m_ui->status->clear(); setComplete(false); return; } if (m_ui->password->text() != m_ui->password2->text()) { m_ui->status->setText(tr("The entered passwords do not match.")); setComplete(false); return; } if (m_ui->password->text().size() < 6) { // TODO: Use tr() once string freeze is over m_ui->status->setText(QCoreApplication::translate("Qnx::Internal::BlackBerryCreateCertificateDialog", "Password must be at least 6 characters long.")); setComplete(false); return; } m_ui->status->clear(); setComplete(true); } void BlackBerrySetupWizardCertificatePage::checkBoxChanged(int state) { if (state == Qt::Checked) { m_ui->password->setEchoMode(QLineEdit::Normal); m_ui->password2->setEchoMode(QLineEdit::Normal); } else { m_ui->password->setEchoMode(QLineEdit::Password); m_ui->password2->setEchoMode(QLineEdit::Password); } } void BlackBerrySetupWizardCertificatePage::setComplete(bool complete) { if (m_complete != complete) { m_complete = complete; emit completeChanged(); } } void BlackBerrySetupWizardCertificatePage::initUi() { m_ui = new Ui::BlackBerrySetupWizardCertificatePage; m_ui->setupUi(this); m_ui->status->clear(); connect(m_ui->author, SIGNAL(textChanged(QString)), this, SLOT(validate())); connect(m_ui->password, SIGNAL(textChanged(QString)), this, SLOT(validate())); connect(m_ui->password2, SIGNAL(textChanged(QString)), this, SLOT(validate())); connect(m_ui->showPassword, SIGNAL(stateChanged(int)), this, SLOT(checkBoxChanged(int))); registerField(QLatin1String(AuthorField) + QLatin1Char('*'), m_ui->author); registerField(QLatin1String(PasswordField) + QLatin1Char('*'), m_ui->password); registerField(QLatin1String(PasswordField2) + QLatin1Char('*'), m_ui->password2); } //----------------------------------------------------------------------------- const char BlackBerrySetupWizardDevicePage::NameField[] = "DevicePage::Name"; const char BlackBerrySetupWizardDevicePage::IpAddressField[] = "DevicePage::IpAddress"; const char BlackBerrySetupWizardDevicePage::PasswordField[] = "DevicePage::PasswordField"; const char BlackBerrySetupWizardDevicePage::PhysicalDeviceField[] = "DevicePage::PhysicalDeviceField"; BlackBerrySetupWizardDevicePage::BlackBerrySetupWizardDevicePage(QWidget *parent) : QWizardPage(parent), m_ui(0) { setTitle(tr("Configure BlackBerry Device Connection")); m_ui = new Ui::BlackBerrySetupWizardDevicePage; m_ui->setupUi(this); m_ui->deviceName->setText(tr("BlackBerry Device")); m_ui->ipAddress->setText(QLatin1String("169.254.0.1")); connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->ipAddress, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->password, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->physicalDevice, SIGNAL(toggled(bool)), this, SIGNAL(completeChanged())); registerField(QLatin1String(NameField) + QLatin1Char('*'), m_ui->deviceName); registerField(QLatin1String(IpAddressField) + QLatin1Char('*'), m_ui->ipAddress); registerField(QLatin1String(PasswordField), m_ui->password); registerField(QLatin1String(PhysicalDeviceField), m_ui->physicalDevice); } bool BlackBerrySetupWizardDevicePage::isComplete() const { if (m_ui->deviceName->text().isEmpty() || m_ui->ipAddress->text().isEmpty()) return false; const bool passwordMandatory = m_ui->physicalDevice->isChecked(); if (passwordMandatory && m_ui->password->text().isEmpty()) return false; return true; } //----------------------------------------------------------------------------- BlackBerrySetupWizardFinishPage::BlackBerrySetupWizardFinishPage(QWidget *parent) : QWizardPage(parent), m_ui(0) { setSubTitle(tr("Your environment is ready to be configured.")); m_ui = new Ui::BlackBerrySetupWizardFinishPage; m_ui->setupUi(this); setProgress(QString(), -1); } void BlackBerrySetupWizardFinishPage::setProgress(const QString &status, int progress) { if (progress < 0) { m_ui->progressBar->hide(); m_ui->statusLabel->clear(); return; } else if (!m_ui->progressBar->isVisible()) { m_ui->progressBar->show(); } m_ui->statusLabel->setText(status); m_ui->progressBar->setValue(progress); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorentrypointwidget.ui0000644000015301777760000001351512321547255033475 0ustar pbusernogroup00000000000000 Qnx::Internal::BarDescriptorEditorEntryPointWidget 0 0 611 455 Form Name: Description: 0 0 Icon: 0 0 90 90 QFrame::Panel QFrame::Sunken Clear :/projectexplorer/images/compile_warning.png Splash screens: Add... false Remove 0 0 90 90 QFrame::Panel QFrame::Sunken Qt::Vertical 20 40 :/projectexplorer/images/compile_warning.png Utils::PathChooser QWidget
utils/pathchooser.h
1
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycertificate.h0000644000015301777760000000512212321547255030213 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCERTIFICATE_H #define QNX_INTERNAL_BLACKBERRYCERTIFICATE_H #include #include QT_BEGIN_NAMESPACE class QProcess; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BlackBerryCertificate : public QObject { Q_OBJECT public: enum ResultCode { Success, Busy, WrongPassword, PasswordTooSmall, InvalidOutputFormat, Error }; BlackBerryCertificate(const QString &fileName, const QString &author = QString(), const QString &storePass = QString(), QObject *parent = 0); void load(); void store(); QString fileName() const; QString author() const; QString id() const; signals: void loaded(); void stored(); void finished(int status); private slots: void storeFinished(int status); void loadFinished(); void processError(); private: QString command() const; QString m_fileName; QString m_author; QString m_storePass; QProcess *m_process; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCERTIFICATE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfigurationfactory.h0000644000015301777760000000442012321547255032036 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H #define QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H #include namespace Qnx { namespace Internal { class QnxDeviceConfigurationFactory : public ProjectExplorer::IDeviceFactory { Q_OBJECT public: explicit QnxDeviceConfigurationFactory(QObject *parent = 0); QString displayNameForId(Core::Id type) const; QList availableCreationIds() const; bool canCreate() const; ProjectExplorer::IDevice::Ptr create(Core::Id id) const; bool canRestore(const QVariantMap &map) const; ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const; static Core::Id deviceType(); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatecertificatedialog.cpp0000644000015301777760000001520312321547255033113 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycreatecertificatedialog.h" #include "blackberrycertificate.h" #include "blackberryconfigurationmanager.h" #include "ui_blackberrycreatecertificatedialog.h" #include #include #include #include namespace Qnx { namespace Internal { BlackBerryCreateCertificateDialog::BlackBerryCreateCertificateDialog( QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), m_ui(new Ui_BlackBerryCreateCertificateDialog), m_certificate(0) { m_ui->setupUi(this); m_ui->progressBar->hide(); m_ui->status->clear(); m_cancelButton = m_ui->buttonBox->button(QDialogButtonBox::Cancel); Q_ASSERT(m_cancelButton); m_okButton = m_ui->buttonBox->button(QDialogButtonBox::Ok); m_okButton->setEnabled(false); connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); connect(m_okButton, SIGNAL(clicked()), this, SLOT(createCertificate())); connect(m_ui->author, SIGNAL(textChanged(QString)), this, SLOT(validate())); connect(m_ui->password, SIGNAL(textChanged(QString)), this, SLOT(validate())); connect(m_ui->password2, SIGNAL(textChanged(QString)), this, SLOT(validate())); connect(m_ui->showPassword, SIGNAL(stateChanged(int)), this, SLOT(checkBoxChanged(int))); } QString BlackBerryCreateCertificateDialog::author() const { return m_ui->author->text(); } QString BlackBerryCreateCertificateDialog::certPath() const { return BlackBerryConfigurationManager::instance().defaultKeystorePath(); } QString BlackBerryCreateCertificateDialog::keystorePassword() const { return m_ui->password->text(); } BlackBerryCertificate * BlackBerryCreateCertificateDialog::certificate() const { return m_certificate; } void BlackBerryCreateCertificateDialog::validate() { if (m_ui->author->text().isEmpty() || m_ui->password->text().isEmpty() || m_ui->password2->text().isEmpty()) { m_ui->status->clear(); m_okButton->setEnabled(false); return; } QFileInfo fileInfo(certPath()); if (!fileInfo.dir().exists()) { m_ui->status->setText(tr("Base directory does not exist.")); m_okButton->setEnabled(false); return; } if (m_ui->password->text() != m_ui->password2->text()) { m_ui->status->setText(tr("The entered passwords do not match.")); m_okButton->setEnabled(false); return; } if (m_ui->password->text().size() < 6) { m_ui->status->setText(tr("Password must be at least 6 characters long.")); m_okButton->setEnabled(false); return; } m_ui->status->clear(); m_okButton->setEnabled(true); } void BlackBerryCreateCertificateDialog::createCertificate() { setBusy(true); QFile file(certPath()); if (file.exists()) { const int result = QMessageBox::question(this, tr("Are you sure?"), tr("The file '%1' will be overwritten. Do you want to proceed?") .arg(file.fileName()), QMessageBox::Yes | QMessageBox::No); if (result & QMessageBox::Yes) { file.remove(); } else { setBusy(false); return; } } m_certificate = new BlackBerryCertificate(certPath(), author(), keystorePassword()); connect(m_certificate, SIGNAL(finished(int)), this, SLOT(certificateCreated(int))); m_certificate->store(); } void BlackBerryCreateCertificateDialog::checkBoxChanged(int state) { if (state == Qt::Checked) { m_ui->password->setEchoMode(QLineEdit::Normal); m_ui->password2->setEchoMode(QLineEdit::Normal); } else { m_ui->password->setEchoMode(QLineEdit::Password); m_ui->password2->setEchoMode(QLineEdit::Password); } } void BlackBerryCreateCertificateDialog::certificateCreated(int status) { QString errorMessage; switch (status) { case BlackBerryCertificate::Success: accept(); return; case BlackBerryCertificate::Busy: errorMessage = tr("The blackberry-keytool process is already running."); break; case BlackBerryCertificate::WrongPassword: errorMessage = tr("The password entered is invalid."); break; case BlackBerryCertificate::PasswordTooSmall: errorMessage = tr("The password entered is too short."); break; case BlackBerryCertificate::InvalidOutputFormat: errorMessage = tr("Invalid output format."); break; case BlackBerryCertificate::Error: default: errorMessage = tr("An unknown error occurred."); break; } m_certificate->deleteLater(); m_certificate = 0; QMessageBox::critical(this, tr("Error"), errorMessage); reject(); } void BlackBerryCreateCertificateDialog::setBusy(bool busy) { m_okButton->setEnabled(!busy); m_cancelButton->setEnabled(!busy); m_ui->author->setEnabled(!busy); m_ui->password->setEnabled(!busy); m_ui->password2->setEnabled(!busy); m_ui->showPassword->setEnabled(!busy); m_ui->progressBar->setVisible(busy); if (busy) m_ui->status->setText(tr("Please be patient...")); else m_ui->status->clear(); } } } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryconfigurationmanager.h0000644000015301777760000000634012321547255032136 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYCONFIGURATIONMANAGER_H #define BLACKBERRYCONFIGURATIONMANAGER_H #include #include #include #include namespace Qnx { namespace Internal { class BlackBerryConfiguration; class BlackBerryConfigurationManager : public QObject { Q_OBJECT public: static BlackBerryConfigurationManager &instance(); ~BlackBerryConfigurationManager(); bool addConfiguration(BlackBerryConfiguration *config); void removeConfiguration(BlackBerryConfiguration *config); QList configurations() const; QList manualConfigurations() const; QList activeConfigurations() const; BlackBerryConfiguration *configurationFromEnvFile(const Utils::FileName &envFile) const; QString barsignerCskPath() const; QString idTokenPath() const; QString barsignerDbPath() const; QString defaultKeystorePath() const; QString defaultDebugTokenPath() const; void clearConfigurationSettings(BlackBerryConfiguration *config); QList defaultQnxEnv(); void loadAutoDetectedConfigurations(); public slots: void loadSettings(); void saveSettings(); void checkToolChainConfiguration(); signals: void settingsLoaded(); private: BlackBerryConfigurationManager(QObject *parent = 0); static BlackBerryConfigurationManager *m_instance; QList m_configs; void loadManualConfigurations(); void saveManualConfigurations(); void saveActiveConfigurationNdkEnvPath(); void clearInvalidConfigurations(); QStringList activeConfigurationNdkEnvPaths(); }; } // namespace Internal } // namespace Qnx #endif // BLACKBERRYCONFIGURATIONMANAGER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorgeneralwidget.ui0000644000015301777760000000302512321547255032672 0ustar pbusernogroup00000000000000 Qnx::Internal::BarDescriptorEditorGeneralWidget 0 0 373 112 Form Orientation: Chrome: Transparent main window Application Arguments: ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepconfigwidget.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepconfigwidget.0000644000015301777760000000740312321547255033632 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryCreatePackageStepConfigWidget 0 0 803 135 Form Sign packages 0 Qt::Horizontal QSizePolicy::Fixed 20 20 CSK password: QLineEdit::Password Keystore password: QLineEdit::Password Note: This will store the passwords in a world-readable file. Save passwords Show passwords Qt::Horizontal 40 20 Package in development mode signPackages toggled(bool) signPackagesWidget setEnabled(bool) 40 12 12 62 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenreader.cpp0000644000015301777760000000646412321547255031610 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydebugtokenreader.h" #ifdef QNX_ZIP_FILE_SUPPORT #include #endif using namespace Qnx; using namespace Qnx::Internal; namespace { const char MANIFEST_FILENAME[] = "META-INF/MANIFEST.MF"; const char MANIFEST_AUTHOR_KEY[] = "Package-Author: "; const char MANIFEST_AUTHOR_ID_KEY[] = "Package-Author-Id: "; } BlackBerryDebugTokenReader::BlackBerryDebugTokenReader(const QString &filePath) { #ifdef QNX_ZIP_FILE_SUPPORT m_zipReader = new QZipReader(filePath); #else Q_UNUSED(filePath); Q_UNUSED(m_zipReader); #endif } BlackBerryDebugTokenReader::~BlackBerryDebugTokenReader() { #ifdef QNX_ZIP_FILE_SUPPORT m_zipReader->close(); delete m_zipReader; m_zipReader = 0; #endif } bool BlackBerryDebugTokenReader::isValid() const { #ifdef QNX_ZIP_FILE_SUPPORT return m_zipReader->status() == QZipReader::NoError; #else return false; #endif } QString BlackBerryDebugTokenReader::author() const { return manifestValue(MANIFEST_AUTHOR_KEY); } QString BlackBerryDebugTokenReader::authorId() const { return manifestValue(MANIFEST_AUTHOR_ID_KEY); } bool BlackBerryDebugTokenReader::isSupported() { #ifdef QNX_ZIP_FILE_SUPPORT return true; #else return false; #endif } QString BlackBerryDebugTokenReader::manifestValue(const QByteArray &key) const { if (!isValid()) return QString(); #ifdef QNX_ZIP_FILE_SUPPORT QByteArray manifestContent = m_zipReader->fileData(QLatin1String(MANIFEST_FILENAME)); return value(key, manifestContent); #else Q_UNUSED(key); return QString(); #endif } QString BlackBerryDebugTokenReader::value(const QByteArray &key, const QByteArray &data) const { int valueStart = data.indexOf(key) + key.size(); int valueEnd = data.indexOf(QByteArray("\r\n"), valueStart); return QString::fromAscii(data.mid(valueStart, valueEnd - valueStart)); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryabstractdeploystep.cpp0000644000015301777760000001777312321547255032217 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryabstractdeploystep.h" #include #include #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryAbstractDeployStep::BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, Core::Id id) : ProjectExplorer::BuildStep(bsl, id) , m_processCounter(-1) , m_process(0) , m_timer(0) , m_futureInterface(0) , m_eventLoop(0) { connect(&m_outputParser, SIGNAL(addTask(ProjectExplorer::Task)), this, SIGNAL(addTask(ProjectExplorer::Task))); connect(&m_outputParser, SIGNAL(progressParsed(int)), this, SLOT(reportProgress(int))); } BlackBerryAbstractDeployStep::BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryAbstractDeployStep *bs) : ProjectExplorer::BuildStep(bsl, bs) , m_processCounter(-1) , m_process(0) , m_timer(0) , m_futureInterface(0) , m_eventLoop(0) { connect(&m_outputParser, SIGNAL(addTask(ProjectExplorer::Task)), this, SIGNAL(addTask(ProjectExplorer::Task))); connect(&m_outputParser, SIGNAL(progressParsed(int)), this, SLOT(reportProgress(int))); } BlackBerryAbstractDeployStep::~BlackBerryAbstractDeployStep() { delete m_process; m_process = 0; } bool BlackBerryAbstractDeployStep::init() { m_params.clear(); m_processCounter = -1; m_environment = target()->activeBuildConfiguration()->environment(); m_buildDirectory = target()->activeBuildConfiguration()->buildDirectory().toString(); return true; } void BlackBerryAbstractDeployStep::run(QFutureInterface &fi) { m_timer = new QTimer(); connect(m_timer, SIGNAL(timeout()), this, SLOT(checkForCancel()), Qt::DirectConnection); m_timer->start(500); m_eventLoop = new QEventLoop; fi.setProgressRange(0, 100 * m_params.size()); Q_ASSERT(!m_futureInterface); m_futureInterface = &fi; runCommands(); bool returnValue = m_eventLoop->exec(); // Finished m_params.clear(); m_processCounter = -1; m_timer->stop(); delete m_timer; m_timer = 0; delete m_process; m_process = 0; delete m_eventLoop; m_eventLoop = 0; m_futureInterface = 0; fi.reportResult(returnValue); } void BlackBerryAbstractDeployStep::addCommand(const QString &command, const QStringList &arguments) { ProjectExplorer::ProcessParameters param; param.setCommand(command); param.setArguments(arguments.join(QLatin1String(" "))); m_params << param; } void BlackBerryAbstractDeployStep::reportProgress(int progress) { QTC_ASSERT(progress >= 0 && progress <= 100, return); if (m_futureInterface) m_futureInterface->setProgressValue(100 * m_processCounter + progress); } void BlackBerryAbstractDeployStep::runCommands() { if (!m_process) { m_process = new Utils::QtcProcess(); connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(processReadyReadStdOutput()), Qt::DirectConnection); connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(processReadyReadStdError()), Qt::DirectConnection); } m_process->setEnvironment(m_environment); m_process->setWorkingDirectory(m_buildDirectory); connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(handleProcessFinished(int,QProcess::ExitStatus)), Qt::DirectConnection); runNextCommand(); } void BlackBerryAbstractDeployStep::runNextCommand() { ++m_processCounter; m_futureInterface->setProgressValue(100 * m_processCounter); ProjectExplorer::ProcessParameters param = m_params.takeFirst(); QTC_ASSERT(m_process->state() == QProcess::NotRunning, return); m_process->setCommand(param.effectiveCommand(), param.effectiveArguments()); m_process->start(); if (!m_process->waitForStarted()) { m_eventLoop->exit(false); return; } processStarted(param); } void BlackBerryAbstractDeployStep::processStarted(const ProjectExplorer::ProcessParameters ¶ms) { emitOutputInfo(params, params.prettyArguments()); } void BlackBerryAbstractDeployStep::emitOutputInfo(const ProjectExplorer::ProcessParameters ¶ms, const QString &arguments) { emit addOutput(tr("Starting: \"%1\" %2") .arg(QDir::toNativeSeparators(params.effectiveCommand()), arguments), BuildStep::MessageOutput); } void BlackBerryAbstractDeployStep::raiseError(const QString &errorMessage) { emit addOutput(errorMessage, BuildStep::ErrorMessageOutput); emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT)); } void BlackBerryAbstractDeployStep::processReadyReadStdOutput() { m_process->setReadChannel(QProcess::StandardOutput); while (m_process && m_process->canReadLine()) { const QString line = QString::fromLocal8Bit(m_process->readLine()); stdOutput(line); } } void BlackBerryAbstractDeployStep::stdOutput(const QString &line) { m_outputParser.stdOutput(line); emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline); } void BlackBerryAbstractDeployStep::processReadyReadStdError() { m_process->setReadChannel(QProcess::StandardError); while (m_process && m_process->canReadLine()) { const QString line = QString::fromLocal8Bit(m_process->readLine()); stdError(line); } } void BlackBerryAbstractDeployStep::checkForCancel() { if (m_futureInterface->isCanceled() && m_timer && m_timer->isActive()) { m_timer->stop(); if (m_process) { m_process->terminate(); m_process->waitForFinished(5000); //while waiting, the process can be killed if (m_process) m_process->kill(); } if (m_eventLoop) m_eventLoop->exit(false); } } void BlackBerryAbstractDeployStep::handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { if (exitCode == 0 && exitStatus == QProcess::NormalExit) { if (!m_params.isEmpty()) runNextCommand(); else m_eventLoop->exit(true); } else { m_eventLoop->exit(false); } } void BlackBerryAbstractDeployStep::stdError(const QString &line) { m_outputParser.stdError(line); emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrykeyswidget.ui0000644000015301777760000001340412321547255030300 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryKeysWidget 0 0 959 390 Form BlackBerry Signing Authority 50 false STATUS Qt::RichText true Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse Developer Certificate 0 0 75 true Path: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 PATH 0 0 75 true Author: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 LABEL 50 false No developer certificate has been found. Qt::Horizontal 40 20 Open Certificate Clear Certificate Create Certificate Qt::Vertical 20 207 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxutils.h0000644000015301777760000000567512321547255025574 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXUTILS_H #define QNX_INTERNAL_QNXUTILS_H #include "qnxconstants.h" #include #include #include #include #include namespace Qnx { namespace Internal { class QnxAbstractQtVersion; class NdkInstallInformation { public: QString path; QString name; QString host; QString target; QString version; }; class QnxUtils { public: static QString addQuotes(const QString &string); static Qnx::QnxArchitecture cpudirToArch(const QString &cpuDir); static QStringList searchPaths(QnxAbstractQtVersion *qtVersion); static QList qnxEnvironmentFromNdkFile(const QString &fileName); static bool isValidNdkPath(const QString & ndkPath); static QString envFilePath(const QString & ndkPath, const QString& targetVersion = QString()); static Utils::FileName executableWithExtension(const Utils::FileName &fileName); static QString dataDirPath(); static QString qConfigPath(); static QString defaultTargetVersion(const QString& ndkPath); static QList installedNdks(); static QString sdkInstallerPath(const QString& ndkPath); static QString qdeInstallProcess(const QString& ndkPath, const QString &option, const QString &version = QString()); static QList qnxEnvironment(const QString &ndk); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXUTILS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxrunconfiguration.h0000644000015301777760000000462712321547255030024 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXRUNCONFIGURATION_H #define QNX_INTERNAL_QNXRUNCONFIGURATION_H #include namespace Utils { class Environment; } namespace Qnx { namespace Internal { class QnxRunConfiguration : public RemoteLinux::RemoteLinuxRunConfiguration { Q_OBJECT public: QnxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &projectFilePath); Utils::Environment environment() const; QWidget *createConfigurationWidget(); QVariantMap toMap() const; protected: friend class QnxRunConfigurationFactory; QnxRunConfiguration(ProjectExplorer::Target *parent, QnxRunConfiguration *source); bool fromMap(const QVariantMap &map); private slots: void setQtLibPath(const QString &path); private: QString m_qtLibPath; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXRUNCONFIGURATION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysshkeysgenerator.h0000644000015301777760000000411112321547255031326 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYSSHKEYSGENERATOR_H #define BLACKBERRYSSHKEYSGENERATOR_H #include namespace QSsh { class SshKeyGenerator; } namespace Qnx { namespace Internal { class BlackBerrySshKeysGenerator : public QThread { Q_OBJECT public: BlackBerrySshKeysGenerator(); ~BlackBerrySshKeysGenerator(); signals: void sshKeysGenerationFailed(const QString &error); void sshKeysGenerationFinished(const QByteArray &privateKey, const QByteArray &publicKey); private: QSsh::SshKeyGenerator *m_keyGen; void run(); }; } // namespace Internal } // namespace Qnx #endif // BLACKBERRYSSHKEYSGENERATOR_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryrunconfigurationfactory.h0000644000015301777760000000547612321547255032731 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONFACTORY_H #define QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONFACTORY_H #include namespace Qnx { namespace Internal { class BlackBerryRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory { Q_OBJECT public: explicit BlackBerryRunConfigurationFactory(QObject *parent = 0); QList availableCreationIds(ProjectExplorer::Target *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); private: bool canHandle(ProjectExplorer::Target *t) const; ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, const QVariantMap &map); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfigurationwizard.cpp0000644000015301777760000000647312321547255032234 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeviceconfigurationwizard.h" #include "qnxconstants.h" #include "qnxdeviceconfigurationwizardpages.h" #include "qnxdeviceconfiguration.h" #include #include #include using namespace ProjectExplorer; using namespace Qnx; using namespace Qnx::Internal; QnxDeviceConfigurationWizard::QnxDeviceConfigurationWizard(QWidget *parent) : Utils::Wizard(parent) { setWindowTitle(tr("New QNX Device Configuration Setup")); m_setupPage = new QnxDeviceConfigurationWizardSetupPage(this); m_finalPage = new RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage(this); setPage(SetupPageId, m_setupPage); setPage(FinalPageId, m_finalPage); m_finalPage->setCommitPage(true); } IDevice::Ptr QnxDeviceConfigurationWizard::device() { QSsh::SshConnectionParameters sshParams; sshParams.options = QSsh::SshIgnoreDefaultProxy; sshParams.host = m_setupPage->hostName(); sshParams.userName = m_setupPage->userName(); sshParams.port = 22; sshParams.timeout = 10; sshParams.authenticationType = m_setupPage->authenticationType(); if (sshParams.authenticationType == QSsh::SshConnectionParameters::AuthenticationTypeTryAllPasswordBasedMethods || sshParams.authenticationType == QSsh::SshConnectionParameters::AuthenticationTypePassword) sshParams.password = m_setupPage->password(); else sshParams.privateKeyFile = m_setupPage->privateKeyFilePath(); QnxDeviceConfiguration::Ptr device = QnxDeviceConfiguration::create(m_setupPage->configurationName(), Core::Id(Constants::QNX_QNX_OS_TYPE), IDevice::Hardware); device->setSshParameters(sshParams); device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100"))); return device; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizard.cpp0000644000015301777760000003764312321547255030662 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrysetupwizard.h" #include "blackberrysetupwizardpages.h" #include "blackberrydeviceconfiguration.h" #include "blackberrycertificate.h" #include "blackberryconfigurationmanager.h" #include "blackberrydebugtokenrequester.h" #include "blackberrydebugtokenuploader.h" #include "blackberrydeviceinformation.h" #include "blackberrysigningutils.h" #include "qnxconstants.h" #include #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace Qnx; using namespace Qnx::Internal; BlackBerrySetupWizard::BlackBerrySetupWizard(QWidget *parent) : Utils::Wizard(parent), m_ndkPage(0), m_keysPage(0), m_certificatePage(0), m_devicePage(0), m_certificate(0), m_deviceInfo(0), m_requester(0), m_uploader(0), m_utils(BlackBerrySigningUtils::instance()), m_keyGenerator(0), m_currentStep(-1), m_stepOffset(0) { setWindowTitle(tr("BlackBerry Development Environment Setup Wizard")); setOption(QWizard::IndependentPages, true); m_welcomePage = new BlackBerrySetupWizardWelcomePage(this); m_ndkPage = new BlackBerrySetupWizardNdkPage(this); m_keysPage = new BlackBerrySetupWizardKeysPage(this); m_certificatePage = new BlackBerrySetupWizardCertificatePage(this); m_devicePage = new BlackBerrySetupWizardDevicePage(this); m_finishPage = new BlackBerrySetupWizardFinishPage(this); setPage(WelcomePageId, m_welcomePage); setPage(NdkPageId, m_ndkPage); setPage(KeysPageId, m_keysPage); setPage(CertificatePageId, m_certificatePage); setPage(DevicePageId, m_devicePage); setPage(FinishPageId, m_finishPage); m_deviceInfo = new BlackBerryDeviceInformation(this); m_requester = new BlackBerryDebugTokenRequester(this); m_uploader = new BlackBerryDebugTokenUploader(this); m_keyGenerator = new QSsh::SshKeyGenerator; connect(m_ndkPage, SIGNAL(targetsUpdated()), this, SIGNAL(ndkTargetsUpdated())); connect(m_deviceInfo, SIGNAL(finished(int)), this, SLOT(deviceInfoFinished(int))); connect(m_requester, SIGNAL(finished(int)), this, SLOT(debugTokenArrived(int))); connect(m_uploader, SIGNAL(finished(int)), this, SLOT(uploaderFinished(int))); connect(this, SIGNAL(stepFinished()), this, SLOT(processNextStep())); registerStep("requestDevicePin", tr("Reading device PIN...")); registerStep("generateDeveloperCertificate", tr("Generating developer certificate...")); registerStep("generateSshKeys", tr("Generating SSH keys...")); registerStep("requestDebugToken", tr("Requesting a debug token for the device...")); registerStep("uploadDebugToken", tr("Now uploading the debug token...")); registerStep("writeDeviceInformation", tr("Writing device information...")); } BlackBerrySetupWizard::~BlackBerrySetupWizard() { delete m_keyGenerator; foreach (Step *s, m_stepList) delete s; m_stepList.clear(); } void BlackBerrySetupWizard::accept() { setBusy(true); processNextStep(); } void BlackBerrySetupWizard::processNextStep() { m_currentStep++; if (m_currentStep >= m_stepList.size()) return; const Step *step = m_stepList.at(m_currentStep); m_finishPage->setProgress(step->message, m_currentStep * m_stepOffset); QMetaObject::invokeMethod(this, step->slot); } void BlackBerrySetupWizard::deviceInfoFinished(int status) { const QString errorString = tr("Error reading device PIN. " "Please make sure that the specified device IP address is correct."); if (status != BlackBerryDeviceInformation::Success) { QMessageBox::critical(this, tr("Error"), errorString); reset(); return; } m_devicePin = m_deviceInfo->devicePin(); if (m_devicePin.isEmpty()) { QMessageBox::critical(this, tr("Error"), errorString); reset(); return; } emit stepFinished(); } void BlackBerrySetupWizard::certificateCreated(int status) { if (status == BlackBerryCertificate::Error) { QMessageBox::critical(this, tr("Error"), tr("Error creating developer certificate.")); m_certificate->deleteLater(); m_certificate = 0; reset(); return; } emit stepFinished(); } void BlackBerrySetupWizard::debugTokenArrived(int status) { QString errorString = tr("Failed to request debug token:") + QLatin1Char(' '); switch (status) { case BlackBerryDebugTokenRequester::Success: emit stepFinished(); return; case BlackBerryDebugTokenRequester::WrongCskPassword: m_utils.clearCskPassword(); errorString += tr("Wrong CSK password."); break; case BlackBerryDebugTokenRequester::WrongKeystorePassword: errorString += tr("Wrong keystore password."); break; case BlackBerryDebugTokenRequester::NetworkUnreachable: errorString += tr("Network unreachable."); break; case BlackBerryDebugTokenRequester::IllegalPin: errorString += tr("Illegal device PIN."); break; case BlackBerryDebugTokenRequester::FailedToStartInferiorProcess: errorString += tr("Failed to start inferior process."); break; case BlackBerryDebugTokenRequester::InferiorProcessTimedOut: errorString += tr("Inferior processes timed out."); break; case BlackBerryDebugTokenRequester::InferiorProcessCrashed: errorString += tr("Inferior process has crashed."); break; case BlackBerryDebugTokenRequester::InferiorProcessReadError: case BlackBerryDebugTokenRequester::InferiorProcessWriteError: errorString += tr("Failed to communicate with the inferior process."); break; case BlackBerryDebugTokenRequester::UnknownError: default: m_utils.clearCskPassword(); errorString += tr("An unknwon error has occurred."); break; } QMessageBox::critical(this, tr("Error"), errorString); reset(); } void BlackBerrySetupWizard::uploaderFinished(int status) { QString errorString = tr("Failed to upload debug token:") + QLatin1Char(' '); switch (status) { case BlackBerryDebugTokenUploader::Success: emit stepFinished(); return; case BlackBerryDebugTokenUploader::NoRouteToHost: errorString += tr("No route to host."); break; case BlackBerryDebugTokenUploader::AuthenticationFailed: errorString += tr("Authentication failed."); break; case BlackBerryDebugTokenUploader::DevelopmentModeDisabled: errorString += tr("Development mode is disabled on the device."); break; case BlackBerryDebugTokenUploader::FailedToStartInferiorProcess: errorString += tr("Failed to start inferior process."); break; case BlackBerryDebugTokenUploader::InferiorProcessTimedOut: errorString += tr("Inferior processes timed out."); break; case BlackBerryDebugTokenUploader::InferiorProcessCrashed: errorString += tr("Inferior process has crashed."); break; case BlackBerryDebugTokenUploader::InferiorProcessReadError: case BlackBerryDebugTokenUploader::InferiorProcessWriteError: errorString += tr("Failed to communicate with the inferior process."); break; case BlackBerryDebugTokenUploader::UnknownError: errorString += tr("An unknwon error has happened."); break; } QMessageBox::critical(this, tr("Error"), errorString); reset(); } void BlackBerrySetupWizard::registerStep(const QByteArray &slot, const QString &message) { Step *s = new Step; s->slot = slot; s->message = message; m_stepList << s; m_stepOffset = 100/m_stepList.size(); } void BlackBerrySetupWizard::setBusy(bool busy) { button(QWizard::BackButton)->setEnabled(!busy); button(QWizard::NextButton)->setEnabled(!busy); button(QWizard::FinishButton)->setEnabled(!busy); button(QWizard::CancelButton)->setEnabled(!busy); if (!busy) m_finishPage->setProgress(QString(), -1); } void BlackBerrySetupWizard::cleanupFiles() const { BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); QFile f; f.setFileName(configuration.defaultKeystorePath()); f.remove(); f.setFileName(configuration.defaultDebugTokenPath()); f.remove(); f.setFileName(privateKeyPath()); f.remove(); f.setFileName(publicKeyPath()); f.remove(); QDir::root().rmpath(storeLocation()); } void BlackBerrySetupWizard::reset() { cleanupFiles(); setBusy(false); m_currentStep = -1; if (m_certificate) { m_certificate->deleteLater(); m_certificate = 0; } } void BlackBerrySetupWizard::requestDevicePin() { if (!isPhysicalDevice()) { emit stepFinished(); return; } m_deviceInfo->setDeviceTarget(hostName(), devicePassword()); } void BlackBerrySetupWizard::generateDeveloperCertificate() { BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); m_certificate = new BlackBerryCertificate(configuration.defaultKeystorePath(), certificateAuthor(), certificatePassword()); connect(m_certificate, SIGNAL(finished(int)), this, SLOT(certificateCreated(int))); m_certificate->store(); } void BlackBerrySetupWizard::generateSshKeys() { const bool success = m_keyGenerator->generateKeys(QSsh::SshKeyGenerator::Rsa, QSsh::SshKeyGenerator::Mixed, 4096, QSsh::SshKeyGenerator::DoNotOfferEncryption); if (!success) { QMessageBox::critical(this, tr("Key Generation Failed"), m_keyGenerator->error()); reset(); return; } if (!QDir::root().mkpath(storeLocation())) { QMessageBox::critical(this, tr("Failure to Save Key File"), tr("Failed to create directory: '%1'.").arg(storeLocation())); reset(); return; } if (QFileInfo(privateKeyPath()).exists()) { QMessageBox::critical(this, tr("Failure to Save Key File"), tr("Private key file already exists: '%1'").arg(privateKeyPath())); reset(); return; } if (QFileInfo(publicKeyPath()).exists()) { QMessageBox::critical(this, tr("Failure to Save Key File"), tr("Public key file already exists: '%1'").arg(publicKeyPath())); reset(); return; } Utils::FileSaver privateKeySaver(privateKeyPath()); privateKeySaver.write(m_keyGenerator->privateKey()); if (!privateKeySaver.finalize(this)) { reset(); return; // finalize shows an error message if necessary } QFile::setPermissions(privateKeyPath(), QFile::ReadOwner | QFile::WriteOwner); Utils::FileSaver publicKeySaver(publicKeyPath()); // blackberry-connect requires an @ character to be included in the RSA comment const QString atHost = QLatin1Char('@') + QHostInfo::localHostName(); QByteArray publicKeyContent = m_keyGenerator->publicKey(); publicKeyContent.append(atHost.toLocal8Bit()); publicKeySaver.write(publicKeyContent); if (!publicKeySaver.finalize(this)) { reset(); return; } emit stepFinished(); } void BlackBerrySetupWizard::requestDebugToken() { if (!isPhysicalDevice()) { emit stepFinished(); return; } BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); m_requester->requestDebugToken(configuration.defaultDebugTokenPath(), m_utils.cskPassword(), configuration.defaultKeystorePath(), certificatePassword(), m_devicePin); } void BlackBerrySetupWizard::uploadDebugToken() { if (!isPhysicalDevice()) { emit stepFinished(); return; } BlackBerryConfigurationManager &configuration = BlackBerryConfigurationManager::instance(); m_uploader->uploadDebugToken(configuration.defaultDebugTokenPath(), hostName(), devicePassword()); } void BlackBerrySetupWizard::writeDeviceInformation() { DeviceManager * const deviceManager = DeviceManager::instance(); deviceManager->addDevice(device()); m_utils.setDefaultCertificate(m_certificate); QWizard::accept(); } QString BlackBerrySetupWizard::privateKeyPath() const { return storeLocation() + QLatin1String("/id_rsa"); } QString BlackBerrySetupWizard::publicKeyPath() const { return storeLocation() + QLatin1String("/id_rsa.pub"); } QString BlackBerrySetupWizard::deviceName() const { return field(QLatin1String(BlackBerrySetupWizardDevicePage::NameField)).toString(); } QString BlackBerrySetupWizard::storeLocation() const { return Core::ICore::userResourcePath() + QLatin1String("/qnx/") + deviceName(); } QString BlackBerrySetupWizard::certificatePassword() const { return field(QLatin1String(BlackBerrySetupWizardCertificatePage::PasswordField)).toString(); } QString BlackBerrySetupWizard::certificateAuthor() const { return field(QLatin1String(BlackBerrySetupWizardCertificatePage::AuthorField)).toString(); } QString BlackBerrySetupWizard::hostName() const { return field(QLatin1String(BlackBerrySetupWizardDevicePage::IpAddressField)).toString(); } QString BlackBerrySetupWizard::devicePassword() const { return field(QLatin1String(BlackBerrySetupWizardDevicePage::PasswordField)).toString(); } bool BlackBerrySetupWizard::isPhysicalDevice() const { return field(QLatin1String(BlackBerrySetupWizardDevicePage::PhysicalDeviceField)).toBool(); } IDevice::Ptr BlackBerrySetupWizard::device() { QSsh::SshConnectionParameters sshParams; sshParams.options = QSsh::SshIgnoreDefaultProxy; sshParams.host = hostName(); sshParams.password = devicePassword(); sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey; sshParams.privateKeyFile = privateKeyPath(); sshParams.userName = QLatin1String("devuser"); sshParams.timeout = 10; sshParams.port = 22; IDevice::MachineType machineType = (isPhysicalDevice()) ? IDevice::Hardware : IDevice::Emulator; BlackBerryDeviceConfiguration::Ptr configuration = BlackBerryDeviceConfiguration::create( deviceName(), Core::Id(Constants::QNX_BB_OS_TYPE), machineType); configuration->setSshParameters(sshParams); configuration->setDebugToken(BlackBerryConfigurationManager::instance().defaultDebugTokenPath()); return configuration; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxplugin.h0000644000015301777760000000400612321547255025715 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXPLUGIN_H #define QNX_INTERNAL_QNXPLUGIN_H #include namespace Qnx { namespace Internal { class QNXPlugin : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Qnx.json") public: QNXPlugin(); ~QNXPlugin(); bool initialize(const QStringList &arguments, QString *errorString); void extensionsInitialized(); ShutdownFlag aboutToShutdown(); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXPLUGIN_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryconfigurationmanager.cpp0000644000015301777760000003010412321547255032464 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryconfigurationmanager.h" #include "blackberrycertificate.h" #include "blackberryconfiguration.h" #include "qnxtoolchain.h" #include "qnxutils.h" #include #include #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; namespace Qnx { namespace Internal { namespace { const QLatin1String SettingsGroup("BlackBerryConfiguration"); const QLatin1String NDKLocationKey("NDKLocation"); // For 10.1 NDK support (< QTC 3.0) const QLatin1String NDKEnvFileKey("NDKEnvFile"); const QLatin1String CertificateGroup("Certificates"); const QLatin1String ManualNDKsGroup("ManualNDKs"); const QLatin1String ActiveNDKsGroup("ActiveNDKs"); } BlackBerryConfigurationManager::BlackBerryConfigurationManager(QObject *parent) :QObject(parent) { connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()), this, SLOT(saveSettings())); } void BlackBerryConfigurationManager::loadManualConfigurations() { QSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); settings->beginGroup(ManualNDKsGroup); foreach (const QString &manualNdk, settings->childGroups()) { settings->beginGroup(manualNdk); QString ndkEnvPath = settings->value(NDKEnvFileKey).toString(); // For 10.1 NDK support (< QTC 3.0): // Since QTC 3.0 BBConfigurations are based on the bbndk-env file // to support multiple targets per NDK if (ndkEnvPath.isEmpty()) { QString ndkPath = settings->value(NDKLocationKey).toString(); ndkEnvPath = QnxUtils::envFilePath(ndkPath); } BlackBerryConfiguration *config = new BlackBerryConfiguration(Utils::FileName::fromString(ndkEnvPath), false); if (!addConfiguration(config)) delete config; settings->endGroup(); } settings->endGroup(); settings->endGroup(); } void BlackBerryConfigurationManager::loadAutoDetectedConfigurations() { QStringList activePaths = activeConfigurationNdkEnvPaths(); foreach (const NdkInstallInformation &ndkInfo, QnxUtils::installedNdks()) { QString envFilePath = QnxUtils::envFilePath(ndkInfo.path, ndkInfo.version); BlackBerryConfiguration *config = new BlackBerryConfiguration(Utils::FileName::fromString(envFilePath), true, ndkInfo.name); if (!addConfiguration(config)) { delete config; continue; } // Activate targets foreach (const QString activeNdkEnvPath, activePaths) { if (config->ndkEnvFile().toString() == activeNdkEnvPath) config->activate(); } } // If no target was/is activated, activate one since it's needed by // device connection and CSK code. if (activeConfigurations().isEmpty() && !m_configs.isEmpty()) m_configs.first()->activate(); } QStringList BlackBerryConfigurationManager::activeConfigurationNdkEnvPaths() { QStringList actives; QSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); settings->beginGroup(ActiveNDKsGroup); foreach (const QString &activeNdkEnvPath, settings->childGroups()) { settings->beginGroup(activeNdkEnvPath); actives.append(settings->value(NDKEnvFileKey).toString()); settings->endGroup(); } settings->endGroup(); settings->endGroup(); return actives; } void BlackBerryConfigurationManager::saveManualConfigurations() { if (manualConfigurations().isEmpty()) return; QSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); settings->beginGroup(ManualNDKsGroup); foreach (BlackBerryConfiguration *config, manualConfigurations()) { settings->beginGroup(config->displayName()); settings->setValue(NDKEnvFileKey, config->ndkEnvFile().toString()); settings->endGroup(); } settings->endGroup(); settings->endGroup(); } void BlackBerryConfigurationManager::saveActiveConfigurationNdkEnvPath() { if (activeConfigurations().isEmpty()) return; QSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); settings->beginGroup(ActiveNDKsGroup); settings->remove(QString()); foreach (BlackBerryConfiguration *config, activeConfigurations()) { settings->beginGroup(config->displayName()); settings->setValue(NDKEnvFileKey, config->ndkEnvFile().toString()); settings->endGroup(); } settings->endGroup(); settings->endGroup(); } // Remove no longer available/valid 'auto detected' BlackBerry kits and qt versions void BlackBerryConfigurationManager::clearInvalidConfigurations() { // Deregister invalid auto deteted BlackBerry Kits foreach (Kit *kit, KitManager::kits()) { if (!kit->isAutoDetected()) continue; if (DeviceTypeKitInformation::deviceTypeId(kit) == Constants::QNX_BB_OS_TYPE && !kit->isValid()) KitManager::deregisterKit(kit); } // Remove invalid auto detected BlackBerry qtVerions foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::versions()) { if (!qtVersion->isAutodetected()) continue; if (qtVersion->platformName() == QLatin1String(Constants::QNX_BB_PLATFORM_NAME) && !qtVersion->isValid()) QtSupport::QtVersionManager::removeVersion(qtVersion); } } // Switch to QnxToolchain for exisintg configuration using GccToolChain void BlackBerryConfigurationManager::checkToolChainConfiguration() { foreach (BlackBerryConfiguration *config, m_configs) { foreach (ToolChain *tc, ToolChainManager::toolChains()) { if (tc->compilerCommand() == config->gccCompiler() && !tc->id().startsWith(QLatin1String(Constants::QNX_TOOLCHAIN_ID))) { if (config->isActive()) { // reset config->deactivate(); config->activate(); break; } } } } } bool BlackBerryConfigurationManager::addConfiguration(BlackBerryConfiguration *config) { foreach (BlackBerryConfiguration *c, m_configs) { if (c->ndkPath() == config->ndkPath() && c->targetName() == config->targetName()) { if (!config->isAutoDetected()) QMessageBox::warning(0, tr("NDK Already Known"), tr("The NDK already has a configuration."), QMessageBox::Ok); return false; } } if (config->isValid()) { m_configs.append(config); return true; } return false; } void BlackBerryConfigurationManager::removeConfiguration(BlackBerryConfiguration *config) { if (!config) return; if (config->isActive()) config->deactivate(); clearConfigurationSettings(config); m_configs.removeAt(m_configs.indexOf(config)); delete config; } QList BlackBerryConfigurationManager::configurations() const { return m_configs; } QList BlackBerryConfigurationManager::manualConfigurations() const { QList manuals; foreach (BlackBerryConfiguration *config, m_configs) { if (!config->isAutoDetected()) manuals << config; } return manuals; } QList BlackBerryConfigurationManager::activeConfigurations() const { QList actives; foreach (BlackBerryConfiguration *config, m_configs) { if (config->isActive()) actives << config; } return actives; } BlackBerryConfiguration *BlackBerryConfigurationManager::configurationFromEnvFile(const Utils::FileName &envFile) const { foreach (BlackBerryConfiguration *config, m_configs) { if (config->ndkEnvFile() == envFile) return config; } return 0; } // Returns a valid qnxEnv from a valid configuration; // Needed by other classes to get blackberry process path (keys registration, debug token...) QList BlackBerryConfigurationManager::defaultQnxEnv() { foreach (BlackBerryConfiguration *config, m_configs) { if (config->isActive() && config->qnxEnv().size()) return config->qnxEnv(); } return QList(); } void BlackBerryConfigurationManager::loadSettings() { clearInvalidConfigurations(); loadAutoDetectedConfigurations(); loadManualConfigurations(); checkToolChainConfiguration(); emit settingsLoaded(); } void BlackBerryConfigurationManager::clearConfigurationSettings(BlackBerryConfiguration *config) { if (!config) return; QSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); settings->beginGroup(ManualNDKsGroup); foreach (const QString &manualNdk, settings->childGroups()) { if (manualNdk == config->displayName()) { settings->remove(manualNdk); break; } } settings->endGroup(); settings->endGroup(); } void BlackBerryConfigurationManager::saveSettings() { saveActiveConfigurationNdkEnvPath(); saveManualConfigurations(); } BlackBerryConfigurationManager &BlackBerryConfigurationManager::instance() { if (m_instance == 0) m_instance = new BlackBerryConfigurationManager(); return *m_instance; } BlackBerryConfigurationManager::~BlackBerryConfigurationManager() { qDeleteAll(m_configs); } QString BlackBerryConfigurationManager::barsignerCskPath() const { return QnxUtils::dataDirPath() + QLatin1String("/barsigner.csk"); } QString BlackBerryConfigurationManager::idTokenPath() const { return QnxUtils::dataDirPath() + QLatin1String("/bbidtoken.csk"); } QString BlackBerryConfigurationManager::barsignerDbPath() const { return QnxUtils::dataDirPath() + QLatin1String("/barsigner.db"); } QString BlackBerryConfigurationManager::defaultKeystorePath() const { return QnxUtils::dataDirPath() + QLatin1String("/author.p12"); } QString BlackBerryConfigurationManager::defaultDebugTokenPath() const { return QnxUtils::dataDirPath() + QLatin1String("/debugtoken.bar"); } BlackBerryConfigurationManager* BlackBerryConfigurationManager::m_instance = 0; } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysigningpasswordsdialog.cpp0000644000015301777760000000454312321547255033056 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrysigningpasswordsdialog.h" #include "ui_blackberrysigningpasswordsdialog.h" using namespace Qnx; using namespace Qnx::Internal; BlackBerrySigningPasswordsDialog::BlackBerrySigningPasswordsDialog(QWidget *parent) : QDialog(parent), m_ui(new Ui::BlackBerrySigningPasswordsDialog) { m_ui->setupUi(this); } BlackBerrySigningPasswordsDialog::~BlackBerrySigningPasswordsDialog() { delete m_ui; } void BlackBerrySigningPasswordsDialog::setCskPassword(const QString &cskPassword) { m_ui->cskPassword->setText(cskPassword); } void BlackBerrySigningPasswordsDialog::setStorePassword(const QString &storePassword) { m_ui->storePassword->setText(storePassword); } QString BlackBerrySigningPasswordsDialog::cskPassword() const { return m_ui->cskPassword->text(); } QString BlackBerrySigningPasswordsDialog::storePassword() const { return m_ui->storePassword->text(); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeploystepfactory.h0000644000015301777760000000535212321547255031516 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEPLOYSTEPFACTORY_H #define QNX_INTERNAL_BLACKBERRYDEPLOYSTEPFACTORY_H #include namespace Qnx { namespace Internal { class BlackBerryDeployStepFactory : public ProjectExplorer::IBuildStepFactory { Q_OBJECT public: BlackBerryDeployStepFactory(); QList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEPLOYSTEPFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryapplicationrunner.cpp0000644000015301777760000002732012321547255032025 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryapplicationrunner.h" #include "blackberrydeployconfiguration.h" #include "blackberrydeviceconnectionmanager.h" #include "blackberryrunconfiguration.h" #include "blackberrylogprocessrunner.h" #include "qnxconstants.h" #include #include #include #include #include #include namespace { bool parseRunningState(const QString &line) { QTC_ASSERT(line.startsWith(QLatin1String("result::")), return false); return line.trimmed().mid(8) == QLatin1String("true"); } } using namespace ProjectExplorer; using namespace Qnx; using namespace Qnx::Internal; BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool debugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent) : QObject(parent) , m_debugMode(debugMode) , m_pid(-1) , m_appId(QString()) , m_running(false) , m_stopping(false) , m_launchProcess(0) , m_stopProcess(0) , m_logProcessRunner(0) , m_runningStateTimer(new QTimer(this)) , m_runningStateProcess(0) { QTC_ASSERT(runConfiguration, return); Target *target = runConfiguration->target(); BuildConfiguration *buildConfig = target->activeBuildConfiguration(); m_environment = buildConfig->environment(); m_deployCmd = m_environment.searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD)); m_device = BlackBerryDeviceConfiguration::device(target->kit()); m_barPackage = runConfiguration->barPackage(); // The BlackBerry device always uses key authentication m_sshParams = m_device->sshParameters(); m_sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey; m_runningStateTimer->setInterval(3000); m_runningStateTimer->setSingleShot(true); connect(m_runningStateTimer, SIGNAL(timeout()), this, SLOT(determineRunningState())); connect(this, SIGNAL(started()), this, SLOT(startLogProcessRunner())); connect(&m_launchStopProcessParser, SIGNAL(pidParsed(qint64)), this, SLOT(setPid(qint64))); connect(&m_launchStopProcessParser, SIGNAL(applicationIdParsed(QString)), this, SLOT(setApplicationId(QString))); } void BlackBerryApplicationRunner::start() { if (!BlackBerryDeviceConnectionManager::instance()->isConnected(m_device->id())) { connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceConnected()), this, SLOT(launchApplication())); connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceDisconnected(Core::Id)), this, SLOT(disconnectFromDeviceSignals(Core::Id))); connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(connectionOutput(Core::Id,QString)), this, SLOT(displayConnectionOutput(Core::Id,QString))); BlackBerryDeviceConnectionManager::instance()->connectDevice(m_device->id()); } else { launchApplication(); } } void BlackBerryApplicationRunner::startLogProcessRunner() { if (!m_logProcessRunner) { m_logProcessRunner = new BlackBerryLogProcessRunner(this, m_appId, m_device); connect(m_logProcessRunner, SIGNAL(output(QString,Utils::OutputFormat)), this, SIGNAL(output(QString,Utils::OutputFormat))); connect(m_logProcessRunner, SIGNAL(finished()), this, SIGNAL(finished())); } m_logProcessRunner->start(); } void BlackBerryApplicationRunner::displayConnectionOutput(Core::Id deviceId, const QString &msg) { if (deviceId != m_device->id()) return; if (msg.contains(QLatin1String("Info:"))) emit output(msg, Utils::StdOutFormat); else if (msg.contains(QLatin1String("Error:"))) emit output(msg, Utils::StdErrFormat); } void BlackBerryApplicationRunner::startFinished(int exitCode, QProcess::ExitStatus exitStatus) { if (exitCode == 0 && exitStatus == QProcess::NormalExit && m_pid > -1) { emit started(); } else { m_running = false; m_runningStateTimer->stop(); QTC_ASSERT(m_launchProcess, return); const QString errorString = (m_launchProcess->error() != QProcess::UnknownError) ? m_launchProcess->errorString() : tr("Launching application failed"); emit startFailed(errorString); reset(); } } ProjectExplorer::RunControl::StopResult BlackBerryApplicationRunner::stop() { if (m_stopping) return ProjectExplorer::RunControl::AsynchronousStop; m_stopping = true; QStringList args; args << QLatin1String("-terminateApp"); args << QLatin1String("-device") << m_sshParams.host; if (!m_sshParams.password.isEmpty()) args << QLatin1String("-password") << m_sshParams.password; args << m_barPackage; if (!m_stopProcess) { m_stopProcess = new QProcess(this); connect(m_stopProcess, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError())); connect(m_stopProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput())); connect(m_stopProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(stopFinished(int,QProcess::ExitStatus))); m_stopProcess->setEnvironment(m_environment.toStringList()); } m_stopProcess->start(m_deployCmd, args); return ProjectExplorer::RunControl::AsynchronousStop; } bool BlackBerryApplicationRunner::isRunning() const { return m_running; } qint64 BlackBerryApplicationRunner::pid() const { return m_pid; } void BlackBerryApplicationRunner::stopFinished(int exitCode, QProcess::ExitStatus exitStatus) { Q_UNUSED(exitCode); Q_UNUSED(exitStatus); reset(); } void BlackBerryApplicationRunner::readStandardOutput() { QProcess *process = qobject_cast(sender()); process->setReadChannel(QProcess::StandardOutput); while (process->canReadLine()) { QString line = QString::fromLocal8Bit(process->readLine()); m_launchStopProcessParser.stdOutput(line); emit output(line, Utils::StdOutFormat); } } void BlackBerryApplicationRunner::readStandardError() { QProcess *process = qobject_cast(sender()); process->setReadChannel(QProcess::StandardError); while (process->canReadLine()) { const QString line = QString::fromLocal8Bit(process->readLine()); m_launchStopProcessParser.stdError(line); emit output(line, Utils::StdErrFormat); } } void BlackBerryApplicationRunner::disconnectFromDeviceSignals(Core::Id deviceId) { if (m_device->id() == deviceId) { disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceConnected()), this, SLOT(launchApplication())); disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceDisconnected(Core::Id)), this, SLOT(disconnectFromDeviceSignals(Core::Id))); disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(connectionOutput(Core::Id,QString)), this, SLOT(displayConnectionOutput(Core::Id,QString))); } } void BlackBerryApplicationRunner::setPid(qint64 pid) { m_pid = pid; } void BlackBerryApplicationRunner::setApplicationId(const QString &applicationId) { m_appId = applicationId; } void BlackBerryApplicationRunner::launchApplication() { // If original device connection fails before launching, this method maybe triggered // if any other device is connected(?) if (!BlackBerryDeviceConnectionManager::instance()->isConnected(m_device->id())) return; QStringList args; args << QLatin1String("-launchApp"); if (m_debugMode) args << QLatin1String("-debugNative"); args << QLatin1String("-device") << m_sshParams.host; if (!m_sshParams.password.isEmpty()) args << QLatin1String("-password") << m_sshParams.password; args << QDir::toNativeSeparators(m_barPackage); if (!m_launchProcess) { m_launchProcess = new QProcess(this); connect(m_launchProcess, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError())); connect(m_launchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput())); connect(m_launchProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(startFinished(int,QProcess::ExitStatus))); m_launchProcess->setEnvironment(m_environment.toStringList()); } m_launchProcess->start(m_deployCmd, args); m_runningStateTimer->start(); m_running = true; } void BlackBerryApplicationRunner::startRunningStateTimer() { if (m_running) m_runningStateTimer->start(); } void BlackBerryApplicationRunner::determineRunningState() { QStringList args; args << QLatin1String("-isAppRunning"); args << QLatin1String("-device") << m_sshParams.host; if (!m_sshParams.password.isEmpty()) args << QLatin1String("-password") << m_sshParams.password; args << m_barPackage; if (!m_runningStateProcess) { m_runningStateProcess = new QProcess(this); connect(m_runningStateProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readRunningStateStandardOutput())); connect(m_runningStateProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(startRunningStateTimer())); } m_runningStateProcess->setEnvironment(m_environment.toStringList()); m_runningStateProcess->start(m_deployCmd, args); } void BlackBerryApplicationRunner::readRunningStateStandardOutput() { QProcess *process = qobject_cast(sender()); process->setReadChannel(QProcess::StandardOutput); while (process->canReadLine()) { const QString line = QString::fromLocal8Bit(process->readLine()); if (line.startsWith(QLatin1String("result"))) { m_running = parseRunningState(line); break; } } if (!m_running) reset(); } void BlackBerryApplicationRunner::reset() { m_pid = -1; m_appId.clear(); m_running = false; m_stopping = false; m_runningStateTimer->stop(); if (m_runningStateProcess) { m_runningStateProcess->terminate(); if (!m_runningStateProcess->waitForFinished(1000)) m_runningStateProcess->kill(); } if (m_logProcessRunner) { m_logProcessRunner->stop(); delete m_logProcessRunner; m_logProcessRunner = 0; } else { emit finished(); } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysetupwizardkeyspage.ui0000644000015301777760000002173612321547255032242 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerrySetupWizardKeysPage 0 0 503 222 WizardPage Qt::Vertical 20 63 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 true QFrame::StyledPanel <html><head/><body><p><span style=" font-weight:600;">Legacy keys detected</span></p><p>It appears you are using legacy key files. Please visit <a href="https://developer.blackberry.com/native/documentation/core/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/bbid_to_sa.html"><span style=" text-decoration: underline; color:#004f69;">this page</span></a> to upgrade your keys.</p></body></html> Qt::RichText Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop false false Qt::TextBrowserInteraction 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 true QFrame::StyledPanel <html><head/><body><p><span style=" font-weight:600;">Obtaining keys</span></p><p>You will need to order your signing keys from BlackBerry, by <a href="https://www.blackberry.com/SignedKeys/codesigning.html"><span style=" text-decoration: underline; color:#004f69;">visiting this page.</span></a></p></body></html> Qt::RichText Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop false false Qt::TextBrowserInteraction 0 0 75 true Your BlackBerry signing keys have already been installed. Qt::AlignCenter false Qt::Vertical 20 62 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugsupport.cpp0000644000015301777760000000674112321547255031017 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydebugsupport.h" #include "blackberryapplicationrunner.h" #include #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryDebugSupport::BlackBerryDebugSupport(BlackBerryRunConfiguration *runConfig, Debugger::DebuggerRunControl *runControl) : QObject(runControl->engine()) , m_engine(runControl->engine()) { m_runner = new BlackBerryApplicationRunner(true, runConfig, this); connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(launchRemoteApplication())); connect(m_engine, SIGNAL(stateChanged(Debugger::DebuggerState)), this, SLOT(handleDebuggerStateChanged(Debugger::DebuggerState))); connect(m_runner, SIGNAL(started()), this, SLOT(handleStarted())); connect(m_runner, SIGNAL(startFailed(QString)), this, SLOT(handleStartFailed(QString))); connect(m_runner, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(handleApplicationOutput(QString,Utils::OutputFormat))); connect(this, SIGNAL(output(QString,Utils::OutputFormat)), runControl, SLOT(appendMessage(QString,Utils::OutputFormat))); } void BlackBerryDebugSupport::launchRemoteApplication() { m_runner->start(); } void BlackBerryDebugSupport::handleStarted() { m_engine->startParameters().attachPID = m_runner->pid(); m_engine->notifyEngineRemoteSetupDone(8000, -1); } void BlackBerryDebugSupport::handleStartFailed(const QString &message) { m_engine->notifyEngineRemoteSetupFailed(message); } void BlackBerryDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state) { if (state == Debugger::EngineShutdownOk || state == Debugger::DebuggerFinished) { if (m_runner->isRunning()) m_runner->stop(); } } void BlackBerryDebugSupport::handleApplicationOutput(const QString &msg, Utils::OutputFormat format) { Q_UNUSED(format) m_engine->showMessage(msg, Debugger::AppOutput); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenuploader.cpp0000644000015301777760000000544712321547255032161 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydebugtokenuploader.h" #include "qnxconstants.h" namespace { static const char ERR_NO_ROUTE_HOST[] = "Cannot connect"; static const char ERR_AUTH_FAILED[] = "Authentication failed"; static const char ERR_DEVELOPMENT_MODE_DISABLED[] = "Device is not in the Development Mode"; static const char ERR_FILE_NOT_EXIST[] = "File does not exist"; } namespace Qnx { namespace Internal { BlackBerryDebugTokenUploader::BlackBerryDebugTokenUploader(QObject *parent) : BlackBerryNdkProcess(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD), parent) { addErrorStringMapping(QLatin1String(ERR_NO_ROUTE_HOST), NoRouteToHost); addErrorStringMapping(QLatin1String(ERR_AUTH_FAILED), AuthenticationFailed); addErrorStringMapping(QLatin1String(ERR_DEVELOPMENT_MODE_DISABLED), DevelopmentModeDisabled); addErrorStringMapping(QLatin1String(ERR_FILE_NOT_EXIST), InvalidDebugTokenPath); } void BlackBerryDebugTokenUploader::uploadDebugToken(const QString &path, const QString &deviceIp, const QString &devicePassword) { QStringList arguments; arguments << QLatin1String("-installDebugToken") << path << QLatin1String("-device") << deviceIp << QLatin1String("-password") << devicePassword; start(arguments); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryrunconfigurationwidget.ui0000644000015301777760000000171212321547255032720 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryRunConfigurationWidget 0 0 374 53 Device: Package: qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationfactory.h0000644000015301777760000000446312321547255033357 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONFACTORY_H #define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONFACTORY_H #include namespace Qnx { namespace Internal { class BlackBerryDeviceConfigurationFactory : public ProjectExplorer::IDeviceFactory { Q_OBJECT public: explicit BlackBerryDeviceConfigurationFactory(QObject *parent = 0); QString displayNameForId(Core::Id type) const; QList availableCreationIds() const; bool canCreate() const; ProjectExplorer::IDevice::Ptr create(Core::Id id) const; bool canRestore(const QVariantMap &map) const; ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const; static Core::Id deviceType(); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryinstallwizardndkpage.ui0000644000015301777760000000140012321547255032333 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryInstallWizardNdkPage 0 0 400 300 Form Select Native SDK path: qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxrunconfigurationfactory.h0000644000015301777760000000543312321547255031410 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H #define QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H #include namespace Qnx { namespace Internal { class QnxRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory { Q_OBJECT public: explicit QnxRunConfigurationFactory(QObject *parent = 0); QList availableCreationIds(ProjectExplorer::Target *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); private: bool canHandle(ProjectExplorer::Target *t) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, const QVariantMap &map); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfigurationwizardpages.cpp0000644000015301777760000000357012321547255033247 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeviceconfigurationwizardpages.h" namespace Qnx { namespace Internal { QnxDeviceConfigurationWizardSetupPage::QnxDeviceConfigurationWizardSetupPage(QWidget *parent) : RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage(parent) { } QString QnxDeviceConfigurationWizardSetupPage::defaultConfigurationName() const { return tr("QNX Device"); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydebugtokenrequester.cpp0000644000015301777760000000670712321547255032365 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrydebugtokenrequester.h" namespace { static const char PROCESS_NAME[] = "blackberry-debugtokenrequest"; static const char ERR_WRONG_CSK_PASS[] = "The signature on the code signing request didn't verify."; static const char ERR_WRONG_CSK_PASS_10_2[] = "The specified CSK password is not valid."; static const char ERR_WRONG_KEYSTORE_PASS[] = "Failed to decrypt keystore, invalid password"; static const char ERR_WRONG_KEYSTORE_PASS_10_2[] = "Failed to decrypt keystore, invalid store password or store password not supplied."; static const char ERR_NETWORK_UNREACHABLE[] = "Network is unreachable"; static const char ERR_NOT_YET_REGISTGERED[] = "Not yet registered to request debug tokens"; } namespace Qnx { namespace Internal { BlackBerryDebugTokenRequester::BlackBerryDebugTokenRequester(QObject *parent) : BlackBerryNdkProcess(QLatin1String(PROCESS_NAME), parent) { addErrorStringMapping(QLatin1String(ERR_WRONG_CSK_PASS), WrongCskPassword); addErrorStringMapping(QLatin1String(ERR_WRONG_CSK_PASS_10_2), WrongCskPassword); addErrorStringMapping(QLatin1String(ERR_WRONG_KEYSTORE_PASS), WrongKeystorePassword); addErrorStringMapping(QLatin1String(ERR_WRONG_KEYSTORE_PASS_10_2), WrongKeystorePassword); addErrorStringMapping(QLatin1String(ERR_NETWORK_UNREACHABLE), NetworkUnreachable); addErrorStringMapping(QLatin1String(ERR_NOT_YET_REGISTGERED), NotYetRegistered); } void BlackBerryDebugTokenRequester::requestDebugToken(const QString &path, const QString &cskPassword, const QString &keyStore, const QString &keyStorePassword, const QString &devicePin) { QStringList arguments; arguments << QLatin1String("-keystore") << keyStore << QLatin1String("-storepass") << keyStorePassword << QLatin1String("-cskpass") << cskPassword << QLatin1String("-devicepin") << devicePin << path; start(arguments); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/slog2inforunner.cpp0000644000015301777760000001513512321547255027364 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "slog2inforunner.h" #include #include using namespace Qnx; using namespace Qnx::Internal; Slog2InfoRunner::Slog2InfoRunner(const QString &applicationId, const RemoteLinux::LinuxDevice::ConstPtr &device, QObject *parent) : QObject(parent) , m_applicationId(applicationId) , m_found(false) , m_currentLogs(false) { // See QTCREATORBUG-10712 for details. // We need to limit length of ApplicationId to 63 otherwise it would not match one in slog2info. m_applicationId.truncate(63); m_testProcess = new ProjectExplorer::SshDeviceProcess(device, this); connect(m_testProcess, SIGNAL(finished()), this, SLOT(handleTestProcessCompleted())); m_launchDateTimeProcess = new ProjectExplorer::SshDeviceProcess(device, this); connect(m_launchDateTimeProcess, SIGNAL(finished()), this, SLOT(launchSlog2Info())); m_logProcess = new ProjectExplorer::SshDeviceProcess(device, this); connect(m_logProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readLogStandardOutput())); connect(m_logProcess, SIGNAL(readyReadStandardError()), this, SLOT(readLogStandardError())); connect(m_logProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(handleLogError())); connect(m_logProcess, SIGNAL(started()), this, SIGNAL(started())); connect(m_logProcess, SIGNAL(finished()), this, SIGNAL(finished())); } void Slog2InfoRunner::start() { m_testProcess->start(QLatin1String("slog2info"), QStringList()); } void Slog2InfoRunner::stop() { if (m_testProcess->state() == QProcess::Running) m_testProcess->kill(); if (m_logProcess->state() == QProcess::Running) { m_logProcess->kill(); processLog(true); } } bool Slog2InfoRunner::commandFound() const { return m_found; } void Slog2InfoRunner::handleTestProcessCompleted() { m_found = (m_testProcess->exitCode() == 0); if (m_found) readLaunchTime(); else emit commandMissing(); } void Slog2InfoRunner::readLaunchTime() { QStringList arguments; arguments << QLatin1String("+\"%d %H:%M:%S\""); m_launchDateTimeProcess->start(QLatin1String("date"), arguments); } void Slog2InfoRunner::launchSlog2Info() { QTC_CHECK(!m_applicationId.isEmpty()); QTC_CHECK(m_found); if (m_logProcess && m_logProcess->state() == QProcess::Running) return; m_launchDateTime = QDateTime::fromString(QString::fromLatin1(m_launchDateTimeProcess->readAllStandardOutput()).trimmed(), QString::fromLatin1("dd HH:mm:ss")); QStringList arguments; arguments << QLatin1String("-w"); m_logProcess->start(QLatin1String("slog2info"), arguments); } void Slog2InfoRunner::readLogStandardOutput() { processLog(false); } void Slog2InfoRunner::processLog(bool force) { QString input = QString::fromLatin1(m_logProcess->readAllStandardOutput()); QStringList lines = input.split(QLatin1Char('\n')); if (lines.isEmpty()) return; lines.first().prepend(m_remainingData); if (force) m_remainingData.clear(); else m_remainingData = lines.takeLast(); foreach (const QString &line, lines) processLogLine(line); } void Slog2InfoRunner::processLogLine(const QString &line) { // The "(\\s+\\S+)?" represents a named buffer. If message has noname (aka empty) buffer // then the message might get cut for the first number in the message. // The "\\s+(\\b.*)?$" represents a space followed by a message. We are unable to determinate // how many spaces represent separators and how many are a part of the messages, so resulting // messages has all whitespaces at the beginning of the message trimmed. static QRegExp regexp(QLatin1String( "^[a-zA-Z]+\\s+([0-9]+ [0-9]+:[0-9]+:[0-9]+.[0-9]+)\\s+(\\S+)(\\s+(\\S+))?\\s+([0-9]+)\\s+(\\b.*)?$")); if (!regexp.exactMatch(line) || regexp.captureCount() != 6) return; // Note: This is useless if/once slog2info -b displays only logs from recent launches if (!m_launchDateTime.isNull()) { // Check if logs are from the recent launch if (!m_currentLogs) { QDateTime dateTime = QDateTime::fromString(regexp.cap(1), QLatin1String("dd HH:mm:ss.zzz")); m_currentLogs = dateTime >= m_launchDateTime; if (!m_currentLogs) return; } } QString applicationId = regexp.cap(2); if (!applicationId.startsWith(m_applicationId)) return; QString bufferName = regexp.cap(4); int bufferId = regexp.cap(5).toInt(); // filtering out standard BB10 messages if (bufferName == QLatin1String("default") && bufferId == 8900) return; emit output(regexp.cap(6) + QLatin1Char('\n'), Utils::StdOutFormat); } void Slog2InfoRunner::readLogStandardError() { const QString message = QString::fromLatin1(m_logProcess->readAllStandardError()); emit output(message, Utils::StdErrFormat); } void Slog2InfoRunner::handleLogError() { emit output(tr("Cannot show slog2info output. Error: %1").arg(m_logProcess->errorString()), Utils::StdErrFormat); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxbaseqtconfigwidget.h0000644000015301777760000000416312321547255030274 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H #define QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H #include namespace Qnx { namespace Internal { namespace Ui { class QnxBaseQtConfigWidget; } class QnxAbstractQtVersion; class QnxBaseQtConfigWidget : public QtSupport::QtConfigWidget { Q_OBJECT public: explicit QnxBaseQtConfigWidget(QnxAbstractQtVersion *version); ~QnxBaseQtConfigWidget(); private slots: void updateSdkPath(const QString &path); private: QnxAbstractQtVersion *m_version; Ui::QnxBaseQtConfigWidget *m_ui; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/slog2inforunner.h0000644000015301777760000000553012321547255027027 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_SLOG2INFORUNNER_H #define QNX_INTERNAL_SLOG2INFORUNNER_H #include #include #include #include #include namespace ProjectExplorer { class SshDeviceProcess; } namespace Qnx { namespace Internal { class Slog2InfoRunner : public QObject { Q_OBJECT public: explicit Slog2InfoRunner(const QString &applicationId, const RemoteLinux::LinuxDevice::ConstPtr &device, QObject *parent = 0); void stop(); bool commandFound() const; public slots: void start(); signals: void commandMissing(); void started(); void finished(); void output(const QString &msg, Utils::OutputFormat format); private slots: void handleTestProcessCompleted(); void launchSlog2Info(); void readLogStandardOutput(); void readLogStandardError(); void handleLogError(); private: void readLaunchTime(); void processLog(bool force); void processLogLine(const QString &line); QString m_applicationId; bool m_found; QDateTime m_launchDateTime; bool m_currentLogs; QString m_remainingData; ProjectExplorer::SshDeviceProcess *m_launchDateTimeProcess; ProjectExplorer::SshDeviceProcess *m_testProcess; ProjectExplorer::SshDeviceProcess *m_logProcess; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_SLOG2INFORUNNER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorpermissionswidget.h0000644000015301777760000000451212321547255033444 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORPERMISSIONSWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORPERMISSIONSWIDGET_H #include "bardescriptoreditorabstractpanelwidget.h" namespace Qnx { namespace Internal { class BarDescriptorPermissionsModel; namespace Ui { class BarDescriptorEditorPermissionsWidget; } class BarDescriptorEditorPermissionsWidget : public BarDescriptorEditorAbstractPanelWidget { Q_OBJECT public: explicit BarDescriptorEditorPermissionsWidget(QWidget *parent = 0); ~BarDescriptorEditorPermissionsWidget(); void clear(); QStringList checkedPermissions() const; void checkPermission(const QString &identifier); private: Ui::BarDescriptorEditorPermissionsWidget *m_ui; BarDescriptorPermissionsModel *m_permissionsModel; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORPERMISSIONSWIDGET_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxabstractrunsupport.cpp0000644000015301777760000001004012321547255030732 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxabstractrunsupport.h" #include "qnxrunconfiguration.h" #include #include #include #include #include #include using namespace ProjectExplorer; using namespace RemoteLinux; using namespace Qnx; using namespace Qnx::Internal; QnxAbstractRunSupport::QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QObject *parent) : QObject(parent) , m_remoteExecutable(runConfig->remoteExecutableFilePath()) , m_device(DeviceKitInformation::device(runConfig->target()->kit())) , m_state(Inactive) , m_environment(runConfig->environment()) , m_workingDir(runConfig->workingDirectory()) { m_runner = new DeviceApplicationRunner(this); m_portsGatherer = new DeviceUsedPortsGatherer(this); connect(m_portsGatherer, SIGNAL(error(QString)), SLOT(handleError(QString))); connect(m_portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady())); } void QnxAbstractRunSupport::handleAdapterSetupRequested() { QTC_ASSERT(m_state == Inactive, return); m_state = GatheringPorts; m_portsGatherer->start(m_device); } void QnxAbstractRunSupport::handlePortListReady() { QTC_ASSERT(m_state == GatheringPorts, return); m_portList = m_device->freePorts(); startExecution(); } void QnxAbstractRunSupport::handleRemoteProcessStarted() { m_state = Running; } void QnxAbstractRunSupport::handleRemoteProcessFinished(bool) { } void QnxAbstractRunSupport::setFinished() { if (m_state != GatheringPorts && m_state != Inactive) m_runner->stop(); m_state = Inactive; } QnxAbstractRunSupport::State QnxAbstractRunSupport::state() const { return m_state; } void QnxAbstractRunSupport::setState(QnxAbstractRunSupport::State state) { m_state = state; } DeviceApplicationRunner *QnxAbstractRunSupport::appRunner() const { return m_runner; } const IDevice::ConstPtr QnxAbstractRunSupport::device() const { return m_device; } void QnxAbstractRunSupport::handleProgressReport(const QString &) { } void QnxAbstractRunSupport::handleRemoteOutput(const QByteArray &) { } void QnxAbstractRunSupport::handleError(const QString &) { } bool QnxAbstractRunSupport::setPort(int &port) { port = m_portsGatherer->getNextFreePort(&m_portList); if (port == -1) { handleError(tr("Not enough free ports on device for debugging.")); return false; } return true; } QString QnxAbstractRunSupport::executable() const { return m_remoteExecutable; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnx.qbs0000644000015301777760000002460112321547255025037 0ustar pbusernogroup00000000000000import qbs.base 1.0 import QtcPlugin QtcPlugin { name: "Qnx" provider: "BlackBerry" Depends { name: "Core" } Depends { name: "Debugger" } Depends { name: "ProjectExplorer" } Depends { name: "QmlDebug" } Depends { name: "QtSupport" } Depends { name: "QmakeProjectManager" } Depends { name: "RemoteLinux" } Depends { name: "TextEditor" } Depends { name: "QmlDebug" } Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } files: [ "bardescriptordocument.cpp", "bardescriptordocument.h", "bardescriptordocumentnodehandlers.cpp", "bardescriptordocumentnodehandlers.h", "bardescriptoreditor.cpp", "bardescriptoreditor.h", "bardescriptoreditorabstractpanelwidget.cpp", "bardescriptoreditorabstractpanelwidget.h", "bardescriptoreditorassetswidget.cpp", "bardescriptoreditorassetswidget.h", "bardescriptoreditorassetswidget.ui", "bardescriptoreditorauthorinformationwidget.cpp", "bardescriptoreditorauthorinformationwidget.h", "bardescriptoreditorauthorinformationwidget.ui", "bardescriptoreditorentrypointwidget.cpp", "bardescriptoreditorentrypointwidget.h", "bardescriptoreditorentrypointwidget.ui", "bardescriptoreditorenvironmentwidget.cpp", "bardescriptoreditorenvironmentwidget.h", "bardescriptoreditorenvironmentwidget.ui", "bardescriptoreditorfactory.cpp", "bardescriptoreditorfactory.h", "bardescriptoreditorgeneralwidget.cpp", "bardescriptoreditorgeneralwidget.h", "bardescriptoreditorgeneralwidget.ui", "bardescriptoreditorpackageinformationwidget.cpp", "bardescriptoreditorpackageinformationwidget.h", "bardescriptoreditorpackageinformationwidget.ui", "bardescriptoreditorpermissionswidget.cpp", "bardescriptoreditorpermissionswidget.h", "bardescriptoreditorpermissionswidget.ui", "bardescriptoreditorwidget.cpp", "bardescriptoreditorwidget.h", "bardescriptormagicmatcher.cpp", "bardescriptormagicmatcher.h", "bardescriptorpermissionsmodel.cpp", "bardescriptorpermissionsmodel.h", "blackberryabstractdeploystep.cpp", "blackberryabstractdeploystep.h", "blackberryapplicationrunner.cpp", "blackberryapplicationrunner.h", "blackberrycheckdevmodestep.cpp", "blackberrycheckdevmodestep.h", "blackberrycheckdevmodestepconfigwidget.cpp", "blackberrycheckdevmodestepconfigwidget.h", "blackberrycheckdevmodestepfactory.cpp", "blackberrycheckdevmodestepfactory.h", "blackberryconfigurationmanager.cpp", "blackberryconfigurationmanager.h", "blackberrycreatepackagestep.cpp", "blackberrycreatepackagestep.h", "blackberrycreatepackagestepconfigwidget.cpp", "blackberrycreatepackagestepconfigwidget.h", "blackberrycreatepackagestepconfigwidget.ui", "blackberrycreatepackagestepfactory.cpp", "blackberrycreatepackagestepfactory.h", "blackberrydebugsupport.cpp", "blackberrydebugsupport.h", "blackberrydeployconfiguration.cpp", "blackberrydeployconfiguration.h", "blackberrydeployconfigurationfactory.cpp", "blackberrydeployconfigurationfactory.h", "blackberrydeployconfigurationwidget.cpp", "blackberrydeployconfigurationwidget.h", "blackberrydeployconfigurationwidget.ui", "blackberrydeployinformation.cpp", "blackberrydeployinformation.h", "blackberrydeploystep.cpp", "blackberrydeploystep.h", "blackberrydeploystepconfigwidget.cpp", "blackberrydeploystepconfigwidget.h", "blackberrydeploystepfactory.cpp", "blackberrydeploystepfactory.h", "blackberrydebugtokenreader.cpp", "blackberrydebugtokenreader.h", "blackberrydeviceconfiguration.cpp", "blackberrydeviceconfiguration.h", "blackberrydeviceinformation.cpp", "blackberrydeviceinformation.h", "blackberrydeviceconfigurationfactory.cpp", "blackberrydeviceconfigurationfactory.h", "blackberrydeviceconfigurationwidget.cpp", "blackberrydeviceconfigurationwidget.h", "blackberrydeviceconfigurationwidget.ui", "blackberrydeviceconfigurationwizard.cpp", "blackberrydeviceconfigurationwizard.h", "blackberrydeviceconfigurationwizardconfigpage.ui", "blackberrydeviceconfigurationwizardpages.cpp", "blackberrydeviceconfigurationwizardpages.h", "blackberrydeviceconfigurationwizardquerypage.ui", "blackberrydeviceconfigurationwizardsetuppage.ui", "blackberrydeviceconnection.cpp", "blackberrydeviceconnection.h", "blackberrydeviceconnectionmanager.cpp", "blackberrydeviceconnectionmanager.h", "blackberrydevicelistdetector.cpp", "blackberrydevicelistdetector.h", "blackberryinstallwizard.cpp", "blackberryinstallwizard.h", "blackberryinstallwizardndkpage.ui", "blackberryinstallwizardpages.cpp", "blackberryinstallwizardpages.h", "blackberryinstallwizardprocesspage.ui", "blackberryinstallwizardtargetpage.ui", "blackberrylogprocessrunner.cpp", "blackberrylogprocessrunner.h", "blackberryqtversion.cpp", "blackberryqtversion.h", "blackberryqtversionfactory.cpp", "blackberryqtversionfactory.h", "blackberryprocessparser.cpp", "blackberryprocessparser.h", "blackberryrunconfiguration.cpp", "blackberryrunconfiguration.h", "blackberryrunconfigurationfactory.cpp", "blackberryrunconfigurationfactory.h", "blackberryrunconfigurationwidget.cpp", "blackberryrunconfigurationwidget.h", "blackberryrunconfigurationwidget.ui", "blackberryruncontrol.cpp", "blackberryruncontrol.h", "blackberryruncontrolfactory.cpp", "blackberryruncontrolfactory.h", "blackberrysigningpasswordsdialog.h", "blackberrysigningpasswordsdialog.cpp", "blackberrysigningpasswordsdialog.ui", "blackberryndksettingswidget.cpp", "blackberryndksettingswidget.h", "blackberryndksettingswidget.ui", "blackberryndksettingspage.cpp", "blackberryndksettingspage.h", "blackberryconfiguration.cpp", "blackberryconfiguration.h", "blackberrycertificate.cpp", "blackberrycertificate.h", "blackberrykeyspage.cpp", "blackberrykeyspage.h", "blackberrykeyswidget.cpp", "blackberrykeyswidget.h", "blackberrykeyswidget.ui", "blackberryimportcertificatedialog.cpp", "blackberryimportcertificatedialog.h", "blackberryimportcertificatedialog.ui", "blackberrycreatecertificatedialog.cpp", "blackberrycreatecertificatedialog.h", "blackberrycreatecertificatedialog.ui", "blackberrydebugtokenrequester.cpp", "blackberrydebugtokenrequester.h", "blackberrydebugtokenrequestdialog.cpp", "blackberrydebugtokenrequestdialog.h", "blackberrydebugtokenrequestdialog.ui", "blackberrydebugtokenuploader.cpp", "blackberrydebugtokenuploader.h", "blackberryndkprocess.cpp", "blackberryndkprocess.h", "blackberrysshkeysgenerator.cpp", "blackberrysshkeysgenerator.h", "blackberrysetupwizard.cpp", "blackberrysetupwizard.h", "blackberrysetupwizardpages.cpp", "blackberrysetupwizardpages.h", "blackberrysetupwizardkeyspage.ui", "blackberrysetupwizardcertificatepage.ui", "blackberrysetupwizarddevicepage.ui", "blackberrysetupwizardfinishpage.ui", "blackberrysigningutils.cpp", "blackberrysigningutils.h", "pathchooserdelegate.cpp", "pathchooserdelegate.h", "qnxtoolchain.cpp", "qnxtoolchain.h", "qnx.qrc", "qnxabstractqtversion.cpp", "qnxabstractqtversion.h", "qnxbaseqtconfigwidget.cpp", "qnxbaseqtconfigwidget.h", "qnxbaseqtconfigwidget.ui", "qnxconstants.h", "qnxabstractrunsupport.cpp", "qnxabstractrunsupport.h", "qnxanalyzesupport.cpp", "qnxanalyzesupport.h", "qnxdebugsupport.cpp", "qnxdebugsupport.h", "qnxdeployconfiguration.cpp", "qnxdeployconfiguration.h", "qnxdeployconfigurationfactory.cpp", "qnxdeployconfigurationfactory.h", "qnxdeploystepfactory.cpp", "qnxdeploystepfactory.h", "qnxdeviceconfiguration.cpp", "qnxdeviceconfiguration.h", "qnxdeviceconfigurationfactory.cpp", "qnxdeviceconfigurationfactory.h", "qnxdeviceconfigurationwizard.cpp", "qnxdeviceconfigurationwizard.h", "qnxdeviceconfigurationwizardpages.cpp", "qnxdeviceconfigurationwizardpages.h", "qnxdeviceprocesslist.cpp", "qnxdeviceprocesslist.h", "qnxdeviceprocesssignaloperation.cpp", "qnxdeviceprocesssignaloperation.h", "qnxdevicetester.cpp", "qnxdevicetester.h", "qnxplugin.cpp", "qnxplugin.h", "qnxqtversion.cpp", "qnxqtversion.h", "qnxqtversionfactory.cpp", "qnxqtversionfactory.h", "qnxrunconfiguration.cpp", "qnxrunconfiguration.h", "qnxrunconfigurationfactory.cpp", "qnxrunconfigurationfactory.h", "qnxruncontrol.cpp", "qnxruncontrol.h", "qnxruncontrolfactory.cpp", "qnxruncontrolfactory.h", "qnxutils.cpp", "qnxutils.h", "slog2inforunner.cpp", "slog2inforunner.h", "images/target-small.png", "images/target.png", ] Group { name: "CascadesImport" prefix: "cascadesimport/" files: [ "cascadesimport.qrc", "srcprojectwizardpage.ui", "cascadesimportwizard.cpp", "srcprojectwizardpage.cpp", "fileconverter.cpp", "bardescriptorconverter.cpp", "projectfileconverter.cpp", "importlogconverter.cpp", "importlog.cpp", "cascadesimportwizard.h", "srcprojectwizardpage.h", "fileconverter.h", "bardescriptorconverter.h", "projectfileconverter.h", "importlogconverter.h", "importlog.h", ] } } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryimportcertificatedialog.h0000644000015301777760000000475712321547255032643 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYIMPORTCERTIFICATEDIALOG_H #define QNX_INTERNAL_BLACKBERRYIMPORTCERTIFICATEDIALOG_H #include QT_BEGIN_NAMESPACE class QPushButton; QT_END_NAMESPACE namespace Qnx { namespace Internal { class Ui_BlackBerryImportCertificateDialog; class BlackBerryCertificate; class BlackBerryImportCertificateDialog : public QDialog { Q_OBJECT public: explicit BlackBerryImportCertificateDialog(QWidget *parent = 0, Qt::WindowFlags f = 0); QString author() const; QString certPath() const; QString keystorePassword() const; BlackBerryCertificate *certificate() const; private slots: void importCertificate(); void validate(); void certificateLoaded(int); private: void setBusy(bool busy); Ui_BlackBerryImportCertificateDialog *m_ui; BlackBerryCertificate *m_certificate; QString m_author; QPushButton *m_cancelButton; QPushButton *m_okButton; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYIMPORTCERTIFICATEDIALOG_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxbaseqtconfigwidget.ui0000644000015301777760000000164212321547255030461 0ustar pbusernogroup00000000000000 Qnx::Internal::QnxBaseQtConfigWidget 0 0 778 23 SDK: Utils::PathChooser QWidget
utils/pathchooser.h
1
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnx.pro0000644000015301777760000002137312321547255025055 0ustar pbusernogroup00000000000000QT += network xml PROVIDER = BlackBerry include(../../qtcreatorplugin.pri) SOURCES += qnxplugin.cpp \ blackberryqtversionfactory.cpp \ blackberryqtversion.cpp \ qnxbaseqtconfigwidget.cpp \ blackberrydeployconfigurationfactory.cpp \ blackberrydeployconfiguration.cpp \ blackberrycreatepackagestep.cpp \ blackberrycreatepackagestepconfigwidget.cpp \ blackberrycreatepackagestepfactory.cpp \ blackberrydeploystep.cpp \ blackberrydeployconfigurationwidget.cpp \ blackberrydeploystepconfigwidget.cpp \ blackberrydeviceconfigurationfactory.cpp \ blackberrydeviceconfigurationwizard.cpp \ blackberrydeviceconfigurationwizardpages.cpp \ blackberrydeploystepfactory.cpp \ blackberryrunconfiguration.cpp \ blackberryrunconfigurationwidget.cpp \ blackberryrunconfigurationfactory.cpp \ blackberryruncontrolfactory.cpp \ blackberryruncontrol.cpp \ blackberrydebugsupport.cpp \ blackberryapplicationrunner.cpp \ qnxutils.cpp \ blackberrydeviceconfigurationwidget.cpp \ qnxdeviceconfigurationfactory.cpp \ qnxdeviceconfigurationwizard.cpp \ qnxdeviceconfigurationwizardpages.cpp \ qnxrunconfiguration.cpp \ qnxruncontrolfactory.cpp \ qnxabstractrunsupport.cpp \ qnxanalyzesupport.cpp \ qnxdebugsupport.cpp \ qnxdeploystepfactory.cpp \ qnxdeployconfigurationfactory.cpp \ qnxrunconfigurationfactory.cpp \ qnxruncontrol.cpp \ qnxqtversionfactory.cpp \ qnxqtversion.cpp \ qnxabstractqtversion.cpp \ blackberrydeviceconfiguration.cpp \ qnxdeployconfiguration.cpp \ qnxdeviceconfiguration.cpp \ blackberrydeployinformation.cpp \ pathchooserdelegate.cpp \ blackberryabstractdeploystep.cpp \ blackberryndksettingswidget.cpp \ blackberryndksettingspage.cpp \ blackberryconfiguration.cpp \ bardescriptormagicmatcher.cpp \ bardescriptoreditorfactory.cpp \ bardescriptoreditor.cpp \ bardescriptoreditorwidget.cpp \ bardescriptordocument.cpp \ bardescriptordocumentnodehandlers.cpp \ bardescriptorpermissionsmodel.cpp \ blackberrykeyswidget.cpp \ blackberrykeyspage.cpp \ blackberrycertificate.cpp \ blackberryimportcertificatedialog.cpp \ blackberrycreatecertificatedialog.cpp \ blackberrydebugtokenrequester.cpp \ blackberrydebugtokenrequestdialog.cpp \ blackberrydebugtokenuploader.cpp \ blackberrydebugtokenreader.cpp \ blackberryndkprocess.cpp \ blackberrycheckdevmodestepfactory.cpp \ blackberrycheckdevmodestep.cpp \ blackberrycheckdevmodestepconfigwidget.cpp \ blackberrydeviceconnection.cpp \ blackberrydeviceconnectionmanager.cpp \ blackberrydeviceinformation.cpp \ blackberrysshkeysgenerator.cpp \ blackberryprocessparser.cpp \ blackberrysigningpasswordsdialog.cpp \ bardescriptoreditorpackageinformationwidget.cpp \ bardescriptoreditorauthorinformationwidget.cpp \ bardescriptoreditorentrypointwidget.cpp \ bardescriptoreditorgeneralwidget.cpp \ bardescriptoreditorpermissionswidget.cpp \ bardescriptoreditorenvironmentwidget.cpp \ bardescriptoreditorassetswidget.cpp \ bardescriptoreditorabstractpanelwidget.cpp \ blackberrysetupwizard.cpp \ blackberrysetupwizardpages.cpp \ blackberrysigningutils.cpp \ qnxdevicetester.cpp \ blackberryconfigurationmanager.cpp \ blackberrydevicelistdetector.cpp \ blackberrylogprocessrunner.cpp \ blackberryinstallwizardpages.cpp \ blackberryinstallwizard.cpp \ qnxdeviceprocesssignaloperation.cpp \ qnxdeviceprocesslist.cpp \ qnxtoolchain.cpp \ slog2inforunner.cpp HEADERS += qnxplugin.h\ qnxconstants.h \ blackberryqtversionfactory.h \ blackberryqtversion.h \ qnxbaseqtconfigwidget.h \ blackberrydeployconfigurationfactory.h \ blackberrydeployconfiguration.h \ blackberrycreatepackagestep.h \ blackberrycreatepackagestepconfigwidget.h \ blackberrycreatepackagestepfactory.h \ blackberrydeploystep.h \ blackberrydeployconfigurationwidget.h \ blackberrydeploystepconfigwidget.h \ blackberrydeviceconfigurationfactory.h \ blackberrydeviceconfigurationwizard.h \ blackberrydeviceconfigurationwizardpages.h \ blackberrydeploystepfactory.h \ blackberryrunconfiguration.h \ blackberryrunconfigurationwidget.h \ blackberryrunconfigurationfactory.h \ blackberryruncontrolfactory.h \ blackberryruncontrol.h \ blackberrydebugsupport.h \ blackberryapplicationrunner.h \ qnxutils.h \ blackberrydeviceconfigurationwidget.h \ qnxdeviceconfigurationfactory.h \ qnxdeviceconfigurationwizard.h \ qnxdeviceconfigurationwizardpages.h \ qnxrunconfiguration.h \ qnxruncontrolfactory.h \ qnxabstractrunsupport.h \ qnxanalyzesupport.h \ qnxdebugsupport.h \ qnxdeploystepfactory.h \ qnxdeployconfigurationfactory.h \ qnxrunconfigurationfactory.h \ qnxruncontrol.h \ qnxqtversionfactory.h \ qnxqtversion.h \ qnxabstractqtversion.h \ blackberrydeviceconfiguration.h \ qnxdeployconfiguration.h \ qnxdeviceconfiguration.h \ blackberrydeployinformation.h \ pathchooserdelegate.h \ blackberryabstractdeploystep.h \ blackberryndksettingswidget.h \ blackberryndksettingspage.h \ blackberryconfiguration.h \ bardescriptormagicmatcher.h \ bardescriptoreditorfactory.h \ bardescriptoreditor.h \ bardescriptoreditorwidget.h \ bardescriptordocument.h \ bardescriptordocumentnodehandlers.h \ bardescriptorpermissionsmodel.h \ blackberrykeyswidget.h \ blackberrykeyspage.h \ blackberrycertificate.h \ blackberryimportcertificatedialog.h \ blackberrycreatecertificatedialog.h \ blackberrydebugtokenrequester.h \ blackberrydebugtokenrequestdialog.h \ blackberrydebugtokenuploader.h \ blackberrydebugtokenreader.h \ blackberryndkprocess.h \ blackberrycheckdevmodestepfactory.h \ blackberrycheckdevmodestep.h \ blackberrycheckdevmodestepconfigwidget.h \ blackberrydeviceconnection.h \ blackberrydeviceconnectionmanager.h \ blackberrydeviceinformation.h \ blackberrysshkeysgenerator.h \ blackberryprocessparser.h \ blackberrysigningpasswordsdialog.h \ bardescriptoreditorpackageinformationwidget.h \ bardescriptoreditorauthorinformationwidget.h \ bardescriptoreditorentrypointwidget.h \ bardescriptoreditorgeneralwidget.h \ bardescriptoreditorpermissionswidget.h \ bardescriptoreditorenvironmentwidget.h \ bardescriptoreditorassetswidget.h \ bardescriptoreditorabstractpanelwidget.h \ blackberrysetupwizard.h \ blackberrysetupwizardpages.h \ blackberrysigningutils.h \ qnxdevicetester.h \ blackberryconfigurationmanager.h \ blackberrydevicelistdetector.h \ blackberrylogprocessrunner.h \ blackberryinstallwizardpages.h \ blackberryinstallwizard.h \ qnxdeviceprocesssignaloperation.h \ qnxdeviceprocesslist.h \ qnxtoolchain.h \ slog2inforunner.h FORMS += \ blackberrydeviceconfigurationwizardsetuppage.ui \ blackberryrunconfigurationwidget.ui \ blackberrydeployconfigurationwidget.ui \ blackberrydeviceconfigurationwidget.ui \ qnxbaseqtconfigwidget.ui \ blackberryndksettingswidget.ui \ blackberrykeyswidget.ui \ blackberryimportcertificatedialog.ui \ blackberrycreatecertificatedialog.ui \ blackberrydebugtokenrequestdialog.ui \ blackberrycreatepackagestepconfigwidget.ui \ blackberrysigningpasswordsdialog.ui \ bardescriptoreditorpackageinformationwidget.ui \ bardescriptoreditorauthorinformationwidget.ui \ bardescriptoreditorentrypointwidget.ui \ bardescriptoreditorgeneralwidget.ui \ bardescriptoreditorpermissionswidget.ui \ bardescriptoreditorenvironmentwidget.ui \ bardescriptoreditorassetswidget.ui \ blackberrysetupwizardkeyspage.ui \ blackberrysetupwizardcertificatepage.ui \ blackberrysetupwizarddevicepage.ui \ blackberrysetupwizardfinishpage.ui \ blackberrydeviceconfigurationwizardconfigpage.ui \ blackberrydeviceconfigurationwizardquerypage.ui \ blackberryinstallwizardtargetpage.ui \ blackberryinstallwizardndkpage.ui \ blackberryinstallwizardprocesspage.ui include(../../private_headers.pri) include(./cascadesimport/cascadesimport.pri) greaterThan(QT_MAJOR_VERSION, 4) { QT += gui-private DEFINES += QNX_ZIP_FILE_SUPPORT } else { exists($${QT_PRIVATE_HEADERS}/QtGui/private/qzipreader_p.h) { DEFINES += QNX_ZIP_FILE_SUPPORT } else { warning("The QNX plugin depends on private headers from QtGui module, to be fully functional.") warning("To fix it, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.") } } DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII RESOURCES += \ qnx.qrc qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycheckdevmodestepfactory.h0000644000015301777760000000534412321547255032644 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H #define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H #include namespace Qnx { namespace Internal { class BlackBerryCheckDevModeStepFactory : public ProjectExplorer::IBuildStepFactory { Q_OBJECT public: explicit BlackBerryCheckDevModeStepFactory(QObject *parent = 0); QList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryinstallwizard.h0000644000015301777760000000610712321547255030624 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H #define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H #include #include namespace Qnx { namespace Internal { class BlackBerryInstallWizardOptionPage; class BlackBerryInstallWizardNdkPage; class BlackBerryInstallWizardTargetPage; class BlackBerryInstallWizardProcessPage; class BlackBerryInstallWizardFinalPage; class BlackBerryInstallerDataHandler { public: enum Mode { InstallMode, UninstallMode, ManuallMode }; QString ndkPath; QString target; QString version; int exitCode; QProcess::ExitStatus exitStatus; Mode mode; }; class BlackBerryInstallWizard : public Utils::Wizard { Q_OBJECT public: enum PageId { OptionPage, NdkPageId, TargetPageId, ProcessPageId, FinalPageId }; explicit BlackBerryInstallWizard(BlackBerryInstallerDataHandler::Mode mode = BlackBerryInstallerDataHandler::InstallMode, const QString& version = QString(), QWidget *parent = 0); signals: void processFinished(); private slots: void handleProcessCancelled(); private: BlackBerryInstallWizardOptionPage *m_optionPage; BlackBerryInstallWizardNdkPage *m_ndkPage; BlackBerryInstallWizardTargetPage *m_targetPage; BlackBerryInstallWizardProcessPage *m_processPage; BlackBerryInstallWizardFinalPage *m_finalPage; BlackBerryInstallerDataHandler m_data; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorwidget.cpp0000644000015301777760000002410512321547255031503 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorwidget.h" #include "qnxconstants.h" #include "bardescriptoreditor.h" #include "bardescriptoreditorassetswidget.h" #include "bardescriptoreditorauthorinformationwidget.h" #include "bardescriptoreditorentrypointwidget.h" #include "bardescriptoreditorenvironmentwidget.h" #include "bardescriptoreditorgeneralwidget.h" #include "bardescriptoreditorpackageinformationwidget.h" #include "bardescriptoreditorpermissionswidget.h" #include #include #include #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorWidget::BarDescriptorEditorWidget( QWidget *parent, TextEditor::TextEditorActionHandler *handler) : QStackedWidget(parent) , m_editor(0) , m_handler(handler) , m_dirty(false) { Core::IContext *myContext = new Core::IContext(this); myContext->setWidget(this); myContext->setContext(Core::Context(Constants::QNX_BAR_DESCRIPTOR_EDITOR_CONTEXT, TextEditor::Constants::C_TEXTEDITOR)); Core::ICore::addContextObject(myContext); initGeneralPage(); initApplicationPage(); initAssetsPage(); initSourcePage(); setCurrentIndex(0); } void BarDescriptorEditorWidget::initGeneralPage() { ProjectExplorer::PanelsWidget *generalPanel = new ProjectExplorer::PanelsWidget(this); initPanelSize(generalPanel); addWidget(generalPanel); // Entry-Point Text and Images ProjectExplorer::PropertiesPanel *entryPointPanel = new ProjectExplorer::PropertiesPanel; m_entryPointWidget = new BarDescriptorEditorEntryPointWidget; entryPointPanel->setDisplayName(tr("Entry-Point Text and Images")); entryPointPanel->setWidget(m_entryPointWidget); generalPanel->addPropertiesPanel(entryPointPanel); // Package Information ProjectExplorer::PropertiesPanel *packageInformationPanel = new ProjectExplorer::PropertiesPanel; m_packageInformationWidget = new BarDescriptorEditorPackageInformationWidget; packageInformationPanel->setDisplayName(tr("Package Information")); packageInformationPanel->setWidget(m_packageInformationWidget); generalPanel->addPropertiesPanel(packageInformationPanel); // Author information ProjectExplorer::PropertiesPanel *authorInformationPanel = new ProjectExplorer::PropertiesPanel; m_authorInformationWidget = new BarDescriptorEditorAuthorInformationWidget; authorInformationPanel->setDisplayName(tr("Author Information")); authorInformationPanel->setWidget(m_authorInformationWidget); generalPanel->addPropertiesPanel(authorInformationPanel); connect(m_entryPointWidget, SIGNAL(changed()), this, SLOT(setDirty())); connect(m_packageInformationWidget, SIGNAL(changed()), this, SLOT(setDirty())); connect(m_authorInformationWidget, SIGNAL(changed()), this, SLOT(setDirty())); } void BarDescriptorEditorWidget::initApplicationPage() { ProjectExplorer::PanelsWidget *applicationPanel = new ProjectExplorer::PanelsWidget(this); initPanelSize(applicationPanel); addWidget(applicationPanel); // General ProjectExplorer::PropertiesPanel *generalPanel = new ProjectExplorer::PropertiesPanel; m_generalWidget = new BarDescriptorEditorGeneralWidget; generalPanel->setDisplayName(tr("General")); generalPanel->setWidget(m_generalWidget); applicationPanel->addPropertiesPanel(generalPanel); //Permissions ProjectExplorer::PropertiesPanel *permissionsPanel = new ProjectExplorer::PropertiesPanel; m_permissionsWidget = new BarDescriptorEditorPermissionsWidget; permissionsPanel->setDisplayName(tr("Permissions")); permissionsPanel->setWidget(m_permissionsWidget); applicationPanel->addPropertiesPanel(permissionsPanel); // Environment ProjectExplorer::PropertiesPanel *environmentPanel = new ProjectExplorer::PropertiesPanel; m_environmentWidget = new BarDescriptorEditorEnvironmentWidget; environmentPanel->setDisplayName(tr("Environment")); environmentPanel->setWidget(m_environmentWidget); applicationPanel->addPropertiesPanel(environmentPanel); connect(m_generalWidget, SIGNAL(changed()), this, SLOT(setDirty())); connect(m_permissionsWidget, SIGNAL(changed()), this, SLOT(setDirty())); connect(m_environmentWidget, SIGNAL(changed()), this, SLOT(setDirty())); } void BarDescriptorEditorWidget::initAssetsPage() { ProjectExplorer::PanelsWidget *assetsPanel = new ProjectExplorer::PanelsWidget(this); initPanelSize(assetsPanel); addWidget(assetsPanel); ProjectExplorer::PropertiesPanel *assetsPropertiesPanel = new ProjectExplorer::PropertiesPanel; m_assetsWidget = new BarDescriptorEditorAssetsWidget; assetsPropertiesPanel->setDisplayName(tr("Assets")); assetsPropertiesPanel->setWidget(m_assetsWidget); assetsPanel->addPropertiesPanel(assetsPropertiesPanel); connect(m_assetsWidget, SIGNAL(changed()), this, SLOT(setDirty())); m_entryPointWidget->setAssetsModel(m_assetsWidget->assetsModel()); connect(m_entryPointWidget, SIGNAL(imageAdded(QString)), m_assetsWidget, SLOT(addAsset(QString))); connect(m_entryPointWidget, SIGNAL(imageRemoved(QString)), m_assetsWidget, SLOT(removeAsset(QString))); } void BarDescriptorEditorWidget::initSourcePage() { m_xmlSourceWidget = new TextEditor::PlainTextEditorWidget(this); addWidget(m_xmlSourceWidget); TextEditor::TextEditorSettings::initializeEditor(m_xmlSourceWidget); m_handler->setupActions(m_xmlSourceWidget); m_xmlSourceWidget->configure(QLatin1String(Constants::QNX_BAR_DESCRIPTOR_MIME_TYPE)); connect(m_xmlSourceWidget, SIGNAL(textChanged()), this, SLOT(setDirty())); } void BarDescriptorEditorWidget::initPanelSize(ProjectExplorer::PanelsWidget *panelsWidget) { panelsWidget->widget()->setMaximumWidth(900); panelsWidget->widget()->setMinimumWidth(0); } Core::IEditor *BarDescriptorEditorWidget::editor() const { if (!m_editor) { m_editor = const_cast(this)->createEditor(); connect(this, SIGNAL(changed()), m_editor->document(), SIGNAL(changed())); } return m_editor; } BarDescriptorEditorPackageInformationWidget *BarDescriptorEditorWidget::packageInformationWidget() const { return m_packageInformationWidget; } BarDescriptorEditorAuthorInformationWidget *BarDescriptorEditorWidget::authorInformationWidget() const { return m_authorInformationWidget; } BarDescriptorEditorEntryPointWidget *BarDescriptorEditorWidget::entryPointWidget() const { return m_entryPointWidget; } BarDescriptorEditorGeneralWidget *BarDescriptorEditorWidget::generalWidget() const { return m_generalWidget; } BarDescriptorEditorPermissionsWidget *BarDescriptorEditorWidget::permissionsWidget() const { return m_permissionsWidget; } BarDescriptorEditorEnvironmentWidget *BarDescriptorEditorWidget::environmentWidget() const { return m_environmentWidget; } BarDescriptorEditorAssetsWidget *BarDescriptorEditorWidget::assetsWidget() const { return m_assetsWidget; } TextEditor::BaseTextEditorWidget *BarDescriptorEditorWidget::sourceWidget() const { return m_xmlSourceWidget; } void BarDescriptorEditorWidget::setFilePath(const QString &filePath) { Core::IDocument *doc = m_xmlSourceWidget->editorDocument(); if (doc) { doc->setFilePath(filePath); // setFilePath() call leads to a textChanged() signal emitted // and therefore having this editor-widget to become dirty // therefore we have to explicitly unset the dirty flag setDirty(false); } } QString BarDescriptorEditorWidget::xmlSource() const { return m_xmlSourceWidget->toPlainText(); } void BarDescriptorEditorWidget::setXmlSource(const QString &xmlSource) { bool blocked = m_xmlSourceWidget->blockSignals(true); m_xmlSourceWidget->setPlainText(xmlSource); m_xmlSourceWidget->blockSignals(blocked); } bool BarDescriptorEditorWidget::isDirty() const { return m_dirty; } void BarDescriptorEditorWidget::clear() { m_entryPointWidget->clear(); m_packageInformationWidget->clear(); m_authorInformationWidget->clear(); m_generalWidget->clear(); m_permissionsWidget->clear(); m_environmentWidget->clear(); m_assetsWidget->clear(); bool blocked = m_xmlSourceWidget->blockSignals(true); m_xmlSourceWidget->clear(); m_xmlSourceWidget->blockSignals(blocked); } void BarDescriptorEditorWidget::setDirty(bool dirty) { m_dirty = dirty; emit changed(); } BarDescriptorEditor *BarDescriptorEditorWidget::createEditor() { return new BarDescriptorEditor(this); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/0000755000015301777760000000000012321547742026521 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/fileconverter.h0000644000015301777760000000614612321547255031547 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_BLACKBERRY_CASCADESPROJECTIMPORT_FILECONVERTER_H #define QNX_BLACKBERRY_CASCADESPROJECTIMPORT_FILECONVERTER_H #include "importlog.h" #include #include namespace Core { class GeneratedFile; } namespace Qnx { namespace Internal { class ConvertedProjectContext { public: void setSrcProjectPath(const QString &p) {m_srcProjectPath = p;} QString srcProjectPath() const {return m_srcProjectPath;} void setDestProjectPath(const QString &p) {m_destProjectPath = p;} QString destProjectPath() const {return m_destProjectPath;} QString projectName() const; const QStringList& collectedFiles() const {return m_collectedFiles;} void setCollectedFiles(const QStringList &files) {m_collectedFiles = files;} ImportLog& importLog() {return m_importLog;} private: QString m_srcProjectPath; QString m_destProjectPath; ImportLog m_importLog; QStringList m_collectedFiles; }; class FileConverter { Q_DECLARE_TR_FUNCTIONS(FileConverter); public: FileConverter(ConvertedProjectContext &ctx) : m_convertedProjectContext(ctx) {} virtual ~FileConverter() {} virtual bool convertFile(Core::GeneratedFile &file, QString &errorMessage); protected: ConvertedProjectContext& convertedProjectContext() const {return m_convertedProjectContext;} bool loadFileContent(Core::GeneratedFile &file, QString &errorMessage); QByteArray loadFileContent(const QString &filePath, QString &errorMessage); void logError(const QString &errorMessage); ConvertedProjectContext &m_convertedProjectContext; }; } // namespace Internal } // namespace Qnx #endif // QNX_BLACKBERRY_CASCADESPROJECTIMPORT_FILECONVERTER_H ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/bardescriptorconverter.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/bardescriptorconverter.cp0000644000015301777760000002254112321547255033643 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptorconverter.h" #include #include #include namespace Qnx { namespace Internal { ////////////////////////////////////////////////////////////////////////////// // // BarDescriptorConverter // ////////////////////////////////////////////////////////////////////////////// static const char S_ASSET[] = "asset"; static const char S_PATH[] = "path"; static const char S_SRC_DIR[] = "%SRC_DIR%/"; BarDescriptorConverter::BarDescriptorConverter(ConvertedProjectContext &ctx) : FileConverter(ctx) { } QString BarDescriptorConverter::projectName() const { return convertedProjectContext().projectName(); } QString BarDescriptorConverter::applicationBinaryName() const { return projectName(); } QString BarDescriptorConverter::applicationBinaryPath() const { return projectName(); } QDomElement BarDescriptorConverter::findElement(QDomDocument &doc, const QString &tagName, const QString &attributeName, const QString &attributeValue) { QDomElement ret; QTC_ASSERT(!tagName.isEmpty(), return ret); QDomElement rootElement = doc.documentElement(); static const QLatin1String elementTextFakeAttributeNameString("S_ELEMENT_TEXT_FAKE_ATTRIBUTE_NAME"); bool isFindText = (attributeName == elementTextFakeAttributeNameString); QRegExp rxAttrValue; if (!isFindText && !attributeValue.isEmpty()) rxAttrValue = QRegExp(attributeValue, Qt::CaseSensitive, QRegExp::Wildcard); for (QDomElement el = rootElement.firstChildElement(tagName); !el.isNull(); el = el.nextSiblingElement(tagName)) { if (attributeName.isEmpty()) { // take first matching tag name ret = el; break; } else if (isFindText) { QString s = el.text(); if (s == attributeValue) { ret = el; break; } } else if (el.hasAttribute(attributeName)) { if (attributeValue.isEmpty() || rxAttrValue.exactMatch(el.attribute(attributeName))) { ret = el; break; } } } return ret; } QDomElement BarDescriptorConverter::ensureElement(QDomDocument &doc, const QString &tagName, const QString &attributeName, const QString &attributeValue) { QDomElement ret = findElement(doc, tagName, attributeName, attributeValue); if (ret.isNull()) { QDomElement rootElement = doc.documentElement(); ret = rootElement.appendChild(doc.createElement(tagName)).toElement(); QTC_ASSERT(!ret.isNull(), return ret); } if (!attributeName.isEmpty()) ret.setAttribute(attributeName, attributeValue); return ret; } QDomElement BarDescriptorConverter::removeElement(QDomDocument &doc, const QString &tagName, const QString &attributeName, const QString &attributeValue) { QDomElement ret = findElement(doc, tagName, attributeName, attributeValue); if (!ret.isNull()) { QDomNode nd = ret.parentNode(); QTC_ASSERT(!nd.isNull(), return ret); nd.removeChild(ret); } return ret; } void BarDescriptorConverter::setEnv(QDomDocument &doc, const QString &name, const QString &value) { QDomElement el = ensureElement(doc, QLatin1String("env"), QLatin1String("var"), name); QTC_ASSERT(!el.isNull(), return); el.setAttribute(QString::fromLatin1("value"), value); } void BarDescriptorConverter::setAsset(QDomDocument &doc, const QString &srcPath, const QString &destPath, const QString &type, bool isEntry) { ImportLog &log = convertedProjectContext().importLog(); log.logInfo(tr("Setting asset path: %1 to %2 type: %3 entry point: %4") .arg(srcPath).arg(destPath).arg(type).arg(isEntry)); QDomElement assetElement = ensureElement(doc, QLatin1String(S_ASSET), QLatin1String(S_PATH), srcPath); QTC_ASSERT(!assetElement.isNull(), return); while (assetElement.hasChildNodes()) { QDomNode nd = assetElement.firstChild(); assetElement.removeChild(nd); } assetElement.appendChild(doc.createTextNode(destPath)); const QString typeString = QLatin1String("type"); QString s = assetElement.attribute(typeString); if (s != type) assetElement.setAttribute(typeString, type); const QString entryString = QLatin1String("entry"); s = assetElement.attribute(entryString); bool b = (s.compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) || (s.compare(QLatin1String("1")) == 0); if (b != isEntry) assetElement.setAttribute(entryString, QVariant(isEntry).toString()); } void BarDescriptorConverter::removeAsset(QDomDocument &doc, const QString &srcPath) { ImportLog &log = convertedProjectContext().importLog(); log.logInfo(tr("Removing asset path: %1").arg(srcPath)); removeElement(doc, QLatin1String(S_ASSET), QLatin1String(S_PATH), srcPath); } void BarDescriptorConverter::replaceAssetSourcePath(QDomDocument &doc, const QString &oldSrcPath, const QString &newSrcPath) { ImportLog &log = convertedProjectContext().importLog(); QDomElement el = ensureElement(doc, QLatin1String(S_ASSET), QLatin1String(S_PATH), oldSrcPath); if (!el.isNull()) { log.logInfo(tr("Replacing asset source path: %1 -> %2").arg(oldSrcPath).arg(newSrcPath)); el.setAttribute(QLatin1String(S_PATH), newSrcPath); } } void BarDescriptorConverter::fixImageAsset(QDomDocument &doc, const QString &definitionElementName) { ImportLog &log = convertedProjectContext().importLog(); QString target; QDomElement el = findElement(doc, definitionElementName, QString(), QString()); if (!el.isNull()) { const QString imageString = QLatin1String("image"); for (QDomElement imageElement = el.firstChildElement(imageString); !imageElement.isNull(); imageElement = imageElement.nextSiblingElement(imageString)) { target = imageElement.text(); if (!target.isEmpty()) replaceAssetSourcePath(doc, target, QLatin1String(S_SRC_DIR) + target); } } else { log.logWarning(tr("Cannot find image asset definition: <%1>").arg(definitionElementName)); } } void BarDescriptorConverter::fixIconAsset(QDomDocument &doc) { const QString iconString = QString::fromLatin1("icon"); fixImageAsset(doc, iconString); } void BarDescriptorConverter::fixSplashScreensAsset(QDomDocument &doc) { const QString splashScreensString = QString::fromLatin1("splashScreens"); fixImageAsset(doc, splashScreensString); } bool BarDescriptorConverter::convertFile(Core::GeneratedFile &file, QString &errorMessage) { FileConverter::convertFile(file, errorMessage); if (errorMessage.isEmpty()) { QDomDocument doc; if (!doc.setContent(file.binaryContents(), &errorMessage)) { errorMessage = tr("Error parsing XML file '%1': %2").arg(file.path()).arg(errorMessage); return false; } // remove elements, since they are Momentics specific QDomElement rootElement = doc.documentElement(); const QString configurationString = QLatin1String("configuration"); while (true) { QDomElement el = rootElement.firstChildElement(configurationString); if (el.isNull()) break; rootElement.removeChild(el); } // remove obsolete assets removeAsset(doc, QLatin1String("translations")); removeAsset(doc, QLatin1String("translations/*")); // assets setAsset(doc, applicationBinaryPath(), applicationBinaryName(), QLatin1String("Qnx/Elf"), true); const QString assetsString = QLatin1String("assets"); replaceAssetSourcePath(doc, assetsString, QLatin1String(S_SRC_DIR) + assetsString); fixIconAsset(doc); fixSplashScreensAsset(doc); file.setBinaryContents(doc.toByteArray(4)); } return errorMessage.isEmpty(); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/cascadesimport.qrc0000644000015301777760000000020012321547255032220 0ustar pbusernogroup00000000000000 resources/templates/project.pro qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/importlogconverter.cpp0000644000015301777760000000527612321547255033202 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "importlogconverter.h" #include #include #include #include namespace Qnx { namespace Internal { ////////////////////////////////////////////////////////////////////////////// // // ImportLogConverter // ////////////////////////////////////////////////////////////////////////////// ImportLogConverter::ImportLogConverter(ConvertedProjectContext &ctx) : FileConverter(ctx) { } bool ImportLogConverter::convertFile(Core::GeneratedFile &file, QString &errorMessage) { Q_UNUSED(errorMessage); QString content; content += QLatin1String("========================================================\n"); content += tr("Generated by cascades importer ver: %1, %2") .arg(QLatin1String(Qnx::Constants::QNX_BLACKBERRY_CASCADESIMPORTER_VERSION)) .arg(QDateTime::currentDateTime().toString(Qt::ISODate)); content += QLatin1String("\n========================================================\n\n"); content += convertedProjectContext().importLog().toString(); file.setContents(content); file.setAttributes(file.attributes() | Core::GeneratedFile::OpenEditorAttribute); return true; } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/srcprojectwizardpage.h0000644000015301777760000000441612321547255033132 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_BLACKBERRY_CASCADESPROJECTIMPORT_SRCPROJECTWIZARDPAGE_H #define QNX_BLACKBERRY_CASCADESPROJECTIMPORT_SRCPROJECTWIZARDPAGE_H #include namespace Qnx { namespace Internal { namespace Ui { class SrcProjectWizardPage; } class SrcProjectWizardPage : public QWizardPage { Q_OBJECT public: explicit SrcProjectWizardPage(QWidget *parent = 0); virtual ~SrcProjectWizardPage(); QString projectName() const; QString path() const; void setPath(const QString &path); bool isComplete() const; signals: void validPathChanged(const QString &path); private slots: void onPathChooserPathChanged(const QString &newPath); private: Ui::SrcProjectWizardPage *ui; bool m_complete; }; } // namespace Internal } // namespace Qnx #endif // QNX_BLACKBERRY_CASCADESPROJECTIMPORT_SRCPROJECTWIZARDPAGE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/fileconverter.cpp0000644000015301777760000000676112321547255032105 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "fileconverter.h" #include #include namespace Qnx { namespace Internal { ////////////////////////////////////////////////////////////////////////////// // // ConvertedProjectContext // ////////////////////////////////////////////////////////////////////////////// QString ConvertedProjectContext::projectName() const { return destProjectPath().section(QLatin1Char('/'), -1); } ////////////////////////////////////////////////////////////////////////////// // // FileConverter // ////////////////////////////////////////////////////////////////////////////// bool FileConverter::convertFile(Core::GeneratedFile &file, QString &errorMessage) { ImportLog &log = convertedProjectContext().importLog(); log.logInfo(tr("===== Converting file: %1").arg(file.path())); loadFileContent(file, errorMessage); if (!errorMessage.isEmpty()) logError(errorMessage); return errorMessage.isEmpty(); } QByteArray FileConverter::loadFileContent(const QString &filePath, QString &errorMessage) { QByteArray ret; Utils::FileReader fr; QString absFilePath = filePath; if (!filePath.startsWith(QLatin1String(":/"))) { const QString srcProjectPath = convertedProjectContext().srcProjectPath(); absFilePath = srcProjectPath + QLatin1Char('/') + filePath; } fr.fetch(absFilePath); if (!fr.errorString().isEmpty()) errorMessage = fr.errorString(); else ret = fr.data(); return ret; } bool FileConverter::loadFileContent(Core::GeneratedFile &file, QString &errorMessage) { if (file.binaryContents().isEmpty()) { // virtual files have some content set already QString filePath = file.path(); QByteArray ba = loadFileContent(filePath, errorMessage); file.setBinaryContents(ba); } return errorMessage.isEmpty(); } void FileConverter::logError(const QString &errorMessage) { if (!errorMessage.isEmpty()) convertedProjectContext().importLog().logError(errorMessage); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/importlog.h0000644000015301777760000000540012321547255030704 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_BLACKBERRY_CASCADESPROJECTIMPORT_IMPORTLOG_H #define QNX_BLACKBERRY_CASCADESPROJECTIMPORT_IMPORTLOG_H #include namespace Qnx { namespace Internal { class ImportLogEntry : public QVariantList { public: enum Severity {Undefined = 0, Debug, Info, Warning, Error}; ImportLogEntry() : QVariantList() {} ImportLogEntry(int sev, const QString &msg, const QString &context = QString()); ImportLogEntry(const QVariantList &l) : QVariantList(l) {} bool isValid() const {return (count() >= UnusedIx);} Severity severity() const; QString severityStr() const; QChar severityAbbr() const; QString message() const; QString context() const; QString toString() const; private: enum FieldIndexes {SeverityIx = 0, MessageIx, ContextIx, UnusedIx}; }; class ImportLog : public QList ///< error list { public: QString toString() const; ImportLog& logError(const QString &msg, const QString &context = QString()); ImportLog& logWarning(const QString &msg, const QString &context = QString()); ImportLog& logInfo(const QString &msg, const QString &context = QString()); ImportLog& logDebug(const QString &msg, const QString &context = QString()); }; } // namespace Internal } // namespace Qnx #endif // QNX_BLACKBERRY_CASCADESPROJECTIMPORT_IMPORTLOG_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/srcprojectwizardpage.cpp0000644000015301777760000000522712321547255033466 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "srcprojectwizardpage.h" #include "ui_srcprojectwizardpage.h" #include namespace Qnx { namespace Internal { SrcProjectWizardPage::SrcProjectWizardPage(QWidget *parent) : QWizardPage(parent), m_complete(false) { ui = new Ui::SrcProjectWizardPage; ui->setupUi(this); connect(ui->pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(onPathChooserPathChanged(QString))); setPath(QDir::homePath()); } SrcProjectWizardPage::~SrcProjectWizardPage() { delete ui; } void SrcProjectWizardPage::onPathChooserPathChanged(const QString &newPath) { bool newComplete = ui->pathChooser->isValid(); if (newComplete != m_complete) { m_complete = newComplete; emit completeChanged(); } if (newComplete) emit validPathChanged(newPath); } QString SrcProjectWizardPage::projectName() const { return path().section(QLatin1Char('/'), -1); } QString SrcProjectWizardPage::path() const { return Utils::FileName::fromUserInput(ui->pathChooser->path()).toString(); } void SrcProjectWizardPage::setPath(const QString &path) { ui->pathChooser->setPath(path); } bool SrcProjectWizardPage::isComplete() const { return m_complete; } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/importlog.cpp0000644000015301777760000001047412321547255031246 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "importlog.h" namespace Qnx { namespace Internal { ////////////////////////////////////////////////////////////////////////////// // // ImportLogEntry // ////////////////////////////////////////////////////////////////////////////// static const char S_ERROR[] = "error"; static const char S_WARNING[] = "warning"; static const char S_INFO[] = "info"; static const char S_DEBUG[] = "debug"; static const char S_UNDEFINED[] = "undefined"; ImportLogEntry::ImportLogEntry(int sev, const QString &msg, const QString &context) : QVariantList() { reserve(UnusedIx); append(sev); append(msg); append(context); } static const char* severityEnumToStr(ImportLogEntry::Severity sev) { switch (sev) { case ImportLogEntry::Error: return S_ERROR; case ImportLogEntry::Warning: return S_WARNING; case ImportLogEntry::Info: return S_INFO; case ImportLogEntry::Debug: return S_DEBUG; default: break; } return S_UNDEFINED; } ImportLogEntry::Severity ImportLogEntry::severity() const { if (isValid()) return (Severity)(at(SeverityIx).toInt()); return Undefined; } QString ImportLogEntry::severityStr() const { return QLatin1String(severityEnumToStr(severity())); } QChar ImportLogEntry::severityAbbr() const { return severityStr().at(0).toUpper(); } QString ImportLogEntry::message() const { if (isValid()) return at(MessageIx).toString(); return QString(); } QString ImportLogEntry::context() const { if (isValid()) return at(ContextIx).toString(); return QString(); } QString ImportLogEntry::toString() const { QString ret; if (severity() == Undefined) ret = message(); else ret = QString::fromLatin1("[%1]%2 %3").arg(severityAbbr()).arg(context()).arg(message()); return ret; } ////////////////////////////////////////////////////////////////////////////// // // ImportLog // ////////////////////////////////////////////////////////////////////////////// QString ImportLog::toString() const { QString ret; foreach (const ImportLogEntry &sle, *this) ret += sle.toString() + QLatin1Char('\n'); return ret; } ImportLog& ImportLog::logError(const QString &msg, const QString &context) { append(ImportLogEntry(ImportLogEntry::Error, msg, context)); return *this; } ImportLog& ImportLog::logWarning(const QString &msg, const QString &context) { append(ImportLogEntry(ImportLogEntry::Warning, msg, context)); return *this; } ImportLog& ImportLog::logInfo(const QString &msg, const QString &context) { append(ImportLogEntry(ImportLogEntry::Info, msg, context)); return *this; } ImportLog& ImportLog::logDebug(const QString &msg, const QString &context) { append(ImportLogEntry(ImportLogEntry::Debug, msg, context)); return *this; } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/importlogconverter.h0000644000015301777760000000400412321547255032633 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_BLACKBERRY_CASCADESPROJECTIMPORT_IMPORTLOGCONVERTER_H #define QNX_BLACKBERRY_CASCADESPROJECTIMPORT_IMPORTLOGCONVERTER_H #include "fileconverter.h" namespace Qnx { namespace Internal { class ImportLogConverter : public FileConverter { Q_DECLARE_TR_FUNCTIONS(ImportLogConverter); public: ImportLogConverter(ConvertedProjectContext &ctx); virtual ~ImportLogConverter() {} bool convertFile(Core::GeneratedFile &file, QString &errorMessage); }; } // namespace Internal } // namespace Qnx #endif // QNX_BLACKBERRY_CASCADESPROJECTIMPORT_IMPORTLOGCONVERTER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/cascadesimportwizard.h0000644000015301777760000000676012321547255033124 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_BLACKBERRY_CASCADESIMPORT_WIZARD_H #define QNX_BLACKBERRY_CASCADESIMPORT_WIZARD_H #include "fileconverter.h" #include #include namespace Utils { class ProjectIntroPage; } namespace Qnx { namespace Internal { class SrcProjectWizardPage; class CascadesImportWizardDialog : public Utils::Wizard { Q_OBJECT public: CascadesImportWizardDialog(QWidget *parent = 0); QString srcProjectPath() const; QString destProjectPath() const; QString projectName() const; private slots: void onSrcProjectPathChanged(const QString &path); private: SrcProjectWizardPage *m_srcProjectPage; Utils::ProjectIntroPage *m_destProjectPage; }; class CascadesImportWizard : public Core::BaseFileWizard { Q_OBJECT public: CascadesImportWizard(QObject *parent = 0); virtual ~CascadesImportWizard(); protected: ExtensionList selectExtensions(); QWizard* createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const; Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const; bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage); private: bool collectFiles(ConvertedProjectContext &projectContext, QString &errorMessage) const; void collectFiles_helper(QStringList &file_paths, ConvertedProjectContext &projectContext, const QString &rootPath, const QList< QRegExp > &blackList) const; bool convertFile(Core::GeneratedFile &file, ConvertedProjectContext &projectContext, QString &errorMessage) const; bool convertFilePath(Core::GeneratedFile &file, ConvertedProjectContext &projectContext, QString &errorMessage) const; bool convertFileContent(Core::GeneratedFile &file, ConvertedProjectContext &projectContext, QString &errorMessage) const; }; } // namespace Internal } // namespace Qnx #endif // QNX_BLACKBERRY_CASCADESIMPORT_WIZARD_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/cascadesimportwizard.cpp0000644000015301777760000002574612321547255033464 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "cascadesimportwizard.h" #include "srcprojectwizardpage.h" #include "bardescriptorconverter.h" #include "importlogconverter.h" #include "projectfileconverter.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace Qnx { namespace Internal { ////////////////////////////////////////////////////////////////////////////// // // CascadesImportWizardDialog // ////////////////////////////////////////////////////////////////////////////// CascadesImportWizardDialog::CascadesImportWizardDialog(QWidget *parent) : Utils::Wizard(parent) { setWindowTitle(tr("Import Existing Momentics Cascades Project")); m_srcProjectPage = new SrcProjectWizardPage(this); m_srcProjectPage->setTitle(tr("Momentics Cascades Project Name and Location")); m_destProjectPage = new Utils::ProjectIntroPage(this); m_destProjectPage->setTitle(tr("Project Name and Location")); m_destProjectPage->setPath(Core::DocumentManager::projectsDirectory()); const int srcProjectPageId = addPage(m_srcProjectPage); wizardProgress()->item(srcProjectPageId)->setTitle(tr("Momentics")); const int destProjectPageId = addPage(m_destProjectPage); wizardProgress()->item(destProjectPageId)->setTitle(tr("Qt Creator")); connect(m_srcProjectPage, SIGNAL(validPathChanged(QString)), this, SLOT(onSrcProjectPathChanged(QString))); } QString CascadesImportWizardDialog::srcProjectPath() const { return m_srcProjectPage->path(); } QString CascadesImportWizardDialog::destProjectPath() const { return m_destProjectPage->path() % QLatin1Char('/') % projectName(); } QString CascadesImportWizardDialog::projectName() const { return m_destProjectPage->projectName(); } void CascadesImportWizardDialog::onSrcProjectPathChanged(const QString &path) { Q_UNUSED(path); m_destProjectPage->setProjectName(m_srcProjectPage->projectName()); } ////////////////////////////////////////////////////////////////////////////// // // Wizard // ////////////////////////////////////////////////////////////////////////////// static const char IMPORT_LOG_FILE_NAME[] = "import.log"; CascadesImportWizard::CascadesImportWizard(QObject *parent) : Core::BaseFileWizard(parent) { setWizardKind(ProjectWizard); setIcon(QPixmap(QLatin1String(Qnx::Constants::QNX_BB_CATEGORY_ICON))); setDisplayName(tr("Momentics Cascades Project")); setId(QLatin1String("Q.QnxBlackBerryCascadesApp")); setRequiredFeatures(Core::FeatureSet(Constants::QNX_BB_FEATURE)); setDescription(tr("Imports existing Cascades projects created within QNX Momentics IDE. " "This allows you to use the project in Qt Creator.")); setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY)); setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY)); } CascadesImportWizard::~CascadesImportWizard() { } Core::BaseFileWizard::ExtensionList CascadesImportWizard::selectExtensions() { return Core::BaseFileWizard::ExtensionList(); } QWizard *CascadesImportWizard::createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const { CascadesImportWizardDialog *wizard = new CascadesImportWizardDialog(parent); foreach (QWizardPage *p, wizardDialogParameters.extensionPages()) BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p)); return wizard; } bool CascadesImportWizard::convertFile(Core::GeneratedFile &file, ConvertedProjectContext &projectContext, QString &errorMessage) const { bool ret = false; if (convertFileContent(file, projectContext, errorMessage)) if (convertFilePath(file, projectContext, errorMessage)) ret = true; return ret; } bool CascadesImportWizard::convertFileContent(Core::GeneratedFile &file, ConvertedProjectContext &projectContext, QString &errorMessage) const { QString filePath = file.path(); QString fileName = filePath.section(QLatin1Char('/'), -1); bool isRootFile = (fileName == filePath); QString fileExtension = fileName.section(QLatin1Char('.'), -1).toLower(); bool useFileConverter = true; if (isRootFile) { if (fileName == QLatin1String("bar-descriptor.xml")) { BarDescriptorConverter conv(projectContext); conv.convertFile(file, errorMessage); useFileConverter = false; } else if (fileName == QLatin1String(IMPORT_LOG_FILE_NAME)) { ImportLogConverter conv(projectContext); conv.convertFile(file, errorMessage); useFileConverter = false; } else if (fileExtension == QLatin1String("pro")) { ProjectFileConverter conv(projectContext); conv.convertFile(file, errorMessage); useFileConverter = false; } } if (useFileConverter) { FileConverter conv(projectContext); conv.convertFile(file, errorMessage); } return errorMessage.isEmpty(); } bool CascadesImportWizard::convertFilePath(Core::GeneratedFile &file, ConvertedProjectContext &projectContext, QString &errorMessage) const { Q_UNUSED(errorMessage); const QString destProjectPath = projectContext.destProjectPath(); file.setPath(destProjectPath % QLatin1Char('/') % file.path()); return true; } void CascadesImportWizard::collectFiles_helper(QStringList &filePaths, ConvertedProjectContext &projectContext, const QString &rootPath, const QList< QRegExp > &blackList) const { const QString srcProjectPath = projectContext.srcProjectPath(); bool isProjectRoot = (rootPath.length() == srcProjectPath.length()); QDirIterator it(rootPath, QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs); while (it.hasNext()) { it.next(); bool isBlacklisted = false; QString fileName = it.fileName(); foreach (const QRegExp &rx, blackList) { QString pattern = rx.pattern(); if (pattern.at(0) == QLatin1Char('/')) { if (isProjectRoot) { QString fn = QLatin1Char('/') % fileName; if (rx.exactMatch(fn)) { isBlacklisted = true; break; } } } else { if (rx.exactMatch(fileName)) { isBlacklisted = true; break; } } } if (!isBlacklisted) { QFileInfo fi = it.fileInfo(); if (fi.isFile()) filePaths << it.filePath().mid(srcProjectPath.length() + 1); else if (fi.isDir()) collectFiles_helper(filePaths, projectContext, it.filePath(), blackList); } } } bool CascadesImportWizard::collectFiles(ConvertedProjectContext &projectContext, QString &errorMessage) const { static QList blackList; if (blackList.isEmpty()) { blackList << QRegExp(QLatin1String("/arm"), Qt::CaseInsensitive, QRegExp::Wildcard) << QRegExp(QLatin1String("/x86"), Qt::CaseInsensitive, QRegExp::Wildcard) << QRegExp(QLatin1String("/translations"), Qt::CaseInsensitive, QRegExp::Wildcard) << QRegExp(QLatin1String("Makefile"), Qt::CaseInsensitive, QRegExp::Wildcard) << QRegExp(QLatin1String("Makefile.*"), Qt::CaseInsensitive, QRegExp::Wildcard) << QRegExp(QLatin1String("/config.pri"), Qt::CaseInsensitive, QRegExp::Wildcard) << QRegExp(QLatin1String("/precompiled.h"), Qt::CaseInsensitive, QRegExp::Wildcard); } QStringList filePaths; collectFiles_helper(filePaths, projectContext, projectContext.srcProjectPath(), blackList); filePaths << QLatin1String(IMPORT_LOG_FILE_NAME); projectContext.setCollectedFiles(filePaths); return errorMessage.isEmpty(); } Core::GeneratedFiles CascadesImportWizard::generateFiles(const QWizard *w, QString *pErrorMessage) const { Core::GeneratedFiles files; QString errorMessage; const CascadesImportWizardDialog *wizardDialog = qobject_cast(w); if (wizardDialog) { ConvertedProjectContext projectContext; projectContext.setSrcProjectPath(wizardDialog->srcProjectPath()); projectContext.setDestProjectPath(wizardDialog->destProjectPath()); if (collectFiles(projectContext, errorMessage)) { foreach (const QString &filePath, projectContext.collectedFiles()) { Core::GeneratedFile file(filePath); if (convertFile(file, projectContext, errorMessage)) { if (!file.path().isEmpty()) files << file; } if (!errorMessage.isEmpty()) { errorMessage = tr("Error generating file '%1': %2").arg(filePath).arg(errorMessage); break; } } } } if (!errorMessage.isEmpty()) if (pErrorMessage) *pErrorMessage = errorMessage; return files; } bool CascadesImportWizard::postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage) { Q_UNUSED(w); return ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/projectfileconverter.cpp0000644000015301777760000002055012321547255033464 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "projectfileconverter.h" #include #include #include #include #include namespace Qnx { namespace Internal { ////////////////////////////////////////////////////////////////////////////// // // ProjectFileConverter // ////////////////////////////////////////////////////////////////////////////// ProjectFileConverter::ProjectFileConverter(ConvertedProjectContext &ctx) : FileConverter(ctx) { } static QMap scanForDefinedVariables(const Core::GeneratedFile &file) { QMap ret; QString origContent = file.contents(); QStringList lines = origContent.split(QLatin1Char('\n'), QString::KeepEmptyParts); QString line; foreach (QString ln, lines) { ln = ln.trimmed(); if (ln.length() && (ln.at(0) == QLatin1Char('#'))) continue; if ((line.length() > 0) && (line.at(line.length() - 1) == QLatin1Char('\\'))) { line = line.mid(line.length() - 1); line += ln; } else { line = ln; } if ((line.length() > 0) && (line.at(line.length() - 1) != QLatin1Char('\\'))) { int ix1 = line.indexOf(QLatin1Char('=')); if (ix1 > 0) { int ix2 = (line.at(ix1 - 1) == QLatin1Char('+'))? ix1 - 1: ix1; QString k = line.mid(0, ix2).trimmed().toUpper(); QString v = line.mid(ix1 + 1).trimmed(); if (ix1 != ix2) v = ret.value(k) + QLatin1Char(' ') + v; ret[k] = v; } } } return ret; } static QSet parseVariable(const QString &varStr) { QStringList sl = varStr.split(QLatin1Char(' '), QString::SkipEmptyParts); QSet ret = QSet::fromList(sl); return ret; } static QString updateVariable(const QString &varStr, const QString &varsToAdd, const QString &varsToRemove) { QSet var = parseVariable(varStr); QSet ss = parseVariable(varsToAdd); foreach (QString s, ss) var << s; ss = parseVariable(varsToRemove); foreach (QString s, ss) var.remove(s); QStringList sl = QStringList::fromSet(var); return sl.join(QLatin1String(" ")); } bool ProjectFileConverter::convertFile(Core::GeneratedFile &file, QString &errorMessage) { if (!FileConverter::convertFile(file, errorMessage)) return false; ImportLog &log = convertedProjectContext().importLog(); QMap origProjectVariables = scanForDefinedVariables(file); QString fileContent; QLatin1String path( ":/qnx/cascadesimport/resources/templates/project.pro"); QByteArray ba = loadFileContent(path, errorMessage); if (!errorMessage.isEmpty()) return false; fileContent = QString::fromUtf8(ba); QStringList headers; QStringList sources; QStringList resources; QStringList otherFiles; QSet entries; foreach (const QString &filePath, convertedProjectContext().collectedFiles()) { QString ext = filePath.section(QLatin1Char('.'), -1); if (ext.compare(QLatin1String("c"), Qt::CaseInsensitive) == 0) sources << filePath; else if (ext.compare(QLatin1String("cc"), Qt::CaseInsensitive) == 0) sources << filePath; else if (ext.compare(QLatin1String("cpp"), Qt::CaseInsensitive) == 0) sources << filePath; else if (ext.compare(QLatin1String("h"), Qt::CaseInsensitive) == 0) headers << filePath; else if (ext.compare(QLatin1String("hh"), Qt::CaseInsensitive) == 0) headers << filePath; else if (ext.compare(QLatin1String("hpp"), Qt::CaseInsensitive) == 0) headers << filePath; else if (ext.compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) resources << filePath; else if (ext.compare(QLatin1String("qml"), Qt::CaseInsensitive) == 0) otherFiles << filePath; else if (ext.compare(QLatin1String("js"), Qt::CaseInsensitive) == 0) otherFiles << filePath; else if (ext.compare(QLatin1String("ts"), Qt::CaseInsensitive) == 0) otherFiles << filePath; else if (ext.compare(QLatin1String("pro"), Qt::CaseInsensitive) == 0) otherFiles << filePath; else if (filePath.compare(QLatin1String("bar-descriptor.xml"), Qt::CaseInsensitive) == 0) otherFiles << filePath; else if (filePath.startsWith(QLatin1String("assets/"), Qt::CaseInsensitive)) // include all the content of the assets directory otherFiles << filePath; else if (filePath.startsWith(QLatin1String("src/"), Qt::CaseInsensitive)) // include all the content of the src directory otherFiles << filePath; else if (ext.compare(QLatin1String("log"), Qt::CaseInsensitive) != 0) log.logWarning(tr("File '%1' not listed in '%2' file, should it be?") .arg(filePath).arg(file.path())); } fileContent.replace(QLatin1String("%HEADERS%"), headers.join(QLatin1String(" \\\n "))); fileContent.replace(QLatin1String("%SOURCES%"), sources.join(QLatin1String(" \\\n "))); fileContent.replace(QLatin1String("%RESOURCES%"), resources.join(QLatin1String(" \\\n "))); fileContent.replace(QLatin1String("%OTHER_FILES%"), otherFiles.join(QLatin1String(" \\\n "))); fileContent.replace(QLatin1String("%PROJECT_NAME%"), convertedProjectContext().projectName()); fileContent.replace(QLatin1String("%TARGET%"), origProjectVariables.value(QLatin1String("TARGET"), convertedProjectContext().projectName())); fileContent.replace(QLatin1String("%EXTRA_LIBS%"), origProjectVariables.value(QLatin1String("LIBS"))); fileContent.replace(QLatin1String("%IMPORTER_VERSION%"), QLatin1String(Qnx::Constants::QNX_BLACKBERRY_CASCADESIMPORTER_VERSION)); fileContent.replace(QLatin1String("%DATE_TIME%"), QDateTime::currentDateTime().toString(Qt::ISODate)); fileContent.replace(QLatin1String("%QT%"), updateVariable(origProjectVariables.value(QLatin1String("QT")), QLatin1String("declarative script svg sql network xml xmlpatterns"), QString() )); fileContent.replace(QLatin1String("%CONFIG%"), updateVariable(origProjectVariables.value(QLatin1String("CONFIG")), QLatin1String("qt warn_on"), QLatin1String("debug release debug_and_release cascades cascades10") )); fileContent.replace(QLatin1String("%MOBILITY%"), origProjectVariables.value(QLatin1String("MOBILITY"))); file.setContents(fileContent); file.setAttributes(file.attributes() | Core::GeneratedFile::OpenProjectAttribute); return errorMessage.isEmpty(); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/srcprojectwizardpage.ui0000644000015301777760000000216112321547255033313 0ustar pbusernogroup00000000000000 Qnx::Internal::SrcProjectWizardPage 0 0 520 147 Choose the Location QFormLayout::ExpandingFieldsGrow Project path: Utils::PathChooser QWidget
utils/pathchooser.h
1
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/bardescriptorconverter.h0000644000015301777760000000645512321547255033476 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_BLACKBERRY_CASCADESPROJECTIMPORT_BARDESCRIPTORCONVERTER_H #define QNX_BLACKBERRY_CASCADESPROJECTIMPORT_BARDESCRIPTORCONVERTER_H #include "fileconverter.h" #include QT_BEGIN_NAMESPACE class QDomElement; class QDomDocument; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BarDescriptorConverter : public FileConverter { Q_DECLARE_TR_FUNCTIONS(BarDescriptorConverter); public: BarDescriptorConverter(ConvertedProjectContext &ctx); virtual ~BarDescriptorConverter() {} bool convertFile(Core::GeneratedFile &file, QString &errorMessage); private: QString projectName() const; QString applicationBinaryName() const; QString applicationBinaryPath() const; QDomElement findElement(QDomDocument &doc, const QString &tagName, const QString &attributeName, const QString &attributeValue); QDomElement ensureElement(QDomDocument &doc, const QString &tagName, const QString &attributeName, const QString &attributeValue); QDomElement removeElement(QDomDocument &doc, const QString &tagName, const QString &attributeName, const QString &attributeValue); void fixImageAsset(QDomDocument &doc, const QString &definitionElementName); void fixIconAsset(QDomDocument &doc); void fixSplashScreensAsset(QDomDocument &doc); void setEnv(QDomDocument &doc, const QString &name, const QString &value); void setAsset(QDomDocument &doc, const QString &srcPath, const QString &destPath, const QString &type = QString(), bool isEntry = false); void removeAsset(QDomDocument &doc, const QString &srcPath); void replaceAssetSourcePath(QDomDocument &doc, const QString &oldSrcPath, const QString &newSrcPath); }; } // namespace Internal } // namespace Qnx #endif // QNX_BLACKBERRY_CASCADESPROJECTIMPORT_BARDESCRIPTORCONVERTER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/resources/0000755000015301777760000000000012321547742030533 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/resources/templates/0000755000015301777760000000000012321547742032531 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/resources/templates/project.proqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/resources/templates/proje0000644000015301777760000000203612321547255033573 0ustar pbusernogroup00000000000000#======================================================================================== # generated by CascadesProjectImporter ver. %IMPORTER_VERSION% - %DATE_TIME% #======================================================================================== TEMPLATE = app TARGET = %TARGET% CONFIG += %CONFIG% # For cascades integration, some additional libraries are needed # and the library path needs to be set LIBS += -lbb -lbbcascades LIBS += %EXTRA_LIBS% QT -= gui QT += %QT% MOBILITY += %MOBILITY% QMAKE_CFLAGS += -Wno-psabi QMAKE_CXXFLAGS += -Wno-psabi CONFIG(release, debug|release) { zygotize { TEMPLATE = lib QMAKE_CFLAGS += -fstack-protector-strong -fvisibility=hidden -mthumb -Os QMAKE_CXXFLAGS += -fstack-protector-strong -fvisibility=hidden -mthumb -Os QMAKE_LFLAGS += -Wl,-z,relro DEFINES += _FORTIFY_SOURCE=2 } } INCLUDEPATH += src HEADERS += \ %HEADERS% SOURCES += \ %SOURCES% RESOURCES += \ %RESOURCES% OTHER_FILES += \ bar-descriptor.xml \ %OTHER_FILES% qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/cascadesimport.pri0000644000015301777760000000111612321547255032234 0ustar pbusernogroup00000000000000SOURCES += \ $$PWD/cascadesimportwizard.cpp \ $$PWD/srcprojectwizardpage.cpp \ $$PWD/fileconverter.cpp \ $$PWD/bardescriptorconverter.cpp \ $$PWD/projectfileconverter.cpp \ $$PWD/importlogconverter.cpp \ $$PWD/importlog.cpp \ HEADERS += \ $$PWD/cascadesimportwizard.h \ $$PWD/srcprojectwizardpage.h \ $$PWD/fileconverter.h \ $$PWD/bardescriptorconverter.h \ $$PWD/projectfileconverter.h \ $$PWD/importlogconverter.h \ $$PWD/importlog.h \ FORMS += \ $$PWD/srcprojectwizardpage.ui \ RESOURCES += \ $$PWD/cascadesimport.qrc \ qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/cascadesimport/projectfileconverter.h0000644000015301777760000000425212321547255033132 0ustar pbusernogroup00000000000000/**************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_BLACKBERRY_CASCADESPROJECTIMPORT_PROJECTFILECONVERTER_H #define QNX_BLACKBERRY_CASCADESPROJECTIMPORT_PROJECTFILECONVERTER_H #include "fileconverter.h" #include #include #include namespace Qnx { namespace Internal { class ProjectFileConverter : public FileConverter { Q_DECLARE_TR_FUNCTIONS(ProjectFileConverter); public: ProjectFileConverter(ConvertedProjectContext &ctx); virtual ~ProjectFileConverter() {} bool convertFile(Core::GeneratedFile &file, QString &errorMessage); private: QMap definedVariables(const Core::GeneratedFile &file); }; } // namespace Internal } // namespace Qnx #endif // QNX_BLACKBERRY_CASCADESPROJECTIMPORT_PROJECTFILECONVERTER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryinstallwizardpages.h0000644000015301777760000001210312321547255031635 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYINSTALLWIZARDPAGES_H #define QNX_INTERNAL_BLACKBERRYINSTALLWIZARDPAGES_H #include #include #include "blackberryinstallwizard.h" #include QT_BEGIN_NAMESPACE class QProcess; class QRadioButton; class QVBoxLayout; QT_END_NAMESPACE namespace Qnx { namespace Internal { class Ui_BlackBerryInstallWizardNdkPage; class Ui_BlackBerryInstallWizardTargetPage; class Ui_BlackBerryInstallWizardProcessPage; class NdkPathChooser : public Utils::PathChooser { Q_OBJECT public: enum Mode { InstallMode, // Select a valid 10.2 NDK path ManualMode // Select a target bbnk-env file path }; NdkPathChooser(Mode mode, QWidget *parent = 0); virtual bool validatePath(const QString &path, QString *errorMessage); private: Mode m_mode; }; class BlackBerryInstallWizardOptionPage : public QWizardPage { Q_OBJECT public: explicit BlackBerryInstallWizardOptionPage(BlackBerryInstallerDataHandler &data, QWidget *parent = 0); void initializePage(); bool isComplete() const; int nextId() const; protected slots: void handleOptionChanged(); void handlePathChanged(const QString &envFilePath); signals: void installModeChanged(); private: QVBoxLayout *m_layout; QRadioButton* m_installButton; QRadioButton* m_addButton; NdkPathChooser* m_envFileChooser; BlackBerryInstallerDataHandler &m_data; }; class BlackBerryInstallWizardNdkPage : public QWizardPage { Q_OBJECT public: explicit BlackBerryInstallWizardNdkPage(BlackBerryInstallerDataHandler &data, QWidget *parent = 0); ~BlackBerryInstallWizardNdkPage(); void initializePage(); bool isComplete() const; protected slots: void setNdkPath(); void setManualNdkPath(); private: Ui_BlackBerryInstallWizardNdkPage *m_ui; BlackBerryInstallerDataHandler &m_data; NdkPathChooser* m_ndkPathChooser; QListWidgetItem* m_manual; bool m_validNdkPath; }; class BlackBerryInstallWizardTargetPage : public QWizardPage { Q_OBJECT public: explicit BlackBerryInstallWizardTargetPage(BlackBerryInstallerDataHandler &data, QWidget *parent = 0); ~BlackBerryInstallWizardTargetPage(); void initializePage(); bool isComplete() const; bool isProcessRunning() const; protected slots: void targetsListProcessFinished(); void setTarget(); private: BlackBerryInstallerDataHandler &m_data; Ui_BlackBerryInstallWizardTargetPage *m_ui; bool m_isTargetValid; QProcess *m_targetListProcess; void initTargetsTreeWidget(); void updateAvailableTargetsList(); }; class BlackBerryInstallWizardProcessPage : public QWizardPage { Q_OBJECT public: explicit BlackBerryInstallWizardProcessPage(BlackBerryInstallerDataHandler &data, QWidget *parent = 0); ~BlackBerryInstallWizardProcessPage(); void initializePage(); bool isComplete() const; bool isProcessRunning() const; protected slots: void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); private: Ui_BlackBerryInstallWizardProcessPage *m_ui; BlackBerryInstallerDataHandler &m_data; QProcess *m_targetProcess; void processTarget(); }; class BlackBerryInstallWizardFinalPage : public QWizardPage { Q_OBJECT public: explicit BlackBerryInstallWizardFinalPage(BlackBerryInstallerDataHandler &data, QWidget *parent = 0); void initializePage(); signals: void done(); private: BlackBerryInstallerDataHandler &m_data; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYINSTALLWIZARDPAGES_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycertificate.cpp0000644000015301777760000001336512321547255030556 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberrycertificate.h" #include "blackberryconfiguration.h" #include "blackberryconfigurationmanager.h" #include "blackberryndkprocess.h" #include #include #include #include #include namespace Qnx { namespace Internal { BlackBerryCertificate::BlackBerryCertificate(const QString &fileName, const QString &author, const QString &storePass, QObject *parent) : QObject(parent), m_fileName(fileName), m_author(author), m_storePass(storePass), m_process(new QProcess(this)) { m_process->setProcessChannelMode(QProcess::MergedChannels); m_process->setEnvironment(Utils::EnvironmentItem::toStringList( BlackBerryConfigurationManager::instance().defaultQnxEnv())); } void BlackBerryCertificate::load() { if (m_process->state() != QProcess::NotRunning) { emit finished(BlackBerryCertificate::Busy); return; } QStringList arguments; arguments << QLatin1String("-keystore") << m_fileName << QLatin1String("-list") << QLatin1String("-verbose") << QLatin1String("-storepass") << m_storePass; connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(loadFinished())); connect(m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError())); m_process->start(command(), arguments); } void BlackBerryCertificate::store() { if (m_process->state() != QProcess::NotRunning) { emit finished(BlackBerryCertificate::Busy); return; } QFile file(m_fileName); if (file.exists()) file.remove(); QStringList arguments; arguments << QLatin1String("-genkeypair") << QLatin1String("-storepass") << m_storePass << QLatin1String("-author") << m_author << QLatin1String("-keystore") << m_fileName; connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(storeFinished(int))); connect(m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError())); m_process->start(command(), arguments); } QString BlackBerryCertificate::fileName() const { return m_fileName; } QString BlackBerryCertificate::author() const { return m_author; } QString BlackBerryCertificate::id() const { QString tmpId = fileName(); return tmpId.replace(QLatin1Char('/'), QLatin1Char('-')); } void BlackBerryCertificate::storeFinished(int status) { m_process->disconnect(); if (status == 0) emit finished(BlackBerryCertificate::Success); else emit finished(BlackBerryCertificate::Error); } void BlackBerryCertificate::loadFinished() { m_process->disconnect(); ResultCode status = Error; QTextStream processOutput(m_process); while (!processOutput.atEnd()) { QString chunk = processOutput.readLine(); if (chunk.contains(QLatin1String("invalid password"))) { status = WrongPassword; break; } else if (chunk.contains(QLatin1String("must be at least 6 characters"))) { status = PasswordTooSmall; break; } else if (chunk.startsWith(QLatin1String("Owner:"))) { chunk.remove(QLatin1String("Owner:")); m_author = chunk.remove(QLatin1String("CN=")).trimmed(); status = Success; break; } else if (chunk.contains(QLatin1String("Subject Name:"))) { // this format is used by newer NDKs, the interesting data // comes on the next line chunk = processOutput.readLine(); const QString token = QLatin1String("CommonName="); if (chunk.contains(token)) { m_author = chunk.remove(token).trimmed(); status = Success; } else { status = InvalidOutputFormat; } break; } } emit finished(status); } void BlackBerryCertificate::processError() { m_process->disconnect(); emit finished(Error); } QString BlackBerryCertificate::command() const { return BlackBerryNdkProcess::resolveNdkToolPath(QLatin1String("blackberry-keytool")); } } // namespace Internal } // namespace Qnx qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeploystepfactory.h0000644000015301777760000000532012321547255030177 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H #define QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H #include namespace Qnx { namespace Internal { class QnxDeployStepFactory : public ProjectExplorer::IBuildStepFactory { Q_OBJECT public: explicit QnxDeployStepFactory(); QList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrylogprocessrunner.h0000644000015301777760000000474512321547255031355 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYSLOGPROCESS_H #define BLACKBERRYSLOGPROCESS_H #include "blackberrydeviceconfiguration.h" #include #include namespace ProjectExplorer { class SshDeviceProcess; } namespace Qnx { namespace Internal { class Slog2InfoRunner; class BlackBerryLogProcessRunner : public QObject { Q_OBJECT public: explicit BlackBerryLogProcessRunner(QObject *parent, const QString &appId, const BlackBerryDeviceConfiguration::ConstPtr &device); void start(); signals: void output(const QString &msg, Utils::OutputFormat format); void finished(); public slots: void stop(); private slots: void launchTailProcess(); void readTailStandardOutput(); void readTailStandardError(); void handleTailProcessError(); private: QString m_appId; BlackBerryDeviceConfiguration::ConstPtr m_device; ProjectExplorer::SshDeviceProcess *m_tailProcess; Slog2InfoRunner *m_slog2InfoRunner; }; } // namespace Internal } // namespace Qnx #endif // BLACKBERRYSLOGPROCESS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryruncontrol.cpp0000644000015301777760000000546212321547255030500 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "blackberryruncontrol.h" #include "blackberryapplicationrunner.h" #include "blackberryrunconfiguration.h" #include "blackberrydeviceconnectionmanager.h" #include #include using namespace Qnx; using namespace Qnx::Internal; BlackBerryRunControl::BlackBerryRunControl(BlackBerryRunConfiguration *runConfiguration) : ProjectExplorer::RunControl(runConfiguration, ProjectExplorer::NormalRunMode) { m_runner = new BlackBerryApplicationRunner(false, runConfiguration, this); connect(m_runner, SIGNAL(started()), this, SIGNAL(started())); connect(m_runner, SIGNAL(finished()), this, SIGNAL(finished())); connect(m_runner, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat))); connect(m_runner, SIGNAL(startFailed(QString)), this, SLOT(handleStartFailed(QString))); } void BlackBerryRunControl::start() { m_runner->start(); } ProjectExplorer::RunControl::StopResult BlackBerryRunControl::stop() { return m_runner->stop(); } bool BlackBerryRunControl::isRunning() const { return m_runner->isRunning(); } QIcon BlackBerryRunControl::icon() const { return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL)); } void BlackBerryRunControl::handleStartFailed(const QString &message) { appendMessage(message, Utils::StdErrFormat); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorwidget.h0000644000015301777760000001017612321547255031153 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTOREDITORWIDGET_H #define QNX_INTERNAL_BARDESCRIPTOREDITORWIDGET_H #include "bardescriptordocument.h" #include namespace Core { class IEditor; } namespace ProjectExplorer { class PanelsWidget; } namespace TextEditor { class PlainTextEditorWidget; class TextEditorActionHandler; class BaseTextEditorWidget; } namespace Qnx { namespace Internal { class BarDescriptorEditor; class BarDescriptorEditorEntryPointWidget; class BarDescriptorEditorPackageInformationWidget; class BarDescriptorEditorAuthorInformationWidget; class BarDescriptorEditorGeneralWidget; class BarDescriptorEditorPermissionsWidget; class BarDescriptorEditorEnvironmentWidget; class BarDescriptorEditorAssetsWidget; class BarDescriptorEditorWidget : public QStackedWidget { Q_OBJECT public: explicit BarDescriptorEditorWidget(QWidget *parent, TextEditor::TextEditorActionHandler *handler); Core::IEditor *editor() const; BarDescriptorEditorEntryPointWidget *entryPointWidget() const; BarDescriptorEditorPackageInformationWidget *packageInformationWidget() const; BarDescriptorEditorAuthorInformationWidget *authorInformationWidget() const; BarDescriptorEditorGeneralWidget *generalWidget() const; BarDescriptorEditorPermissionsWidget *permissionsWidget() const; BarDescriptorEditorEnvironmentWidget *environmentWidget() const; BarDescriptorEditorAssetsWidget *assetsWidget() const; TextEditor::BaseTextEditorWidget *sourceWidget() const; void setFilePath(const QString &filePath); QString xmlSource() const; void setXmlSource(const QString &xmlSource); bool isDirty() const; void clear(); public slots: void setDirty(bool dirty = true); signals: void changed(); private: BarDescriptorEditor *createEditor(); void initGeneralPage(); void initApplicationPage(); void initAssetsPage(); void initSourcePage(); void initPanelSize(ProjectExplorer::PanelsWidget *panelsWidget); mutable Core::IEditor *m_editor; TextEditor::TextEditorActionHandler *m_handler; bool m_dirty; // New UI BarDescriptorEditorEntryPointWidget *m_entryPointWidget; BarDescriptorEditorPackageInformationWidget *m_packageInformationWidget; BarDescriptorEditorAuthorInformationWidget *m_authorInformationWidget; BarDescriptorEditorGeneralWidget *m_generalWidget; BarDescriptorEditorPermissionsWidget *m_permissionsWidget; BarDescriptorEditorEnvironmentWidget *m_environmentWidget; BarDescriptorEditorAssetsWidget *m_assetsWidget; TextEditor::PlainTextEditorWidget *m_xmlSourceWidget; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTOREDITORWIDGET_H ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorauthorinformationwidget.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorauthorinformationwidg0000644000015301777760000001077112321547255034066 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "bardescriptoreditorauthorinformationwidget.h" #include "ui_bardescriptoreditorauthorinformationwidget.h" #include "blackberrydebugtokenreader.h" #include "blackberrydeviceconfiguration.h" #include "qnxconstants.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; BarDescriptorEditorAuthorInformationWidget::BarDescriptorEditorAuthorInformationWidget(QWidget *parent) : BarDescriptorEditorAbstractPanelWidget(parent), m_ui(new Ui::BarDescriptorEditorAuthorInformationWidget) { m_ui->setupUi(this); m_ui->setFromDebugToken->setVisible(BlackBerryDebugTokenReader::isSupported()); connect(m_ui->author, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); connect(m_ui->authorId, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); connect(m_ui->setFromDebugToken, SIGNAL(clicked()), this, SLOT(setAuthorFromDebugToken())); } BarDescriptorEditorAuthorInformationWidget::~BarDescriptorEditorAuthorInformationWidget() { delete m_ui; } void BarDescriptorEditorAuthorInformationWidget::clear() { setLineEditBlocked(m_ui->author, QString()); setLineEditBlocked(m_ui->authorId, QString()); } QString BarDescriptorEditorAuthorInformationWidget::author() const { return m_ui->author->text(); } void BarDescriptorEditorAuthorInformationWidget::setAuthor(const QString &author) { setLineEditBlocked(m_ui->author, author); } QString BarDescriptorEditorAuthorInformationWidget::authorId() const { return m_ui->authorId->text(); } void BarDescriptorEditorAuthorInformationWidget::setAuthorId(const QString &authorId) { setLineEditBlocked(m_ui->authorId, authorId); } void BarDescriptorEditorAuthorInformationWidget::setAuthorFromDebugToken() { // To select debug token, make it fancier once the debug token management is done in // Qt Creator QStringList debugTokens; ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance(); for (int i = 0; i < deviceManager->deviceCount(); ++i) { ProjectExplorer::IDevice::ConstPtr device = deviceManager->deviceAt(i); if (device->type() == Core::Id(Constants::QNX_BB_OS_TYPE)) { BlackBerryDeviceConfiguration::ConstPtr bbDevice = device.dynamicCast(); QTC_ASSERT(bbDevice, continue); debugTokens << bbDevice->debugToken(); } } debugTokens.removeDuplicates(); bool ok; QString debugToken = QInputDialog::getItem(this, tr("Select Debug Token"), tr("Debug token:"), debugTokens, 0, false, &ok); if (!ok || debugToken.isEmpty()) return; BlackBerryDebugTokenReader debugTokenReader(debugToken); if (!debugTokenReader.isValid()) { QMessageBox::warning(this, tr("Error Reading Debug Token"), tr("There was a problem reading debug token.")); return; } m_ui->author->setText(debugTokenReader.author()); m_ui->authorId->setText(debugTokenReader.authorId()); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysigningpasswordsdialog.ui0000644000015301777760000000465112321547255032711 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerrySigningPasswordsDialog 0 0 313 89 Package signing passwords CSK password: QLineEdit::Password Keystore password: QLineEdit::Password Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() Qnx::Internal::BlackBerrySigningPasswordsDialog accept() 248 254 157 274 buttonBox rejected() Qnx::Internal::BlackBerrySigningPasswordsDialog reject() 316 260 286 274 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdebugsupport.cpp0000644000015301777760000001667712321547255027516 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdebugsupport.h" #include "qnxconstants.h" #include "qnxdeviceconfiguration.h" #include "qnxrunconfiguration.h" #include "slog2inforunner.h" #include #include #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace RemoteLinux; using namespace Qnx; using namespace Qnx::Internal; QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::DebuggerEngine *engine) : QnxAbstractRunSupport(runConfig, engine) , m_engine(engine) , m_pdebugPort(-1) , m_qmlPort(-1) , m_useCppDebugger(runConfig->extraAspect()->useCppDebugger()) , m_useQmlDebugger(runConfig->extraAspect()->useQmlDebugger()) { const DeviceApplicationRunner *runner = appRunner(); connect(runner, SIGNAL(reportError(QString)), SLOT(handleError(QString))); connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); connect(runner, SIGNAL(finished(bool)), SLOT(handleRemoteProcessFinished(bool))); connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleAdapterSetupRequested())); const QString applicationId = QFileInfo(runConfig->remoteExecutableFilePath()).fileName(); ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit()); QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast(); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(handleApplicationOutput(QString,Utils::OutputFormat))); connect(runner, SIGNAL(remoteProcessStarted()), m_slog2Info, SLOT(start())); if (qnxDevice->qnxVersion() > 0x060500) connect(m_slog2Info, SIGNAL(commandMissing()), this, SLOT(printMissingWarning())); } void QnxDebugSupport::handleAdapterSetupRequested() { QTC_ASSERT(state() == Inactive, return); if (m_engine) m_engine->showMessage(tr("Preparing remote side...") + QLatin1Char('\n'), Debugger::AppStuff); QnxAbstractRunSupport::handleAdapterSetupRequested(); } void QnxDebugSupport::startExecution() { if (state() == Inactive) return; if (m_useCppDebugger && !setPort(m_pdebugPort)) return; if (m_useQmlDebugger && !setPort(m_qmlPort)) return; setState(StartingRemoteProcess); if (m_useQmlDebugger) m_engine->startParameters().processArgs += QString::fromLatin1(" -qmljsdebugger=port:%1,block").arg(m_qmlPort); QStringList arguments; if (m_useCppDebugger) arguments << QString::number(m_pdebugPort); else if (m_useQmlDebugger && !m_useCppDebugger) arguments = Utils::QtcProcess::splitArgs(m_engine->startParameters().processArgs); appRunner()->setEnvironment(environment()); appRunner()->setWorkingDirectory(workingDirectory()); appRunner()->start(device(), executable(), arguments); } void QnxDebugSupport::handleRemoteProcessStarted() { QnxAbstractRunSupport::handleRemoteProcessStarted(); if (m_engine) m_engine->notifyEngineRemoteSetupDone(m_pdebugPort, m_qmlPort); } void QnxDebugSupport::handleRemoteProcessFinished(bool success) { if (m_engine || state() == Inactive) return; if (state() == Running) { if (!success) m_engine->notifyInferiorIll(); } else { const QString errorMsg = tr("The %1 process closed unexpectedly.").arg(executable()); m_engine->notifyEngineRemoteSetupFailed(errorMsg); } } void QnxDebugSupport::handleDebuggingFinished() { // setFinished() will kill "pdebug", but we also have to kill // the inferior process, as invoking "kill" in gdb doesn't work // on QNX gdb setFinished(); m_slog2Info->stop(); killInferiorProcess(); } QString QnxDebugSupport::executable() const { return m_useCppDebugger? QLatin1String(Constants::QNX_DEBUG_EXECUTABLE) : QnxAbstractRunSupport::executable(); } void QnxDebugSupport::killInferiorProcess() { device()->signalOperation()->killProcess(QnxAbstractRunSupport::executable()); } void QnxDebugSupport::handleProgressReport(const QString &progressOutput) { if (m_engine) m_engine->showMessage(progressOutput + QLatin1Char('\n'), Debugger::AppStuff); } void QnxDebugSupport::handleRemoteOutput(const QByteArray &output) { QTC_ASSERT(state() == Inactive || state() == Running, return); if (m_engine) m_engine->showMessage(QString::fromUtf8(output), Debugger::AppOutput); } void QnxDebugSupport::handleError(const QString &error) { if (state() == Running) { if (m_engine) { m_engine->showMessage(error, Debugger::AppError); m_engine->notifyInferiorIll(); } } else if (state() != Inactive) { setFinished(); if (m_engine) m_engine->notifyEngineRemoteSetupFailed(tr("Initial setup failed: %1").arg(error)); } } void QnxDebugSupport::printMissingWarning() { if (m_engine) m_engine->showMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available!"), Debugger::AppError); } void QnxDebugSupport::handleApplicationOutput(const QString &msg, Utils::OutputFormat outputFormat) { Q_UNUSED(outputFormat); if (m_engine) m_engine->showMessage(msg, Debugger::AppOutput); } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryinstallwizardtargetpage.ui0000644000015301777760000000160312321547255033052 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryInstallWizardTargetPage 0 0 543 373 Form Please select target: 1 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryqtversion.h0000644000015301777760000000516612321547255027773 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYQTVERSION_H #define QNX_INTERNAL_BLACKBERRYQTVERSION_H #include "qnxconstants.h" #include "qnxabstractqtversion.h" namespace Qnx { namespace Internal { class BlackBerryQtVersion : public QnxAbstractQtVersion { Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryQtVersion) public: BlackBerryQtVersion(); BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected = false, const QString &autoDetectionSource = QString(), const QString &sdkPath = QString()); BlackBerryQtVersion *clone() const; ~BlackBerryQtVersion(); QString type() const; QString description() const; QVariantMap toMap() const; void fromMap(const QVariantMap &map); Core::FeatureSet availableFeatures() const; QString platformName() const; QString platformDisplayName() const; QString sdkDescription() const; private: QList environment() const; void setDefaultSdkPath(); QString m_ndkEnvFile; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYQTVERSION_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceprocesslist.cpp0000644000015301777760000000571312321547255030512 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry Limited (blackberry-qt@qnx.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxdeviceprocesslist.h" #include #include using namespace Qnx; using namespace Qnx::Internal; QnxDeviceProcessList::QnxDeviceProcessList( const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent) : ProjectExplorer::SshDeviceProcessList(device, parent) { } QString QnxDeviceProcessList::listProcessesCommandLine() const { return QLatin1String("pidin -F \"%a %A '/%n'\""); } QList QnxDeviceProcessList::buildProcessList( const QString &listProcessesReply) const { QList processes; QStringList lines = listProcessesReply.split(QLatin1Char('\n')); if (lines.isEmpty()) return processes; lines.pop_front(); // drop headers QRegExp re(QLatin1String("\\s*(\\d+)\\s+(.*)'(.*)'")); foreach (const QString& line, lines) { if (re.exactMatch(line)) { const QStringList captures = re.capturedTexts(); if (captures.size() == 4) { const int pid = captures[1].toInt(); const QString args = captures[2]; const QString exe = captures[3]; ProjectExplorer::DeviceProcessItem deviceProcess; deviceProcess.pid = pid; deviceProcess.exe = exe.trimmed(); deviceProcess.cmdLine = args.trimmed(); processes.append(deviceProcess); } } } qSort(processes); return processes; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptordocumentnodehandlers.h0000644000015301777760000002326312321547255032667 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTORDOCUMENTNODEHANDLERS_H #define QNX_INTERNAL_BARDESCRIPTORDOCUMENTNODEHANDLERS_H #include #include namespace Qnx { namespace Internal { class BarDescriptorEditorWidget; class BarDescriptorEditorAssetsWidget; class BarDescriptorEditorAuthorInformationWidget; class BarDescriptorEditorEntryPointWidget; class BarDescriptorEditorEnvironmentWidget; class BarDescriptorEditorGeneralWidget; class BarDescriptorEditorPackageInformationWidget; class BarDescriptorEditorPermissionsWidget; class BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentAbstractNodeHandler(BarDescriptorEditorWidget *editorWidget); virtual ~BarDescriptorDocumentAbstractNodeHandler(); virtual bool canHandle(const QDomNode &node) const = 0; bool handle(const QDomNode &node); virtual QDomNode toNode(QDomDocument &doc) const = 0; void clear(); int order() const; protected: BarDescriptorEditorPackageInformationWidget *packageInformationWidget() const; BarDescriptorEditorAuthorInformationWidget *authorInformationWidget() const; BarDescriptorEditorEntryPointWidget *entryPointWidget() const; BarDescriptorEditorGeneralWidget *generalWidget() const; BarDescriptorEditorPermissionsWidget *permissionsWidget() const; BarDescriptorEditorEnvironmentWidget *environmentWidget() const; BarDescriptorEditorAssetsWidget *assetsWidget() const; virtual bool fromNode(const QDomNode &node) = 0; bool canHandleSimpleTextElement(const QDomNode &node, const QString &tagName) const; QString loadSimpleTextElement(const QDomNode &node); QDomElement createSimpleTextElement(QDomDocument &doc, const QString &tagName, const QString &textValue) const; private: BarDescriptorEditorWidget *m_editorWidget; int m_order; }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentIdNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentIdNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentVersionNumberNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentVersionNumberNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentBuildIdNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentBuildIdNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentApplicationNameNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentApplicationNameNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentApplicationDescriptionNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentApplicationDescriptionNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentApplicationIconNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentApplicationIconNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentSplashScreenNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentSplashScreenNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentAssetNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentAssetNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentInitialWindowNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentInitialWindowNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentActionNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentActionNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentArgNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentArgNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentEnvNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentEnvNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentAuthorNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentAuthorNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentAuthorIdNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentAuthorIdNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); }; // ---------------------------------------------------------------------------- class BarDescriptorDocumentUnknownNodeHandler : public BarDescriptorDocumentAbstractNodeHandler { public: BarDescriptorDocumentUnknownNodeHandler(BarDescriptorEditorWidget *editorWidget); bool canHandle(const QDomNode &node) const; QDomNode toNode(QDomDocument &doc) const; protected: bool fromNode(const QDomNode &node); private: QDomNode m_node; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTORDOCUMENTNODEHANDLERS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxrunconfiguration.cpp0000644000015301777760000000710412321547255030350 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxrunconfiguration.h" #include "qnxconstants.h" #include #include #include #include using namespace Qnx; using namespace Qnx::Internal; namespace { const char QtLibPathKey[] = "Qt4ProjectManager.QnxRunConfiguration.QtLibPath"; } QnxRunConfiguration::QnxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &proFilePath) : RemoteLinux::RemoteLinuxRunConfiguration(parent, id, proFilePath) { } QnxRunConfiguration::QnxRunConfiguration(ProjectExplorer::Target *parent, QnxRunConfiguration *source) : RemoteLinux::RemoteLinuxRunConfiguration(parent, source) , m_qtLibPath(source->m_qtLibPath) { } void QnxRunConfiguration::setQtLibPath(const QString &path) { m_qtLibPath = path; } Utils::Environment QnxRunConfiguration::environment() const { Utils::Environment env = RemoteLinuxRunConfiguration::environment(); if (!m_qtLibPath.isEmpty()) { env.appendOrSet(QLatin1String("LD_LIBRARY_PATH"), m_qtLibPath + QLatin1String(":$LD_LIBRARY_PATH")); } return env; } QWidget *QnxRunConfiguration::createConfigurationWidget() { RemoteLinux::RemoteLinuxRunConfigurationWidget *rcWidget = qobject_cast(RemoteLinux::RemoteLinuxRunConfiguration::createConfigurationWidget()); QLabel *label = new QLabel(tr("Path to Qt libraries on device:")); QLineEdit *lineEdit = new QLineEdit(m_qtLibPath); connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(setQtLibPath(QString))); rcWidget->addFormLayoutRow(label, lineEdit); return rcWidget; } QVariantMap QnxRunConfiguration::toMap() const { QVariantMap map(RemoteLinux::RemoteLinuxRunConfiguration::toMap()); map.insert(QLatin1String(QtLibPathKey), m_qtLibPath); return map; } bool QnxRunConfiguration::fromMap(const QVariantMap &map) { if (!RemoteLinux::RemoteLinuxRunConfiguration::fromMap(map)) return false; setQtLibPath(map.value(QLatin1String(QtLibPathKey)).toString()); return true; } qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrycreatepackagestepfactory.h0000644000015301777760000000543312321547255033001 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPFACTORY_H #define QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPFACTORY_H #include namespace Qnx { namespace Internal { class BlackBerryCreatePackageStepFactory : public ProjectExplorer::IBuildStepFactory { Q_OBJECT public: explicit BlackBerryCreatePackageStepFactory(QObject *parent = 0); ~BlackBerryCreatePackageStepFactory(); QList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QString displayNameForId(const Core::Id id) const; bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxruncontrolfactory.h0000644000015301777760000000426412321547255030222 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXRUNCONTROLFACTORY_H #define QNX_INTERNAL_QNXRUNCONTROLFACTORY_H #include namespace Qnx { namespace Internal { class QnxRunControlFactory : public ProjectExplorer::IRunControlFactory { Q_OBJECT public: explicit QnxRunControlFactory(QObject *parent = 0); bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, QString *errorMessage); }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXRUNCONTROLFACTORY_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrysigningutils.h0000644000015301777760000000531612321547255030455 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYSIGNINGUTILS_H #define QNX_INTERNAL_BLACKBERRYSIGNINGUTILS_H #include #include QT_BEGIN_NAMESPACE class QString; QT_END_NAMESPACE namespace Qnx { namespace Internal { class BlackBerryCertificate; class BlackBerrySigningUtils : public QObject { Q_OBJECT public: static BlackBerrySigningUtils &instance(); bool hasRegisteredKeys(); bool hasLegacyKeys(); bool hasDefaultCertificate(); QString cskPassword(); QString certificatePassword(); const BlackBerryCertificate *defaultCertificate() const; void openDefaultCertificate(); void setDefaultCertificate(BlackBerryCertificate *certificate); void clearCskPassword(); void clearCertificatePassword(); void deleteDefaultCertificate(); signals: void defaultCertificateLoaded(int status); private slots: void certificateLoaded(int status); private: Q_DISABLE_COPY(BlackBerrySigningUtils) BlackBerrySigningUtils(QObject *parent = 0); QString promptPassword(const QString &message) const; BlackBerryCertificate *m_defaultCertificate; QString m_cskPassword; QString m_certificatePassword; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYSIGNINGUTILS_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxplugin.cpp0000644000015301777760000001276112321547255026257 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qnxplugin.h" #include "blackberrydeviceconfigurationfactory.h" #include "qnxconstants.h" #include "blackberryqtversionfactory.h" #include "blackberrydeployconfigurationfactory.h" #include "blackberrycreatepackagestepfactory.h" #include "blackberrydeploystepfactory.h" #include "blackberryrunconfigurationfactory.h" #include "blackberryruncontrolfactory.h" #include "qnxdeviceconfigurationfactory.h" #include "qnxruncontrolfactory.h" #include "qnxdeploystepfactory.h" #include "qnxdeployconfigurationfactory.h" #include "qnxrunconfigurationfactory.h" #include "qnxqtversionfactory.h" #include "blackberryndksettingspage.h" #include "bardescriptoreditorfactory.h" #include "bardescriptormagicmatcher.h" #include "blackberrykeyspage.h" #include "blackberrycheckdevmodestepfactory.h" #include "blackberrydeviceconnectionmanager.h" #include "blackberryconfigurationmanager.h" #include "cascadesimport/cascadesimportwizard.h" #include "qnxtoolchain.h" #include #include #include #include #include #include using namespace Qnx::Internal; QNXPlugin::QNXPlugin() { } QNXPlugin::~QNXPlugin() { delete BlackBerryDeviceConnectionManager::instance(); delete &BlackBerryConfigurationManager::instance(); } bool QNXPlugin::initialize(const QStringList &arguments, QString *errorString) { Q_UNUSED(arguments) Q_UNUSED(errorString) // Handles BlackBerry addAutoReleasedObject(new BlackBerryQtVersionFactory); addAutoReleasedObject(new BlackBerryDeployConfigurationFactory); addAutoReleasedObject(new BlackBerryDeviceConfigurationFactory); addAutoReleasedObject(new BlackBerryCreatePackageStepFactory); addAutoReleasedObject(new BlackBerryDeployStepFactory); addAutoReleasedObject(new BlackBerryRunConfigurationFactory); addAutoReleasedObject(new BlackBerryRunControlFactory); addAutoReleasedObject(new BlackBerryNDKSettingsPage); addAutoReleasedObject(new BlackBerryKeysPage); addAutoReleasedObject(new BlackBerryCheckDevModeStepFactory); addAutoReleasedObject(new CascadesImportWizard); BlackBerryDeviceConnectionManager::instance()->initialize(); // Handles QNX addAutoReleasedObject(new QnxQtVersionFactory); addAutoReleasedObject(new QnxDeviceConfigurationFactory); addAutoReleasedObject(new QnxRunControlFactory); addAutoReleasedObject(new QnxDeployStepFactory); addAutoReleasedObject(new QnxDeployConfigurationFactory); addAutoReleasedObject(new QnxRunConfigurationFactory); // Handle Qcc Compiler addAutoReleasedObject(new QnxToolChainFactory); // bar-descriptor.xml editor Core::MimeGlobPattern barDescriptorGlobPattern(QLatin1String("*.xml"), Core::MimeGlobPattern::MinWeight + 1); Core::MimeType barDescriptorMimeType; barDescriptorMimeType.setType(QLatin1String(Constants::QNX_BAR_DESCRIPTOR_MIME_TYPE)); barDescriptorMimeType.setComment(tr("Bar descriptor file (BlackBerry)")); barDescriptorMimeType.setGlobPatterns(QList() << barDescriptorGlobPattern); barDescriptorMimeType.addMagicMatcher(QSharedPointer(new BarDescriptorMagicMatcher)); barDescriptorMimeType.setSubClassesOf(QStringList() << QLatin1String("application/xml")); if (!Core::MimeDatabase::addMimeType(barDescriptorMimeType)) { *errorString = tr("Could not add mime-type for bar-descriptor.xml editor."); return false; } addAutoReleasedObject(new BarDescriptorEditorFactory); connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitsLoaded()), &BlackBerryConfigurationManager::instance(), SLOT(loadSettings())); return true; } void QNXPlugin::extensionsInitialized() { ProjectExplorer::TaskHub::addCategory(Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR, tr("Bar Descriptor")); } ExtensionSystem::IPlugin::ShutdownFlag QNXPlugin::aboutToShutdown() { return SynchronousShutdown; } Q_EXPORT_PLUGIN2(QNX, QNXPlugin) qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/qnxdeviceconfigurationwizard.h0000644000015301777760000000451112321547255031670 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H #define QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H #include #include namespace RemoteLinux { class GenericLinuxDeviceConfigurationWizardSetupPage; class GenericLinuxDeviceConfigurationWizardFinalPage; } namespace Qnx { namespace Internal { class QnxDeviceConfigurationWizard : public Utils::Wizard { Q_OBJECT public: explicit QnxDeviceConfigurationWizard(QWidget *parent = 0); ProjectExplorer::IDevice::Ptr device(); private: enum PageId { SetupPageId, FinalPageId }; RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage *m_setupPage; RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage *m_finalPage; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptoreditorenvironmentwidget.ui0000644000015301777760000000161012321547255033617 0ustar pbusernogroup00000000000000 Qnx::Internal::BarDescriptorEditorEnvironmentWidget 0 0 400 300 Form ProjectExplorer::EnvironmentWidget QWidget
projectexplorer/environmentwidget.h
1
qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeploystep.h0000644000015301777760000000453012321547255030123 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYDEPLOYSTEP_H #define QNX_INTERNAL_BLACKBERRYDEPLOYSTEP_H #include "blackberryabstractdeploystep.h" namespace Qnx { namespace Internal { class BlackBerryDeployStep : public BlackBerryAbstractDeployStep { Q_OBJECT friend class BlackBerryDeployStepFactory; public: explicit BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl); ~BlackBerryDeployStep(); bool init(); void run(QFutureInterface &fi); void cleanup(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); protected: BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryDeployStep *bs); void processStarted(const ProjectExplorer::ProcessParameters ¶ms); private: QString deviceHost() const; QString password() const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYDEPLOYSTEP_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/bardescriptormagicmatcher.h0000644000015301777760000000362612321547255031107 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BARDESCRIPTORMAGICMATCHER_H #define QNX_INTERNAL_BARDESCRIPTORMAGICMATCHER_H #include namespace Qnx { namespace Internal { class BarDescriptorMagicMatcher : public Core::IMagicMatcher { public: BarDescriptorMagicMatcher(); bool matches(const QByteArray &data) const; int priority() const; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BARDESCRIPTORMAGICMATCHER_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrykeyspage.h0000644000015301777760000000371312321547255027545 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BLACKBERRYKEYSPAGE_H #define BLACKBERRYKEYSPAGE_H #include namespace Qnx { namespace Internal { class BlackBerryKeysWidget; class BlackBerryKeysPage : public Core::IOptionsPage { Q_OBJECT public: explicit BlackBerryKeysPage(QObject *parent = 0); QWidget *createPage(QWidget *parent); void apply(); void finish(); private: BlackBerryKeysWidget *m_widget; }; } // namespace Internal } // namespace Qnx #endif // BLACKBERRYKEYSPAGE_H qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberryrunconfigurationwidget.h0000644000015301777760000000427712321547255032543 0ustar pbusernogroup00000000000000/************************************************************************** ** ** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** ** Contact: BlackBerry (qt@blackberry.com) ** Contact: KDAB (info@kdab.com) ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONWIDGET_H #define QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONWIDGET_H #include namespace Qnx { namespace Internal { namespace Ui { class BlackBerryRunConfigurationWidget; } class BlackBerryRunConfiguration; class BlackBerryRunConfigurationWidget : public QWidget { Q_OBJECT public: explicit BlackBerryRunConfigurationWidget(BlackBerryRunConfiguration *config, QWidget *parent = 0); ~BlackBerryRunConfigurationWidget(); private slots: void updateUi(); private: Ui::BlackBerryRunConfigurationWidget *m_ui; BlackBerryRunConfiguration *m_runConfiguration; }; } // namespace Internal } // namespace Qnx #endif // QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONWIDGET_H ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardquerypage.uiqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/src/qnx/blackberrydeviceconfigurationwizardquery0000644000015301777760000000216012321547255034040 0ustar pbusernogroup00000000000000 Qnx::Internal::BlackBerryDeviceConfigurationWizardQueryPage 0 0 381 142 Form true Qt::Vertical 20 58 qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/0000755000015301777760000000000012321547742023225 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/0000755000015301777760000000000012321547742025231 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/0000755000015301777760000000000012321547742027227 5ustar pbusernogroup00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/0000755000015301777760000000000012321547742030712 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000755000015301777760000000000012321547742033360 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000016200000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/project.proqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000000036112321547255033361 0ustar pbusernogroup00000000000000TEMPLATE = app LIBS += -lbbdata -lbb -lbbcascades QT += declarative xml SOURCES += \ src/main.cpp \ src/applicationui.cpp \ HEADERS += \ src/applicationui.h \ OTHER_FILES += \ bar-descriptor.xml \ assets/main.qml \ ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/icon.pngqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000002506112321547255033365 0ustar pbusernogroup00000000000000PNG  IHDRus]MsRGB pHYs  tIME4Fe IDATx}yp\yߛ{p kp$ uPmrlY'7*yZRdly+5*)0DK,G. Aq9 @HW5̛~_wݡO6|짰v (.Rr0{7;LA0X/ܻ.@il?'RYU'e"()Ue#$@|^^~!"QY F:322m!ۖl[ COd4s 7?녞1{nԔns[nNM$LUX*Ft8016$BE1ZNEZ&g`8z壤eWϥ8w#$5a1Q/#~^01[%o?4ۂ¢p4#Dˌr s$U jņT߀M X,`%0VN#0ҩ oy^~rQo7m~?T(JRw'#Cqmv}s1ܵ -܏\<&CC_z09> oA~</bh  Ht<^~yt ^{]Z[$bb| N~ٙib*r\[fADdee޷oYֹ=.cHgvA=O2^QB8B\}g8H8n8j\;;3ΎEEe%,fs$7oڷ^ߕaY$AZ=/Ըm֌*QS\x1L; { xfgy$*)cD+o޽&g\LBk?} I4n"J$wW^neCxťˋ/#K2Lfsw{z&FgicT8Ob @h4yTQq`X,ʲ{N!DWXHYTP$I¿>3LO9p"D8J "''e vd!'7'aCscy|kC9+kF݌S^1[zp;P,C0{q`hsblt|'A+JG_/,dD 8~i_{&"_  I$I$B~S\̦5ԧzʶiȔfPD(z=xṟB;(jH|&5#|7ܩ%㊧lԝ40*!IUp_D)U46@e_bh"΋PΝ=g]`LyC%EuWU>o4V%ug;Oclt[p]D~2A?(AAA /"+ `㪈߿"L|>/$ww!EQxѰu;$Ȕp9911?/ rÜz{r[dE17B]g0>: (E$%<1t-ܪ[˃XT KOrN]RFmmUFx<(לKۯz},܊OǡJy(=ھ|sy'JR~B76kM/z 8;oߐ_*/5YJ)!0L?yL&:uj{۷<@-uzY3ͨƁqΜ9sM"2|>ߚg%R});nzR9!N u8lڴ TmrY!_C-;inݚG h*>(MzD[r:&0߫lRbQ`V["}]Ԡw,nԼ<'q ,i 2Z[[w1l߾Ā^o{QJ|eYS]B>|]Oqe!<߲"P_xEd,aɏ703VSX DwUUUy>mfI\&Y>k'ZגCMDظz2m9K-iA|s+)CL 7IJ)mۖār$IIܣwQUUјhO|$NZM 0I|nT_{A9u-{ o~ʍ1u}$Iim۶8.ykUEdYN2q(|7r\zt:jiEyE҈0j,ԧ~Zkw$9s"s%/^Ey)Ԯ{Β`˖-IVܪWY#&)X{+g@oN lٹMY6[Rp8ё^#***He9!RST0ꫯ.9DVjA{m__x㍤ I- Le@x@СC^e(`AF g4466& T+6 !x'!’D6{S+O@~$%Z4դKy}N獥L;'Qj/Z'Jg2lfC;sRR$PO>mO_%i1 5FGG3U$Q099˗/t^ӄ$ GM{KN'.]ӹ`0(455ᡇJj_i15:aI s-4:<{94$ac݆S^y&FyRZP+*+fK"y]U#GYS7<"18p555xǖWZ\}kG)ɶ[O?gFf)J⪪kE<*GGa?cAr)El۶mun Ϗ|ɲ^㣐%I52\&kjGG_PX=0=5ȼIeB%|^^JJJ"Y|Vjq㵂ٙ^,heFEZA)Ml?83ӷCJ)ؘZDž9VAW5qJ)zu+1"pTdY1Aߦ]Suťe&jQD{N5wֲkT$HrԶ VAKUVwC4RD)EN-{~fƔ4TB)+33SYe($Q@0X}.˜???,bزصkvڕW{o~Gŏe_^ٔWw:N}G4,bX 2eZ,9/Ifs*Oi}󪬬Llt)ij?p,VۼysO^V*2AqhmmSO=_V(&E~Ϡ}&}cpX,vCy(L`\bԆTtzQjQ%>@nOZP\Eڵ KqJ;-߻w/ZZZUT^^*-ŋx1::zKX4,~myfn'iy#_",))j]> ѵTGIg?~ꄚԜUrv{/;;{ Iܒ:1l߬B3g]ڎ}5EIyTu$+AIUYХ&]/MzKXUxmMEYZ(WTT`0,Ufz*$>"5v;t:ݢDpm&Vk'(W_k SİX4&+)- bQ=%qčpj?j8횧"`ttO?4$V*G~ޏy ?Ԗ FHrY[}~_EhD< z^bnXnAŹ)2r!ҥK8y$566& ՅIA$ID"p\|2;%>߂Kb1>>X,&\oͰFssAHBSB---P(j23Vz~YմGxg)%"$񝮿j_k=jjjҚ[:D"+U1,TքB ¡&DyZbέ4ҿηki_Vv=)6k]լ[ZZg:t~Cv 4~S; B=C/199!IDI,K̸O~@WJ6lHJQ+5!%÷- ,#''O= c~X+~_Q5)xc)En^"?zx-7&>T*c<ݻb$uU*GBaq%ufc Eí)jnwƍ YFKӍj d6b̀,I;vGeA\iA5Da0 ӂηy<{ւ8CMMM|is Rm:6]PT\೎o Q7cė֣"ss3Ҳ,Ueζ f7M̾FFFFZ3I۷h4iLMM%wRO{#\xqT\k7,JO, 2iAmmm\}ťexg4{FӅXm *& jD"߲lllLYTGLծN':;;ܸ^YS ™iH9G.1 q 791v^EeU\M:9_*ꑊxŰZi7R*2 ߏ~_V񪫫[2pڵD0:̮"^fdeecӄWJݥyJA|8{ߚIAS˾]8n$ ZolE- BGυ <`Sݹ{{oɚ$"~/r˺Fzp:K&GE~aay={B8cx}󖭛 ne`Z3u]8y?Kl y4WpBq ]!)²kǒ~;::`CDAY^U]GbhZ=ڱ յD1ܮyvGT_lǢ貃7:2|99!j9^7mET(S]b,v {Uϲ{zz`B ml AoJ|8|G*ʪ 2ƎG"cmpe@owc ܏̬; mqJJ\(~峧=Tpv_vsi:::s8[ʪ IDAT.*)ffp: 0߻3+`O%ݔQtwp; ɫjn%Q{Ee)1XV&LNAhdZG1p3'G)/Ʒ|>5kYt8`O9Ԭ qAj˧>0rrd.¡>]o$ dY]Qz`v=eޚi y e^NUT-(8ѱqGAiM@/ʲ,]y%%U9p AEU5V{Zv>c|[~;^XXgg[s33yy&h+Tl뽃^ t:ܷ5+p|[xyFfp8|]V jgg'Z[[#===h$.((,*7D=yTV@A2NF >y튳92z..vB26I;_ϏzzzXssspch+/((.2MqUnsZ3(/yeWz 纆) ~CCC즂Wn~$zEEF K '֎g24N00Kvɒ&#vܹs7o~_~B1=(lm`Nn21916+;?0,$)(@ouf\xn_p@U Cْl[Nd",, Řr^UTU?Œ8 D9ez\׈$IoxU DBs339E6q9e֌LToC(wjzM{wpR> buVtq@| u:܂-U5E%0IOé B]y=xD׼^,:Vksrm˅-[nt:}"vB%'~r.(qyn;fK[R okkjH*C`?HbZ h @Ȓ `07a67Dyԥ>1P{Yu191&M;'=Ph@?>0xСp|/>ܬȁr`[!,V¢R)'7FYH|-4/={H\%V@s3l1z<3.n[[[mmmtκZ7&6t5"/ 7И WײŬ,T{-K}[$QD0b3ΨE#^]hmm j0)b @:*x/3L͖c-V+L&38=8 Fr4 4c$!"#1-H800 Kv|KKKm]벾I[[pdA9W(y@L,dX̛-ޠӃ8p<)HJ#!cPPŢ4 bHTŰ$Ƙ <k\kkkmnC_Ev}GG@8' 8 c0t8*eRY11000s2innos[Cnbba`4+R?B :D`zri+V{IENDB`././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/assets/qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000755000015301777760000000000012321547742033360 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/assets/main.qmlqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000000051012321547255033355 0ustar pbusernogroup00000000000000import bb.cascades 1.0 Page { Container { layout: DockLayout { } Label { text: qsTr("Hello World") textStyle.base: SystemDefaults.TextStyles.BigText verticalAlignment: VerticalAlignment.Center horizontalAlignment: HorizontalAlignment.Center } } } ././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/bar-descriptor.xmlqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000000166512321547255033371 0ustar pbusernogroup00000000000000 com.example.%ProjectName% %ProjectName% 1.0.0 DESCRIPTION none false true landscape icon.png run_native icon.png assets %ProjectName% ././@LongLink0000000000000000000000000000016100000000000011213 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/wizard.xmlqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000000404012321547255033357 0ustar pbusernogroup00000000000000 icon.png BlackBerry Cascades Application; Creates a Cascades application for BlackBerry 10. ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/src/qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000755000015301777760000000000012321547742033360 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000017400000000000011217 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/src/applicationui.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000000117312321547255033363 0ustar pbusernogroup00000000000000#include "applicationui.h" #include #include #include using namespace bb::cascades; ApplicationUI::ApplicationUI(bb::cascades::Application *app) : QObject(app) { // By default the QmlDocument object is owned by the Application instance // and will have the lifespan of the application QmlDocument *qml = QmlDocument::create("asset:///main.qml"); // Create root object for the UI AbstractPane *root = qml->createRootObject(); // Set created root object as the application scene app->setScene(root); } ././@LongLink0000000000000000000000000000016300000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/src/main.cppqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000000067612321547255033372 0ustar pbusernogroup00000000000000#include "applicationui.h" #include #include using namespace bb::cascades; Q_DECL_EXPORT int main(int argc, char **argv) { Application app(argc, argv); // Create the Application UI object, this is where the main.qml file // is loaded and the application scene is set. new ApplicationUI(&app); // Enter the application main event loop. return Application::exec(); } ././@LongLink0000000000000000000000000000017200000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-app/src/applicationui.hqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-cascades-ap0000644000015301777760000000050112321547255033355 0ustar pbusernogroup00000000000000#ifndef APPLICATIONUI_H #define APPLICATIONUI_H #include namespace bb { namespace cascades { class Application; } } class ApplicationUI : public QObject { Q_OBJECT public: ApplicationUI(bb::cascades::Application *app); virtual ~ApplicationUI() {} }; #endif /* APPLICATIONUI_H */ ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-bardescriptor/qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-bardescript0000755000015301777760000000000012321547742033516 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000017200000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-bardescriptor/bar-descriptor.xmlqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-bardescript0000644000015301777760000000177512321547255033531 0ustar pbusernogroup00000000000000 ID PROJECTNAME 1.0.0 DESCRIPTION none false true landscape PUBLISHER COPYRIGHT -style qnxlight run_native PROJECTNAME ././@LongLink0000000000000000000000000000016200000000000011214 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-bardescriptor/wizard.xmlqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-bardescript0000644000015301777760000000360512321547255033523 0ustar pbusernogroup00000000000000 Creates an application descriptor file. Application descriptor; BlackBerry ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-qt5-bardesc0000755000015301777760000000000012321547742033326 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000017600000000000011221 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/bar-descriptor.xmlqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-qt5-bardesc0000644000015301777760000000270412321547255033332 0ustar pbusernogroup00000000000000 ID PROJECTNAME 1.0.0 DESCRIPTION PUBLISHER COPYRIGHT none false true landscape -platform qnx run_native PROJECTNAME lib plugins imports ././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000qtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/wizard.xmlqtcreator-plugin-remotelinux-3.0.1+14.04.20140410.1/share/qtcreator/templates/wizards/bb-qt5-bardesc0000644000015301777760000000361512321547255033334 0ustar pbusernogroup00000000000000 Creates an Qt5 application descriptor file. Qt5 Application descriptor; BlackBerry