diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e1acc1a3..9269f4460 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,178 +1,177 @@ project(plasma-workspace) set(PROJECT_VERSION "5.10.90") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(QT_MIN_VERSION "5.7.0") set(KF5_MIN_VERSION "5.34.0") set(INSTALL_SDDM_THEME TRUE) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Widgets Quick QuickWidgets Concurrent Test Script Network) find_package(ECM 1.8.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMPackageConfigHelpers) include(ECMMarkNonGuiExecutable) include(CMakePackageConfigHelpers) include(WriteBasicConfigVersionFile) include(CheckIncludeFiles) include(FeatureSummary) include(ECMOptionalAddSubdirectory) include(ECMQtDeclareLoggingCategory) include(KDEPackageAppTemplates) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma DocTools Runner JsEmbed NotifyConfig Su NewStuff Wallet KCMUtils IdleTime Declarative TextWidgets KDELibs4Support Crash GlobalAccel DBusAddons Wayland) find_package(KF5NetworkManagerQt ${KF5_MIN_VERSION}) set_package_properties(KF5NetworkManagerQt PROPERTIES DESCRIPTION "Qt wrapper for NetworkManager API" TYPE OPTIONAL PURPOSE "Needed by geolocation data engine." ) find_package(KF5XmlRpcClient REQUIRED) # WARNING PlasmaQuick provides unversioned CMake config find_package(KF5 REQUIRED COMPONENTS PlasmaQuick) find_package(KF5 REQUIRED COMPONENTS SysGuard) find_package(KF5 REQUIRED COMPONENTS Package) find_package(KF5Baloo) set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "File Searching" TYPE RECOMMENDED PURPOSE "Needed for the File Search runner." ) find_package(KF5TextEditor) find_package(KWinDBusInterface CONFIG REQUIRED) find_package(KScreenLocker REQUIRED) find_package(ScreenSaverDBusInterface CONFIG REQUIRED) find_package(KF5Holidays) set_package_properties(KF5Holidays PROPERTIES DESCRIPTION "Holidays provider for Plasma calendar" TYPE OPTIONAL PURPOSE "Needed to for holidays plugin for Plasma Calendar." ) find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) set_package_properties(Phonon4Qt5 PROPERTIES DESCRIPTION "Qt-based audio library" TYPE REQUIRED) find_package(KF5Activities ${KF5_MIN_VERSION}) set_package_properties(KF5Activities PROPERTIES DESCRIPTION "management of Plasma activities" TYPE OPTIONAL PURPOSE "Needed by activity related plasmoids." ) find_package(ZLIB) set_package_properties(ZLIB PROPERTIES DESCRIPTION "Support for gzip compressed files and data streams" URL "http://www.zlib.net" TYPE REQUIRED ) find_package(X11) set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" URL "http://www.x.org" TYPE OPTIONAL PURPOSE "Required for building the X11 based workspace") if(X11_FOUND) find_package(XCB MODULE REQUIRED COMPONENTS XCB RANDR) set_package_properties(XCB PROPERTIES TYPE REQUIRED) if(NOT X11_SM_FOUND) message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") endif(NOT X11_SM_FOUND) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) endif() if(X11_FOUND AND XCB_XCB_FOUND) set(HAVE_X11 1) endif() find_package(AppStreamQt 0.10.4) set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Access metadata for listing available software" URL "https://www.freedesktop.org/wiki/Distributions/AppStream/" TYPE OPTIONAL ) include(ConfigureChecks.cmake) include_directories("${CMAKE_CURRENT_BINARY_DIR}") configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h) configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h ) configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h) configure_file(plasma.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/plasma.desktop) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma.desktop DESTINATION ${KDE_INSTALL_DATADIR}/xsessions ) configure_file(plasmawayland.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/plasmawayland.desktop) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasmawayland.desktop DESTINATION ${KDE_INSTALL_DATADIR}/wayland-sessions ) plasma_install_package(lookandfeel org.kde.breeze.desktop look-and-feel lookandfeel) if (INSTALL_SDDM_THEME) # Install the login theme into the SDDM directory # Longer term we need to look at making SDDM load from look and feel somehow.. and allow copying at runtime #NOTE this trailing slash is important to rename the directory install(DIRECTORY sddm-theme/ DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze PATTERN "README.txt" EXCLUDE PATTERN "components" EXCLUDE PATTERN "dummydata" EXCLUDE) install(DIRECTORY lookandfeel/contents/components DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze PATTERN "README.txt" EXCLUDE) endif() add_definitions(-DQT_NO_URL_CAST_FROM_STRING) add_subdirectory(doc) add_subdirectory(libkworkspace) add_subdirectory(libdbusmenuqt) add_subdirectory(appmenu) add_subdirectory(libtaskmanager) add_subdirectory(components) add_subdirectory(plasma-windowed) add_subdirectory(shell) add_subdirectory(freespacenotifier) add_subdirectory(klipper) add_subdirectory(krunner) add_subdirectory(ksmserver) add_subdirectory(ksplash) add_subdirectory(systemmonitor) add_subdirectory(statusnotifierwatcher) add_subdirectory(startkde) add_subdirectory(themes) add_subdirectory(containmentactions) add_subdirectory(runners) add_subdirectory(applets) add_subdirectory(dataengines) add_subdirectory(wallpapers) add_subdirectory(kioslave) add_subdirectory(ktimezoned) add_subdirectory(kuiserver) add_subdirectory(menu) add_subdirectory(phonon) add_subdirectory(solidautoeject) -add_subdirectory(drkonqi) ecm_optional_add_subdirectory(xembed-sni-proxy) add_subdirectory(soliduiserver) if(KF5Holidays_FOUND) add_subdirectory(plasmacalendarintegration) endif() add_subdirectory(templates) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/drkonqi/.kateconfig b/drkonqi/.kateconfig deleted file mode 100644 index 5dff10983..000000000 --- a/drkonqi/.kateconfig +++ /dev/null @@ -1 +0,0 @@ -kate: replace-tabs on; indent-width 4; \ No newline at end of file diff --git a/drkonqi/AUTHORS b/drkonqi/AUTHORS deleted file mode 100644 index 78fb78c4b..000000000 --- a/drkonqi/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Hans Petter Bieker -Dario Andres Rodriguez -George Kiagiadakis -A. L. Spehr -Lee Olson \ No newline at end of file diff --git a/drkonqi/CMakeLists.txt b/drkonqi/CMakeLists.txt deleted file mode 100644 index 4448e8b79..000000000 --- a/drkonqi/CMakeLists.txt +++ /dev/null @@ -1,119 +0,0 @@ -include (CheckFunctionExists) - -check_function_exists("strsignal" HAVE_STRSIGNAL) -check_function_exists("uname" HAVE_UNAME) - -if (NOT DEBUG_PACKAGE_INSTALLER_NAME) - set (DEBUG_PACKAGE_INSTALLER_NAME "installdbgsymbols.sh") -endif () - -configure_file (config-drkonqi.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-drkonqi.h ) - -if (HAVE_X11) -find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) -endif() - -add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1410) - -add_subdirectory( data ) -add_subdirectory( parser ) -if ( WIN32 ) - add_subdirectory( kdbgwin ) -endif () - -set(drkonqi_SRCS - main.cpp - drkonqidialog.cpp - statuswidget.cpp - aboutbugreportingdialog.cpp - backtraceratingwidget.cpp - backtracewidget.cpp - backtracegenerator.cpp - drkonqi.cpp - drkonqibackends.cpp - detachedprocessmonitor.cpp - debugpackageinstaller.cpp - systeminformation.cpp - crashedapplication.cpp - debugger.cpp - debuggerlaunchers.cpp - debuggermanager.cpp - applicationdetailsexamples.cpp - gdbhighlighter.cpp - statusnotifier.cpp -) - -ki18n_wrap_ui(drkonqi_SRCS - ui/maindialog.ui - ui/backtracewidget.ui -) - -# if BACKTRACE_PARSER_DEBUG is enabled, it will show both the -# parsed and the unparsed backtrace in the backtrace widget. -# Comment this out for release. -#add_definitions(-DBACKTRACE_PARSER_DEBUG) - - -set(drkonqi_SRCS - ${drkonqi_SRCS} - bugzillaintegration/bugzillalib.cpp - bugzillaintegration/reportassistantdialog.cpp - bugzillaintegration/reportassistantpage.cpp - bugzillaintegration/reportassistantpages_base.cpp - bugzillaintegration/reportassistantpages_bugzilla.cpp - bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp - bugzillaintegration/reportinterface.cpp - bugzillaintegration/productmapping.cpp - bugzillaintegration/parsebugbacktraces.cpp # Requires kxmlrpcclient - bugzillaintegration/duplicatefinderjob.cpp -) -ki18n_wrap_ui(drkonqi_SRCS - bugzillaintegration/ui/assistantpage_introduction.ui - bugzillaintegration/ui/assistantpage_bugawareness.ui - bugzillaintegration/ui/assistantpage_conclusions.ui - bugzillaintegration/ui/assistantpage_conclusions_dialog.ui - bugzillaintegration/ui/assistantpage_bugzilla_login.ui - bugzillaintegration/ui/assistantpage_bugzilla_duplicates.ui - bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog.ui - bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog_confirmation.ui - bugzillaintegration/ui/assistantpage_bugzilla_information.ui - bugzillaintegration/ui/assistantpage_bugzilla_preview.ui - bugzillaintegration/ui/assistantpage_bugzilla_send.ui -) - -add_executable(drkonqi ${drkonqi_SRCS}) -ecm_mark_nongui_executable(drkonqi) - -target_compile_definitions(drkonqi PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") - -target_link_libraries(drkonqi - KF5::I18n - KF5::CoreAddons - KF5::Service - KF5::ConfigWidgets - KF5::JobWidgets - KF5::KIOCore - KF5::Crash - KF5::Completion - Qt5::DBus - - KF5::XmlRpcClient - KF5::WidgetsAddons - KF5::Wallet - - KF5::Notifications # for status notifier - KF5::IdleTime # hide status notifier only if user saw it - - drkonqi_backtrace_parser -) -if (HAVE_X11) - target_link_libraries(drkonqi - Qt5::X11Extras - ) -endif() - -install(TARGETS drkonqi DESTINATION ${KDE_INSTALL_LIBEXECDIR}) - -# Only go into tests once we have a drkonqi target so the tests can reference -# it. -add_subdirectory( tests ) diff --git a/drkonqi/ExtraDesktop.sh b/drkonqi/ExtraDesktop.sh deleted file mode 100644 index 9efdbb205..000000000 --- a/drkonqi/ExtraDesktop.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh -#This file has output in separate line each file with a .desktop syntax -#that needs to be translated but has a non .desktop extension -find data -name "*rc" -print diff --git a/drkonqi/LICENSE b/drkonqi/LICENSE deleted file mode 100644 index d511905c1..000000000 --- a/drkonqi/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, 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 or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -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 give any other recipients of the Program a copy of this License -along with the Program. - -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 Program or any portion -of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -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 Program, 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 Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) 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; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, 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 executable. However, as a -special exception, the source code 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. - -If distribution of executable or 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 counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program 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. - - 5. 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 Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program 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 to -this License. - - 7. 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 Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program 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 Program. - -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. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program 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. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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 Program -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 Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, 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 - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), 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 Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. 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 program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; 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. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/drkonqi/Messages.sh b/drkonqi/Messages.sh deleted file mode 100644 index 5cbb85739..000000000 --- a/drkonqi/Messages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash -$EXTRACTRC ui/*.ui bugzillaintegration/ui/*.ui >> rc.cpp -$XGETTEXT *.cpp bugzillaintegration/*.cpp -o $podir/drkonqi5.pot -rm -f rc.cpp diff --git a/drkonqi/README b/drkonqi/README deleted file mode 100644 index af35289fe..000000000 --- a/drkonqi/README +++ /dev/null @@ -1,6 +0,0 @@ -How to activate the debug button for DrKonqi: - -$KDEHOME/share/config/drkonqirc: - -[Drkonqi] -ShowDebugButton=true diff --git a/drkonqi/ToDo b/drkonqi/ToDo deleted file mode 100644 index 0949e82d4..000000000 --- a/drkonqi/ToDo +++ /dev/null @@ -1,205 +0,0 @@ -##Main Tasks -------------- - -##For KDE4.5+: --------------- - -- Offer option to "subscribe" (addToCC) to a bug report - -#P1: - -- Check the wording of the new introduced texts (common crashes warnings and notes) - -- Implement inline help (tooltip/whatsthis) for Bugzilla Duplicate Confirmation dialog - -#P2 - -#- Have a "canceled " page (instead of directly exiting the assistant) ????? - -- If the report was "dismissed" because it was not really useful, and the backtrace was not generated; - allow the advanced users to generate it later (on the "Show report's content" button or in the backtrace tab) - -#P3 - -- Merge the two main dialogs (?) - -#Other - -- If attaching, include in the attach'description, a condensed string with the app/kdesc version - -- Check for plugins / Read memory-maps (/proc/PID/maps) and upload as attachment - (example, if plasma crashes, which libs were loaded, which lib caused the crash) - This is useful to determine if some external plugin is involved - (I don't know if this is technically possible) - -- Implement TerminalDebuggerLauncher (the idea is to use the same trick as the one used in the installdbgsymbols.sh examples) - -- BacktraceGenerator should not be allowed to start if another debugger is running. - Add some check and possibly some signal indicating this state. As a consequence, - remove the call to DrKonqi::debuggerManager()->debuggerIsRunning() from BacktraceWidget - to make it trully independent from drkonqi. - -- Make a docs dir and add documentation for: - 1) the format of the debugger files - 2) The dbus interface - + move README.packagers in there with a proper name. - -- Register dynamic debug area (see dfaure's mail on k-c-d). - -- Use external .desktop files to provide examples of "useful crash details" for external applications - (ex. Amarok installs a amarokdrkonqiexamples.desktop file with a content like "Type of music you were listening to..." - - It can contain translations too. - -## FUTURE ---------------- - -- Update DrKonqi to use the remote product mapping implementation (being done by Mattr) - [[ currently bugzillalib detects unexistent products to later use the "kde" product ]] - ##Update: local mappings file support already implemented. - ##Sample PHP script sent - Waiting for remote implementation to be complete. - -- Implement a bugzilla field "Fixed at" X version, to show to the user... (mattr) - -- Detect app versions and encourage the user to test new version? - (detect stable or devel) - -- Custom usefulness values needed by application - (ex. Amarok wants only perfect backtraces...) - -##Brainstorming --------------- - -- Try to also provide full backtraces ("bt full") - The simple backtrace is going to be pasted inline as always - The complete backtrace could be added as an attachment - (how to retrieve both versions at the same time?, fetch only the full and "manually strip it" to get the simple one ?) - -- Implement bugtracking-system-agnostic interface on KDE servers and adapt DrKonqi to interact with it - (this will also remove the HTML parsing code from DrKonqi itself, to put it on a remote script) - -- Display the time of the crash - ("I came back to the computer some time later and drkonqi was there.. - when the application crashed? during the night?") (by sreich) - -- Usability review and suggestions: - http://blogs.msdn.com/oldnewthing/archive/2003/09/01/54734.aspx (by Maciej) - -- Hide backtrace from user (only show progress and backtrace status)?? - -- Search in backtrace (esp. for [KCrash Handler]) - -- Backtrace syntax highlighting (xml parser+ some qt/kde class ?) - -- Option to "don't show DrKonqi for this(X) app" - (Do we want this?) - -- Option to avoid drkonqi at all (setting KDE_DEBUG=1), and GUI to renable it - (Do we want this?) - -#Later ---------- - -- Implement a proper DBus interface. -- Include help in the details page, near the "Details:" label (ex. "What should I write this?" link with help) - -#DONE -------- - -- Improve the "Enter manual bug ID" option in the Duplicates page to be more discoverable - -- Improve the help about the information the user needs to provide - -- Show the minimum text require length / or a "progress bar"(or capacitybar) - -- If we are going to attach the bug report to an existent one, and that one has too much duplicates, warn the user that his/her attachment is only going to be useful if s/he provides good info - -- In the "Details page" (user enters description) write the headers like -"What I was doing when app crashed: \n\n Other useful config details:" (depending on the options checked before) - -- Exclude some backtrace functions to improve the search feature (like Qt base stuff at the top of the bt) - -- Replace the progressbar of the StatusWidget with a throbber.... - -- The reporting dialog should check (on start) if the backtrace was already generated by the main dialog -(to use it when saving the report to a file, even when the backtrace page is not shown) - -- If reproducibility is Always or Sometimes, set a minimum required char ammount in the details page - -- Title is not needed when attaching the report to an existant one - -- Remove the "Are you ready to submit this bug report" in the Preview page - -- Application detection: ask for or detect specific things depending on application - ie konqueror: url, plasma: plasmoids in use, kopete: protocol, etc. - -- REVIEW criteria of minimum chars/words to use in the Title and Details fields -"- If a possible duplicate is marked as FIXED, show a better (banner) message so the user will notice.... - -!!IMPORTANT: (to be done before 2009Nov25 / String Freeze) -- Update "AboutBugReporting" guide to reflect the new workflow -- Review the confirmation dialog in the Bug Report Information page: -if the text is not long enough, we dismiss the whole report saying something like "a report without a good description -will only waste bug triagers and developers time"... - -##- Use https://bugs.kde.org/enter_bug.cgi?product=X to fetch product versions... (it will reduce server load) - -##Bugzilla DrKonqi reports cleanup: -Wontfix: 143243, 185547 - ---------- ---------- - -* Crashes on Shutdown: - -https://bugs.kde.org/show_bug.cgi?id=126073 -> -**** Restore block shutdown/logout while DrKonqi window is up -(to catch crashes on shutdown) -- Config option to: - - (default) Show a feedback indicator for a "automatically closing window" timer (and continue with shutdown) - - non-default Block shutdown/logout completely, do not use a closing timer. - -- Ask Seli for Session Management stuff (we need to ask from code if we are in the middle of a shutdown process) -- Use " unsetenv("SESSION_MANAGER");" again on main.cpp (http://websvn.kde.org/trunk/kdebase/drkonqi/main.cpp?r1=408177&r2=408176&pathrev=408177) - -- Startkde waiting for drkonqi to exit-> - # wait if there's any crashhandler shown -318 while dcop | grep -q ^drkonqi- ; do -319 sleep 5 -320 done - -" while qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do sleep 5; done " -http://websvn.kde.org/trunk/kdebase/startkde?r1=408177&r2=408176&pathrev=408177 - -http://websvn.kde.org/?view=rev&revision=408177 - -bool KSessionManager::saveState ( QSessionManager & sm ) [virtual] -void QApplication::saveState ( QSessionManager & manager ) - ---------------------- ---------------------- -Improving symbol loading speed using GDB ---- - -- Create a temp file "init" - -"init" contents: -set auto-solib-add off - -(this will disable the symbols autoload) - -Start gdb with .. "-x init" (init includes the fullpath) - -"bt full" will show an empty backtrace, but with the libraries path. - -Use "shar path" to load the debug symbols for that file - -"bt full" will now be more complete (but it may need more symbols to be loaded) - - --- - -The current gdb commands could be adapted to... -- Do not include the PID on the command line -- "set auto-solib-add off" could be the first command of the BatchCommands (passed tempfile with -x) -- "attach PID" could be the second command diff --git a/drkonqi/aboutbugreportingdialog.cpp b/drkonqi/aboutbugreportingdialog.cpp deleted file mode 100644 index 625f512b0..000000000 --- a/drkonqi/aboutbugreportingdialog.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/******************************************************************* -* aboutbugreportingdialog.cpp -* Copyright 2009 Dario Andres Rodriguez -* Copyright 2009 A. L. Spehr -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "aboutbugreportingdialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "drkonqi_globals.h" - -AboutBugReportingDialog::AboutBugReportingDialog(QWidget * parent): - QDialog(parent) -{ - setAttribute(Qt::WA_DeleteOnClose, true); - - setWindowIcon(QIcon::fromTheme(QStringLiteral("help-hint"))); - setWindowTitle(i18nc("@title title of the dialog", "About Bug Reporting - Help")); - - QVBoxLayout* layout = new QVBoxLayout(this); - setLayout(layout); - m_textBrowser = new QTextBrowser(this); - m_textBrowser->setMinimumSize(QSize(600, 300)); - connect(m_textBrowser, &QTextBrowser::anchorClicked, this, &AboutBugReportingDialog::handleInternalLinks); - - QString text = - - //Introduction - QStringLiteral("

%2

").arg(QLatin1String(PAGE_HELP_BEGIN_ID), - i18nc("@title","Information about bug reporting")) + - QStringLiteral("

%1

%2

%3

").arg( - xi18nc("@info/rich", "You can help us improve this software by filing a bug report."), - xi18nc("@info/rich","It is safe to close this dialog. If you do not " - "want to, you do not have to file a bug report."), - xi18nc("@info/rich","In order to generate a useful bug report we need some " - "information about both the crash and your system. (You may also " - "need to install some debug packages.)")) + - - //Sub-introduction - QStringLiteral("

%1

").arg(i18nc("@title","Bug Reporting Assistant Guide")) + - QStringLiteral("

%1

").arg( - xi18nc("@info/rich","This assistant will guide you through the crash " - "reporting process for the KDE bug tracking system. All the " - "information you enter on the bug report must be written " - "in English, if possible, as KDE is formed internationally.")) + - - //Bug Awareness Page - QStringLiteral("

%2

").arg(QLatin1String(PAGE_AWARENESS_ID), - i18nc("@title","What do you know about the crash?")) + - QStringLiteral("

%1

%2

  • %3
  • %4
  • %5
  • %6
  • %7
  • %8
  • " - "
%9

").arg( - xi18nc("@info/rich","In this page you need to describe how much do you know about " - "the desktop and the application state before it crashed."), - xi18nc("@info/rich","If you can, describe in as much detail as possible the crash " - "circumstances, and what you were doing when the application crashed " - "(this information is going to be requested later.) You can mention: "), - xi18nc("@info/rich crash situation example","actions you were taking inside or outside " - "the application"), - xi18nc("@info/rich crash situation example","documents or images that you were using " - "and their type/format (later if you go to look at the report in the " - "bug tracking system, you can attach a file to the report)"), - xi18nc("@info/rich crash situation example","widgets that you were running"), - xi18nc("@info/rich crash situation example","the URL of a web site you were browsing"), - xi18nc("@info/rich crash situation example","configuration details of the application"), - xi18nc("@info/rich crash situation example","or other strange things you notice before " - "or after the crash. "), - xi18nc("@info/rich","Screenshots can be very helpful sometimes. You can attach them to " - "the bug report after it is posted to the bug tracking system.")) + - - //Crash Information Page - QStringLiteral("

%2

").arg(QLatin1String(PAGE_CRASHINFORMATION_ID), - i18nc("@title","Crash Information (backtrace)")) + - QStringLiteral("

%1

%2

%3

%4

").arg( - xi18nc("@info/rich","This page will generate a \"backtrace\" of the crash. This " - "is information that tells the developers where the application " - "crashed."), - xi18nc("@info/rich", "If the crash information is not detailed enough, you may " - "need to install some debug packages and reload it (if the " - "Install Debug Symbols button is available you " - "can use it to automatically install the missing information.)"), - xi18nc("@info/rich", "You can find more information about backtraces, what they mean, " - "and how they are useful at %1",QStringLiteral(TECHBASE_HOWTO_DOC) ), - xi18nc("@info/rich","Once you get a useful backtrace (or if you do not want to " - "install the missing debugging packages) you can continue.")) + - - //Conclusions Page - QStringLiteral("

%2

").arg(QLatin1String(PAGE_CONCLUSIONS_ID), - i18nc("@title","Conclusions")) + - QStringLiteral("

%1

%2

%3

").arg( - xi18nc("@info/rich","Using the quality of the crash information gathered, " - "and your answers on the previous page, the assistant will " - "tell you if the crash is worth reporting or not."), - xi18nc("@info/rich","If the crash is worth reporting but the application " - "is not supported in the KDE bug tracking system, you " - "will need to directly contact the maintainer of the application."), - xi18nc("@info/rich","If the crash is listed as being not worth reporting, " - "and you think the assistant has made a mistake, " - "you can still manually report the bug by logging into the " - "bug tracking system. You can also go back and change information " - "and download debug packages.")) + - - //Bugzilla Login Page - QStringLiteral("

%2

").arg(QLatin1String(PAGE_BZLOGIN_ID), - i18nc("@title","Login into the bug tracking system")) + - QStringLiteral("

%1

%2

%3

").arg( - xi18nc("@info/rich","We may need to contact you in the future to ask for " - "further information. As we need to keep track of the bug reports, " - "you " - "need to have an account on the KDE bug tracking system. If you do " - "not have one, you can create one here: %1", - KDE_BUGZILLA_CREATE_ACCOUNT_URL), - xi18nc("@info/rich","Then, enter your username and password and " - "press the Login button. You can use this login to directly access the " - "KDE bug tracking system later."), - xi18nc("@info/rich","The KWallet dialog may appear when pressing Login to " - "save your password in the KWallet password system. Also, it will " - "prompt you for the KWallet password upon loading to autocomplete " - "the login fields if you use this assistant again.")) + - - //Bugzilla Duplicates Page - QStringLiteral("

%2

").arg(QLatin1String(PAGE_BZDUPLICATES_ID), - i18nc("@title","List of possible duplicate reports")) + - QStringLiteral("

%1

%2

%3

%4

%5

").arg( - //needs some more string cleanup below - xi18nc("@info/rich","This page will search the bug report system for " - "similar crashes which are possible duplicates of your bug. If " - "there are similar bug reports found, you can double click on them " - "to see details. Then, read the current bug report information so " - "you can check to see if they are similar. "), - xi18nc("@info/rich","If you are very sure your bug is the same as another that is " - "previously reported, you can set your information to be attached to " - "the existing report."), - xi18nc("@info/rich","If you are unsure whether your report is the same, follow the main " - "options to tentatively mark your crash as a duplicate of that " - "report. This is usually the safest thing to do. We cannot " - "uncombine bug reports, but we can easily merge them."), - xi18nc("@info/rich","If not enough possible duplicates are found, or you " - "did not find a similar report, then you can force it to search " - "for more bug reports (only if the date range limit is not reached.)"), - xi18nc("@info/rich","If you do not find any related reports, your crash information " - "is not useful enough, and you really cannot give additional " - "information about the crash context, then it is better to " - "not file the bug report, thereby closing the assistant.")) + - - //Bugzilla Crash Information - Details Page - QStringLiteral("

%2

").arg(QLatin1String(PAGE_BZDETAILS_ID), - i18nc("@title","Details of the bug report and your system")) + - QStringLiteral("

%1%3

%4

%5

").arg( - xi18nc("@info/rich","In this case you need to write a title and description " - "of the crash. Explain as best you can. "), - QLatin1String(PAGE_AWARENESS_ID), - i18nc("@title","What do you know about the crash?"), - xi18nc("@info/rich", "You can also specify your distribution method (GNU/Linux " - "distribution or packaging system) or if you compiled the KDE " - "Platform from sources."), - xi18nc("@info/rich", "You should write those information in English.")) + - - //Bugzilla Send Page - QStringLiteral("

%2

").arg(QLatin1String(PAGE_BZSEND_ID), - i18nc("@title","Sending the Crash Report")) + - QStringLiteral("

%1

%2

").arg( - xi18nc("@info/rich","The last page will send the bug report to the bug tracking " - "system and will notify you when it is done. It will then show " - "the web address of the bug report in the KDE bug tracking system, " - "so that you can look at the report later."), - xi18nc("@info/rich","If the process fails, you can click " - "Retry to try sending the bug report again. " - "If the report cannot be sent because the bug tracking system has a " - "problem, you can save it to a file to manually report later.")) + - - QStringLiteral("

%1

%2

").arg( - xi18nc("@info/rich", "Thank you for being part of KDE!"), - xi18nc("@info/rich", "If you are interested in helping us to keep the KDE bug tracker system " - "clean and useful, which allows the developers to be more focused on " - "fixing the real issues, you are welcome to " - "join the BugSquad team.")); - - m_textBrowser->setText(text); - - layout->addWidget(m_textBrowser); - - QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Close, this); - connect(box->button(QDialogButtonBox::Close), &QPushButton::clicked, this, &AboutBugReportingDialog::close); - layout->addWidget(box); - - KConfigGroup config(KSharedConfig::openConfig(), "AboutBugReportingDialog"); - KWindowConfig::restoreWindowSize(windowHandle(), config); -} - -AboutBugReportingDialog::~AboutBugReportingDialog( ) -{ - KConfigGroup config(KSharedConfig::openConfig(), "AboutBugReportingDialog"); - KWindowConfig::saveWindowSize(windowHandle(), config); -} - -void AboutBugReportingDialog::handleInternalLinks(const QUrl& url) -{ - if (!url.isEmpty()) { - if (url.scheme().isEmpty() && url.hasFragment()) { - showSection(url.fragment()); - } else { - QDesktopServices::openUrl(url); - } - } -} - -void AboutBugReportingDialog::showSection(const QString& anchor) -{ - m_textBrowser->scrollToAnchor(anchor); -} - diff --git a/drkonqi/aboutbugreportingdialog.h b/drkonqi/aboutbugreportingdialog.h deleted file mode 100644 index 2d3459d67..000000000 --- a/drkonqi/aboutbugreportingdialog.h +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************* -* aboutbugreportingdialog.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef ABOUTBUGREPORTINGDIALOG__H -#define ABOUTBUGREPORTINGDIALOG__H - -#include - -class QTextBrowser; - -class AboutBugReportingDialog: public QDialog -{ - Q_OBJECT - -public: - explicit AboutBugReportingDialog(QWidget * parent = 0); - ~AboutBugReportingDialog() override; - void showSection(const QString&); - -private Q_SLOTS: - void handleInternalLinks(const QUrl& url); - -private: - QTextBrowser * m_textBrowser; -}; - -#endif diff --git a/drkonqi/applicationdetailsexamples.cpp b/drkonqi/applicationdetailsexamples.cpp deleted file mode 100644 index d18f1e8e1..000000000 --- a/drkonqi/applicationdetailsexamples.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************* -* applicationdetailsexamples.cpp -* Copyright 2010 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "applicationdetailsexamples.h" - -#include - -#include "drkonqi.h" -#include "crashedapplication.h" - -ApplicationDetailsExamples::ApplicationDetailsExamples(QObject * parent) - : QObject(parent) -{ - QString binaryName = DrKonqi::crashedApplication()->fakeExecutableBaseName(); - - if (binaryName == QLatin1String("plasmashell")) { - m_examples = i18nc("@info examples about information the user can provide", - "Widgets you have in your desktop and panels (both official and unofficial), " - "desktop settings (wallpaper plugin, themes) and activities."); - } else if (binaryName == QLatin1String("kwin_x11") || binaryName == QLatin1String("kwin_wayland")) { - m_examples = i18nc("@info examples about information the user can provide", - "State of Desktop Effects (Compositing), kind of effects enabled, window decoration, " - "and specific window rules and configuration."); - } else if (binaryName == QLatin1String("konqueror") || - binaryName == QLatin1String("rekonq")) { - m_examples = i18nc("@info examples about information the user can provide", - "sites you were visiting, number of opened tabs, plugins you have installed, " - "and any other non-default setting."); - } else if (binaryName == QLatin1String("dolphin")) { - m_examples = i18nc("@info examples about information the user can provide", - "File view mode, grouping and sorting settings, preview settings, and directory you were browsing."); - } else if (binaryName == QLatin1String("kopete")) { - m_examples = i18nc("@info examples about information the user can provide", - "Instant Messaging protocols you use, and plugins you have installed (official and unofficial)."); - } else if (binaryName == QLatin1String("kmail")) { - m_examples = i18nc("@info examples about information the user can provide", - "Mail protocols and account-types you use."); - } else if (binaryName == QLatin1String("kwrite") || - binaryName == QLatin1String("kate") || - binaryName == QLatin1String("kword")) { - m_examples = i18nc("@info examples about information the user can provide", - "Type of the document you were editing."); - } else if (binaryName == QLatin1String("juk") || - binaryName == QLatin1String("amarok") || - binaryName == QLatin1String("dragon") || - binaryName == QLatin1String("kaffeine")) { - m_examples = i18nc("@info examples about information the user can provide", - "Type of media (extension and format) you were watching and/or listening to."); - } -} - -bool ApplicationDetailsExamples::hasExamples() const -{ - return !m_examples.isEmpty(); -} - -QString ApplicationDetailsExamples::examples() const -{ - return m_examples; -} diff --git a/drkonqi/applicationdetailsexamples.h b/drkonqi/applicationdetailsexamples.h deleted file mode 100644 index 3efb8b368..000000000 --- a/drkonqi/applicationdetailsexamples.h +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************* -* applicationdetailsexamples.h -* Copyright 2010 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef APPLICATIONDETAILSEXAMPLES__H -#define APPLICATIONDETAILSEXAMPLES__H - -#include -#include - -class ApplicationDetailsExamples : QObject -{ -Q_OBJECT -public: - explicit ApplicationDetailsExamples(QObject * parent); - bool hasExamples() const; - QString examples() const; - -private: - QString m_examples; -}; - -#endif diff --git a/drkonqi/backtracegenerator.cpp b/drkonqi/backtracegenerator.cpp deleted file mode 100644 index 5215585d3..000000000 --- a/drkonqi/backtracegenerator.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/***************************************************************** - * drkonqi - The KDE Crash Handler - * - * Copyright (C) 2000-2003 Hans Petter Bieker - * Copyright (C) 2009 George Kiagiadakis - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************/ -#include "backtracegenerator.h" - -#include -#include -#include -#include - -#include "parser/backtraceparser.h" - -BacktraceGenerator::BacktraceGenerator(const Debugger & debugger, QObject *parent) - : QObject(parent), - m_debugger(debugger), m_proc(NULL), - m_temp(NULL), m_state(NotLoaded) -{ - m_parser = BacktraceParser::newParser(m_debugger.codeName(), this); - m_parser->connectToGenerator(this); - -#ifdef BACKTRACE_PARSER_DEBUG - m_debugParser = BacktraceParser::newParser(QString(), this); //uses the null parser - m_debugParser->connectToGenerator(this); -#endif -} - -BacktraceGenerator::~BacktraceGenerator() -{ - if (m_proc && m_proc->state() == QProcess::Running) { - qWarning() << "Killing running debugger instance"; - m_proc->disconnect(this); - m_proc->terminate(); - if (!m_proc->waitForFinished(10000)) { - m_proc->kill(); - m_proc->waitForFinished(); - } - delete m_proc; - delete m_temp; - } -} - -bool BacktraceGenerator::start() -{ - //they should always be null before entering this function. - Q_ASSERT(m_proc == NULL && m_temp == NULL); - - m_parsedBacktrace.clear(); - m_state = Loading; - - emit starting(); - - if (!m_debugger.isValid() || !m_debugger.isInstalled()) { - m_state = FailedToStart; - emit failedToStart(); - return false; - } - - m_proc = new KProcess; - m_proc->setEnv(QStringLiteral("LC_ALL"), QStringLiteral("C")); // force C locale - - m_temp = new QTemporaryFile; - m_temp->open(); - m_temp->write(m_debugger.backtraceBatchCommands().toLatin1()); - m_temp->write("\n", 1); - m_temp->flush(); - - // start the debugger - QString str = m_debugger.command(); - Debugger::expandString(str, Debugger::ExpansionUsageShell, m_temp->fileName()); - - *m_proc << KShell::splitArgs(str); - m_proc->setOutputChannelMode(KProcess::OnlyStdoutChannel); - m_proc->setNextOpenMode(QIODevice::ReadWrite | QIODevice::Text); - connect(m_proc, &KProcess::readyReadStandardOutput, this, &BacktraceGenerator::slotReadInput); - connect(m_proc, static_cast(&KProcess::finished), this, &BacktraceGenerator::slotProcessExited); - - m_proc->start(); - if (!m_proc->waitForStarted()) { - //we mustn't keep these around... - m_proc->deleteLater(); - m_temp->deleteLater(); - m_proc = NULL; - m_temp = NULL; - - m_state = FailedToStart; - emit failedToStart(); - return false; - } - - return true; -} - -void BacktraceGenerator::slotReadInput() -{ - // we do not know if the output array ends in the middle of an utf-8 sequence - m_output += m_proc->readAllStandardOutput(); - - int pos; - while ((pos = m_output.indexOf('\n')) != -1) { - QString line = QString::fromLocal8Bit(m_output, pos + 1); - m_output.remove(0, pos + 1); - - emit newLine(line); - } -} - -void BacktraceGenerator::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus) -{ - //these are useless now - m_proc->deleteLater(); - m_temp->deleteLater(); - m_proc = NULL; - m_temp = NULL; - - //mark the end of the backtrace for the parser - emit newLine(QString()); - - if (exitStatus != QProcess::NormalExit || exitCode != 0) { - m_state = Failed; - emit someError(); - return; - } - - //no translation, string appears in the report - QString tmp(QStringLiteral("Application: %progname (%execname), signal: %signame\n")); - Debugger::expandString(tmp); - - m_parsedBacktrace = tmp + m_parser->parsedBacktrace(); - m_state = Loaded; - -#ifdef BACKTRACE_PARSER_DEBUG - //append the raw unparsed backtrace - m_parsedBacktrace += "\n------------ Unparsed Backtrace ------------\n"; - m_parsedBacktrace += m_debugParser->parsedBacktrace(); //it's not really parsed, it's from the null parser. -#endif - - emit done(); -} - - diff --git a/drkonqi/backtracegenerator.h b/drkonqi/backtracegenerator.h deleted file mode 100644 index f3dc268c7..000000000 --- a/drkonqi/backtracegenerator.h +++ /dev/null @@ -1,93 +0,0 @@ -/***************************************************************** - * drkonqi - The KDE Crash Handler - * - * Copyright (C) 2000-2003 Hans Petter Bieker - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************/ - -#ifndef BACKTRACEGENERATOR_H -#define BACKTRACEGENERATOR_H - -#include -#include - -#include "debugger.h" - -class KProcess; -class BacktraceParser; - -class BacktraceGenerator : public QObject -{ - Q_OBJECT - -public: - enum State { NotLoaded, Loading, Loaded, Failed, FailedToStart }; - - BacktraceGenerator(const Debugger & debugger, QObject *parent); - ~BacktraceGenerator() override; - - State state() const { - return m_state; - } - - BacktraceParser *parser() const { - return m_parser; - } - - QString backtrace() const { - return m_parsedBacktrace; - } - - const Debugger debugger() const { - return m_debugger; - } - -public Q_SLOTS: - bool start(); - -Q_SIGNALS: - void starting(); - void newLine(const QString &str); // emitted for every line - void someError(); - void failedToStart(); - void done(); - -private Q_SLOTS: - void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus); - void slotReadInput(); - -private: - const Debugger m_debugger; - KProcess * m_proc; - QTemporaryFile * m_temp; - QByteArray m_output; - State m_state; - BacktraceParser * m_parser; - QString m_parsedBacktrace; - -#ifdef BACKTRACE_PARSER_DEBUG - BacktraceParser * m_debugParser; -#endif -}; - -#endif diff --git a/drkonqi/backtraceratingwidget.cpp b/drkonqi/backtraceratingwidget.cpp deleted file mode 100644 index 5dc7a79d2..000000000 --- a/drkonqi/backtraceratingwidget.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************* -* backtraceratingwidget.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "backtraceratingwidget.h" - -#include -#include - - -BacktraceRatingWidget::BacktraceRatingWidget(QWidget * parent) : - QWidget(parent), - m_state(BacktraceGenerator::NotLoaded), - m_star1(false), - m_star2(false), - m_star3(false) -{ - setMinimumSize(105, 24); - - m_starPixmap = QIcon::fromTheme(QStringLiteral("rating")).pixmap(QSize(22, 22)); - m_disabledStarPixmap = QIcon::fromTheme(QStringLiteral("rating")).pixmap(QSize(22, 22), QIcon::Disabled); - m_errorPixmap = QIcon::fromTheme(QStringLiteral("dialog-error")).pixmap(QSize(22, 22)); -} - -void BacktraceRatingWidget::setUsefulness(BacktraceParser::Usefulness usefulness) -{ - switch (usefulness) { - case BacktraceParser::ReallyUseful: { - m_star1 = true; - m_star2 = true; - m_star3 = true; - break; - } - case BacktraceParser::MayBeUseful: { - m_star1 = true; - m_star2 = true; - m_star3 = false; - break; - } - case BacktraceParser::ProbablyUseless: { - m_star1 = true; - m_star2 = false; - m_star3 = false; - break; - } - case BacktraceParser::Useless: - case BacktraceParser::InvalidUsefulness: { - m_star1 = false; - m_star2 = false; - m_star3 = false; - break; - } - } - - update(); -} - -void BacktraceRatingWidget::paintEvent(QPaintEvent * event) -{ - Q_UNUSED(event); - - QPainter p(this); - - p.drawPixmap(QPoint(30, 1) , m_star1 ? m_starPixmap : m_disabledStarPixmap); - p.drawPixmap(QPoint(55, 1) , m_star2 ? m_starPixmap : m_disabledStarPixmap); - p.drawPixmap(QPoint(80, 1) , m_star3 ? m_starPixmap : m_disabledStarPixmap); - - switch (m_state) { - case BacktraceGenerator::Failed: - case BacktraceGenerator::FailedToStart: { - p.drawPixmap(QPoint(0, 1) , m_errorPixmap); - break; - } - case BacktraceGenerator::Loading: - case BacktraceGenerator::Loaded: - default: - break; - } - - p.end(); -} diff --git a/drkonqi/backtraceratingwidget.h b/drkonqi/backtraceratingwidget.h deleted file mode 100644 index 0928f6c8d..000000000 --- a/drkonqi/backtraceratingwidget.h +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************* -* backtraceratingwidget.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef BACKTRACERATINGWIDGET__H -#define BACKTRACERATINGWIDGET__H - -#include - -#include "parser/backtraceparser.h" -#include "backtracegenerator.h" - -class QPixmap; - -class BacktraceRatingWidget: public QWidget -{ - Q_OBJECT - -public: - - explicit BacktraceRatingWidget(QWidget *); - void setUsefulness(BacktraceParser::Usefulness); - void setState(BacktraceGenerator::State s) { - m_state = s; update(); - } - -protected: - - void paintEvent(QPaintEvent * event) override; - -private: - - BacktraceGenerator::State m_state; - - bool m_star1; - bool m_star2; - bool m_star3; - - QPixmap m_errorPixmap; - - QPixmap m_starPixmap; - QPixmap m_disabledStarPixmap; -}; - -#endif diff --git a/drkonqi/backtracewidget.cpp b/drkonqi/backtracewidget.cpp deleted file mode 100644 index 3218e7988..000000000 --- a/drkonqi/backtracewidget.cpp +++ /dev/null @@ -1,403 +0,0 @@ -/******************************************************************* -* backtracewidget.cpp -* Copyright 2009,2010 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "backtracewidget.h" - -#include -#include - -#include -#include -#include -#include - -#include "drkonqi.h" -#include "backtraceratingwidget.h" -#include "crashedapplication.h" -#include "backtracegenerator.h" -#include "parser/backtraceparser.h" -#include "drkonqi_globals.h" -#include "debuggermanager.h" -#include "gdbhighlighter.h" - -static const char extraDetailsLabelMargin[] = " margin: 5px; "; - -BacktraceWidget::BacktraceWidget(BacktraceGenerator *generator, QWidget *parent, - bool showToggleBacktrace) : - QWidget(parent), - m_btGenerator(generator), - m_highlighter(0) -{ - ui.setupUi(this); - - //Debug package installer - m_debugPackageInstaller = new DebugPackageInstaller(this); - connect(m_debugPackageInstaller, &DebugPackageInstaller::error, this, &BacktraceWidget::debugPackageError); - connect(m_debugPackageInstaller, &DebugPackageInstaller::packagesInstalled, this, &BacktraceWidget::regenerateBacktrace); - connect(m_debugPackageInstaller, &DebugPackageInstaller::canceled, this, &BacktraceWidget::debugPackageCanceled); - - connect(m_btGenerator, &BacktraceGenerator::done, this, &BacktraceWidget::loadData); - connect(m_btGenerator, &BacktraceGenerator::someError, this, &BacktraceWidget::loadData); - connect(m_btGenerator, &BacktraceGenerator::failedToStart, this, &BacktraceWidget::loadData); - connect(m_btGenerator, &BacktraceGenerator::newLine, this, &BacktraceWidget::backtraceNewLine); - - connect(ui.m_extraDetailsLabel, &QLabel::linkActivated, this, &BacktraceWidget::extraDetailsLinkActivated); - ui.m_extraDetailsLabel->setVisible(false); - ui.m_extraDetailsLabel->setStyleSheet(QLatin1String(extraDetailsLabelMargin)); - - //Setup the buttons - KGuiItem::assign(ui.m_reloadBacktraceButton, - KGuiItem2(i18nc("@action:button", "&Reload"), - QIcon::fromTheme(QStringLiteral("view-refresh")), i18nc("@info:tooltip", "Use this button to " - "reload the crash information (backtrace). This is useful when you have " - "installed the proper debug symbol packages and you want to obtain " - "a better backtrace."))); - connect(ui.m_reloadBacktraceButton, &QPushButton::clicked, this, &BacktraceWidget::regenerateBacktrace); - - KGuiItem::assign(ui.m_installDebugButton, - KGuiItem2(i18nc("@action:button", "&Install Debug Symbols"), - QIcon::fromTheme(QStringLiteral("system-software-update")), i18nc("@info:tooltip", "Use this button to " - "install the missing debug symbols packages."))); - ui.m_installDebugButton->setVisible(false); - connect(ui.m_installDebugButton, &QPushButton::clicked, this, &BacktraceWidget::installDebugPackages); - - KGuiItem::assign(ui.m_copyButton, KGuiItem2(QString(), QIcon::fromTheme(QStringLiteral("edit-copy")), - i18nc("@info:tooltip", "Use this button to copy the " - "crash information (backtrace) to the clipboard."))); - connect(ui.m_copyButton, &QPushButton::clicked, this, &BacktraceWidget::copyClicked); - ui.m_copyButton->setEnabled(false); - - KGuiItem::assign(ui.m_saveButton, KGuiItem2(QString(), - QIcon::fromTheme(QStringLiteral("document-save")), - i18nc("@info:tooltip", "Use this button to save the " - "crash information (backtrace) to a file. This is useful " - "if you want to take a look at it or to report the bug " - "later."))); - connect(ui.m_saveButton, &QPushButton::clicked, this, &BacktraceWidget::saveClicked); - ui.m_saveButton->setEnabled(false); - - //Create the rating widget - m_backtraceRatingWidget = new BacktraceRatingWidget(ui.m_statusWidget); - ui.m_statusWidget->addCustomStatusWidget(m_backtraceRatingWidget); - - ui.m_statusWidget->setIdle(QString()); - - //Do we need the "Show backtrace" toggle action ? - if (!showToggleBacktrace) { - ui.mainLayout->removeWidget(ui.m_toggleBacktraceCheckBox); - ui.m_toggleBacktraceCheckBox->setVisible(false); - toggleBacktrace(true); - } else { - //Generate help widget - ui.m_backtraceHelpLabel->setText( - i18n("

What is a \"backtrace\" ?

A backtrace basically describes what was " - "happening inside the application when it crashed, so the developers may track " - "down where the mess started. They may look meaningless to you, but they might " - "actually contain a wealth of useful information.
Backtraces are commonly " - "used during interactive and post-mortem debugging.

")); - ui.m_backtraceHelpIcon->setPixmap(QIcon::fromTheme(QStringLiteral("help-hint")).pixmap(48,48)); - connect(ui.m_toggleBacktraceCheckBox, &QCheckBox::toggled, this, &BacktraceWidget::toggleBacktrace); - toggleBacktrace(false); - } - - ui.m_backtraceEdit->setFont( QFontDatabase::systemFont(QFontDatabase::FixedFont) ); -} - -void BacktraceWidget::setAsLoading() -{ - //remove the syntax highlighter - delete m_highlighter; - m_highlighter = 0; - - //Set the widget as loading and disable all the action buttons - ui.m_backtraceEdit->setText(i18nc("@info:status", "Loading...")); - ui.m_backtraceEdit->setEnabled(false); - - ui.m_statusWidget->setBusy(i18nc("@info:status", - "Generating backtrace... (this may take some time)")); - m_backtraceRatingWidget->setUsefulness(BacktraceParser::Useless); - m_backtraceRatingWidget->setState(BacktraceGenerator::Loading); - - ui.m_extraDetailsLabel->setVisible(false); - ui.m_extraDetailsLabel->clear(); - - ui.m_installDebugButton->setVisible(false); - ui.m_reloadBacktraceButton->setEnabled(false); - - ui.m_copyButton->setEnabled(false); - ui.m_saveButton->setEnabled(false); -} - -//Force backtrace generation -void BacktraceWidget::regenerateBacktrace() -{ - setAsLoading(); - - if (!DrKonqi::debuggerManager()->debuggerIsRunning()) { - m_btGenerator->start(); - } else { - anotherDebuggerRunning(); - } - - emit stateChanged(); -} - -void BacktraceWidget::generateBacktrace() -{ - if (m_btGenerator->state() == BacktraceGenerator::NotLoaded) { - //First backtrace generation - regenerateBacktrace(); - } else if (m_btGenerator->state() == BacktraceGenerator::Loading) { - //Set in loading state, the widget will catch the backtrace events anyway - setAsLoading(); - emit stateChanged(); - } else { - //*Finished* states - setAsLoading(); - emit stateChanged(); - //Load already generated information - loadData(); - } -} - -void BacktraceWidget::anotherDebuggerRunning() -{ - //As another debugger is running, we should disable the actions and notify the user - ui.m_backtraceEdit->setEnabled(false); - ui.m_backtraceEdit->setText(i18nc("@info", "Another debugger is currently debugging the " - "same application. The crash information could not be fetched.")); - m_backtraceRatingWidget->setState(BacktraceGenerator::Failed); - m_backtraceRatingWidget->setUsefulness(BacktraceParser::Useless); - ui.m_statusWidget->setIdle(i18nc("@info:status", "The crash information could not be fetched.")); - ui.m_extraDetailsLabel->setVisible(true); - ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "Another debugging process is attached to " - "the crashed application. Therefore, the DrKonqi debugger cannot " - "fetch the backtrace. Please close the other debugger and " - "click Reload.")); - ui.m_installDebugButton->setVisible(false); - ui.m_reloadBacktraceButton->setEnabled(true); -} - -void BacktraceWidget::loadData() -{ - //Load the backtrace data from the generator - m_backtraceRatingWidget->setState(m_btGenerator->state()); - - if (m_btGenerator->state() == BacktraceGenerator::Loaded) { - ui.m_backtraceEdit->setEnabled(true); - ui.m_backtraceEdit->setPlainText(m_btGenerator->backtrace()); - - // scroll to crash - QTextCursor crashCursor = ui.m_backtraceEdit->document()->find(QStringLiteral("[KCrash Handler]")); - if (!crashCursor.isNull()) { - crashCursor.movePosition(QTextCursor::Up, QTextCursor::MoveAnchor); - ui.m_backtraceEdit->verticalScrollBar()->setValue(ui.m_backtraceEdit->cursorRect(crashCursor).top()); - } - - // highlight if possible - if (m_btGenerator->debugger().codeName() == QLatin1String("gdb")) { - m_highlighter = new GdbHighlighter(ui.m_backtraceEdit->document(), - m_btGenerator->parser()->parsedBacktraceLines()); - } - - BacktraceParser * btParser = m_btGenerator->parser(); - m_backtraceRatingWidget->setUsefulness(btParser->backtraceUsefulness()); - - //Generate the text to put in the status widget (backtrace usefulness) - QString usefulnessText; - switch (btParser->backtraceUsefulness()) { - case BacktraceParser::ReallyUseful: - usefulnessText = i18nc("@info", "The generated crash information is useful"); - break; - case BacktraceParser::MayBeUseful: - usefulnessText = i18nc("@info", "The generated crash information may be useful"); - break; - case BacktraceParser::ProbablyUseless: - usefulnessText = i18nc("@info", "The generated crash information is probably not useful"); - break; - case BacktraceParser::Useless: - usefulnessText = i18nc("@info", "The generated crash information is not useful"); - break; - default: - //let's hope nobody will ever see this... ;) - usefulnessText = i18nc("@info", "The rating of this crash information is invalid. " - "This is a bug in DrKonqi itself."); - break; - } - ui.m_statusWidget->setIdle(usefulnessText); - - if (btParser->backtraceUsefulness() != BacktraceParser::ReallyUseful) { - //Not a perfect bactrace, ask the user to try to improve it - ui.m_extraDetailsLabel->setVisible(true); - if (canInstallDebugPackages()) { - //The script to install the debug packages is available - ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "You can click the " - "Install Debug Symbols button in order to automatically " - "install the missing debugging information packages. If this method " - "does not work: please read How to " - "create useful crash reports to learn how to get a useful " - "backtrace; install the needed packages (" - "list of files) and click the " - "Reload button.", - QLatin1String(TECHBASE_HOWTO_DOC), - QLatin1String("#missingDebugPackages"))); - ui.m_installDebugButton->setVisible(true); - //Retrieve the libraries with missing debug info - QStringList missingLibraries = btParser->librariesWithMissingDebugSymbols().toList(); - m_debugPackageInstaller->setMissingLibraries(missingLibraries); - } else { - //No automated method to install the missing debug info - //Tell the user to read the howto and reload - ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "Please read How to " - "create useful crash reports to learn how to get a useful " - "backtrace; install the needed packages (" - "list of files) and click the " - "Reload button.", - QLatin1String(TECHBASE_HOWTO_DOC), - QLatin1String("#missingDebugPackages"))); - } - } - - ui.m_copyButton->setEnabled(true); - ui.m_saveButton->setEnabled(true); - } else if (m_btGenerator->state() == BacktraceGenerator::Failed) { - //The backtrace could not be generated because the debugger had an error - m_backtraceRatingWidget->setUsefulness(BacktraceParser::Useless); - - ui.m_statusWidget->setIdle(i18nc("@info:status", "The debugger has quit unexpectedly.")); - - ui.m_backtraceEdit->setPlainText(i18nc("@info:status", - "The crash information could not be generated.")); - - ui.m_extraDetailsLabel->setVisible(true); - ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "You could try to regenerate the " - "backtrace by clicking the Reload" - " button.")); - } else if (m_btGenerator->state() == BacktraceGenerator::FailedToStart) { - //The backtrace could not be generated because the debugger could not start (missing) - //Tell the user to install it. - m_backtraceRatingWidget->setUsefulness(BacktraceParser::Useless); - - ui.m_statusWidget->setIdle(i18nc("@info:status", "The debugger application is missing or " - "could not be launched.")); - - ui.m_backtraceEdit->setPlainText(i18nc("@info:status", - "The crash information could not be generated.")); - ui.m_extraDetailsLabel->setVisible(true); - ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "You need to first install the debugger " - "application (%1) then click the Reload" - " button.", - m_btGenerator->debugger().name())); - } - - ui.m_reloadBacktraceButton->setEnabled(true); - emit stateChanged(); -} - -void BacktraceWidget::backtraceNewLine(const QString & line) -{ - //While loading the backtrace (unparsed) a new line was sent from the debugger, append it - ui.m_backtraceEdit->append(line.trimmed()); -} - -void BacktraceWidget::copyClicked() -{ - ui.m_backtraceEdit->selectAll(); - ui.m_backtraceEdit->copy(); -} - -void BacktraceWidget::saveClicked() -{ - DrKonqi::saveReport(m_btGenerator->backtrace(), this); -} - -void BacktraceWidget::hilightExtraDetailsLabel(bool hilight) -{ - QString stylesheet; - if (hilight) { - stylesheet = QLatin1String("border-width: 2px; " - "border-style: solid; " - "border-color: red;"); - } else { - stylesheet = QLatin1String("border-width: 0px;"); - } - stylesheet += QLatin1String(extraDetailsLabelMargin); - ui.m_extraDetailsLabel->setStyleSheet(stylesheet); -} - -void BacktraceWidget::focusImproveBacktraceButton() -{ - ui.m_installDebugButton->setFocus(); -} - -void BacktraceWidget::installDebugPackages() -{ - ui.m_installDebugButton->setVisible(false); - m_debugPackageInstaller->installDebugPackages(); -} - -void BacktraceWidget::debugPackageError(const QString & errorMessage) -{ - ui.m_installDebugButton->setVisible(true); - KMessageBox::error(this, errorMessage, i18nc("@title:window", "Error during the installation of" - " debug symbols")); -} - -void BacktraceWidget::debugPackageCanceled() -{ - ui.m_installDebugButton->setVisible(true); -} - -bool BacktraceWidget::canInstallDebugPackages() const -{ - return m_debugPackageInstaller->canInstallDebugPackages(); -} - -void BacktraceWidget::toggleBacktrace(bool show) -{ - ui.m_backtraceStack->setCurrentWidget(show ? ui.backtracePage : ui.backtraceHelpPage); -} - -void BacktraceWidget::extraDetailsLinkActivated(QString link) -{ - if (link.startsWith(QLatin1String("http"))) { - //Open externally - QDesktopServices::openUrl(QUrl(link)); - } else if (link == QLatin1String("#missingDebugPackages")) { - BacktraceParser * btParser = m_btGenerator->parser(); - - QStringList missingDbgForFiles = btParser->librariesWithMissingDebugSymbols().toList(); - missingDbgForFiles.insert(0, DrKonqi::crashedApplication()->executable().absoluteFilePath()); - - //HTML message - QString message; - message = QLatin1String(""); - message += i18n("The packages containing debug information for the following application and libraries are missing:"); - message += QLatin1String("
    "); - - Q_FOREACH(const QString & string, missingDbgForFiles) { - message += "
  • " + string + "
  • "; - } - - message += QLatin1String("
"); - - KMessageBox::information(this, message, i18nc("messagebox title","Missing debug information packages")); - } -} - diff --git a/drkonqi/backtracewidget.h b/drkonqi/backtracewidget.h deleted file mode 100644 index 3cfcadc92..000000000 --- a/drkonqi/backtracewidget.h +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************* -* backtracewidget.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef BACKTRACEWIDGET__H -#define BACKTRACEWIDGET__H - -#include - -#include "debugpackageinstaller.h" -#include "ui_backtracewidget.h" - -class QSyntaxHighlighter; -class BacktraceRatingWidget; -class BacktraceGenerator; - -class BacktraceWidget: public QWidget -{ - Q_OBJECT - -public: - explicit BacktraceWidget(BacktraceGenerator *generator, QWidget *parent = 0, - bool showToggleBacktrace = false); - - bool canInstallDebugPackages() const; - -public Q_SLOTS: - void generateBacktrace(); - void hilightExtraDetailsLabel(bool hilight); - void focusImproveBacktraceButton(); - - void toggleBacktrace(bool show); - void extraDetailsLinkActivated(QString link); - -Q_SIGNALS: - void stateChanged(); - -private: - BacktraceGenerator * m_btGenerator; - Ui::Form ui; - BacktraceRatingWidget * m_backtraceRatingWidget; - QSyntaxHighlighter *m_highlighter; - DebugPackageInstaller * m_debugPackageInstaller; - - void setAsLoading(); - -private Q_SLOTS: - void loadData(); - void backtraceNewLine(const QString &); - - void regenerateBacktrace(); - - void saveClicked(); - void copyClicked(); - - void anotherDebuggerRunning(); - - void installDebugPackages(); - void debugPackageError(const QString &); - void debugPackageCanceled(); -}; - -#endif diff --git a/drkonqi/bugreportaddress.h b/drkonqi/bugreportaddress.h deleted file mode 100644 index a59264234..000000000 --- a/drkonqi/bugreportaddress.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef BUGREPORTADDRESS_H -#define BUGREPORTADDRESS_H - -#include - -#include "drkonqi_globals.h" - -class BugReportAddress : public QString -{ -public: - inline BugReportAddress() : QString() {} - inline BugReportAddress(const QString & address) - : QString(address == QLatin1String("submit@bugs.kde.org") ? KDE_BUGZILLA_URL : address) - {} - - inline bool isKdeBugzilla() const - { - return *this == KDE_BUGZILLA_URL; - } - - inline bool isEmail() const - { - return contains('@'); - } -}; - -#endif diff --git a/drkonqi/bugzillaintegration/bugzillalib.cpp b/drkonqi/bugzillaintegration/bugzillalib.cpp deleted file mode 100644 index 70bd3eb31..000000000 --- a/drkonqi/bugzillaintegration/bugzillalib.cpp +++ /dev/null @@ -1,685 +0,0 @@ -/******************************************************************* -* bugzillalib.cpp -* Copyright 2009, 2011 Dario Andres Rodriguez -* Copyright 2012 George Kiagiadakis -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "bugzillalib.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#define MAKE_BUGZILLA_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c)) - -static const char columns[] = "bug_severity,priority,bug_status,product,short_desc,resolution"; - -//Bugzilla URLs -static const char searchUrl[] = - "buglist.cgi?query_format=advanced&order=Importance&ctype=csv" - "&product=%1" - "&longdesc_type=allwordssubstr&longdesc=%2" - "&chfieldfrom=%3&chfieldto=%4&chfield=[Bug+creation]" - "&bug_severity=%5" - "&columnlist=%6"; -// short_desc, product, long_desc(possible backtraces lines), searchFrom, searchTo, severity, columnList -static const char showBugUrl[] = "show_bug.cgi?id=%1"; -static const char fetchBugUrl[] = "show_bug.cgi?id=%1&ctype=xml"; - -static inline Component buildComponent(const QVariantMap& map); -static inline Version buildVersion(const QVariantMap& map); -static inline Product buildProduct(const QVariantMap& map); - -//BEGIN BugzillaManager - -BugzillaManager::BugzillaManager(const QString &bugTrackerUrl, QObject *parent) - : QObject(parent) - , m_bugTrackerUrl(bugTrackerUrl) - , m_logged(false) - , m_searchJob(0) -{ - m_xmlRpcClient = new KXmlRpc::Client(QUrl(m_bugTrackerUrl + "xmlrpc.cgi"), this); - m_xmlRpcClient->setUserAgent(QLatin1String("DrKonqi")); - // Allow constructors for ReportInterface and assistant dialogs to finish. - // We do not want them to be racing the remote Bugzilla database. - QMetaObject::invokeMethod (this, "lookupVersion", Qt::QueuedConnection); -} - -// BEGIN Checks of Bugzilla software versions. -void BugzillaManager::lookupVersion() -{ - QMap args; - callBugzilla("Bugzilla.version", "version", args, SecurityDisabled); -} - -void BugzillaManager::setFeaturesForVersion(const QString& version) -{ - // A procedure to change Dr Konqi behaviour automatically when Bugzilla - // software versions change. - // - // Changes should be added to Dr Konqi AHEAD of when the corresponding - // Bugzilla software changes are released into bugs.kde.org, so that - // Dr Konqi can continue to operate smoothly, without bug reports and a - // reactive KDE software release. - // - // If Bugzilla announces a change to its software that affects Dr Konqi, - // add executable code to implement the change automatically when the - // Bugzilla software version changes. It goes at the end of this procedure - // and elsewhere in this class (BugzillaManager) and/or other classes where - // the change should actually be implemented. - - const int nVersionParts = 3; - QString seps = QLatin1String("[._-]"); - QStringList digits = version.split(QRegExp(seps), QString::SkipEmptyParts); - while (digits.count() < nVersionParts) { - digits << QLatin1String("0"); - } - if (digits.count() > nVersionParts) { - qWarning() << QStringLiteral("Current Bugzilla version %1 has more than %2 parts. Check that this is not a problem.").arg(version).arg(nVersionParts); - } - int currentVersion = MAKE_BUGZILLA_VERSION(digits.at(0).toUInt(), - digits.at(1).toUInt(), digits.at(2).toUInt()); - - // Set the code(s) for historical versions of Bugzilla - before any change. - m_security = UseCookies; // Used to have cookies for update-security. - - if (currentVersion >= MAKE_BUGZILLA_VERSION(4, 4, 3)) { - // Security method changes from cookies to tokens in Bugzilla 4.4.3. - // BUT, tokens fail when kio_http sends any cookies found in KCookieJar, - // so go directly to passwords-only security (supported since Bugzilla - // 3.6 and will be enforced in Bugzilla 4.5.x). - m_security = UsePasswords; - } - - qDebug() << "VERSION" << version << "SECURITY" << m_security; -} -// END Checks of Bugzilla software versions. - -// BEGIN Generic remote-procedure (RPC) call to Bugzilla -void BugzillaManager::callBugzilla(const char* method, const char* id, - QMap& args, - SecurityStatus security) -{ - if (security == SecurityEnabled) { - switch (m_security) { - case UseTokens: - qDebug() << method << id << "using token"; - args.insert(QLatin1String("Bugzilla_token"), m_token); - break; - case UsePasswords: - qDebug() << method << id << "using username" << m_username; - args.insert(QLatin1String("Bugzilla_login"), m_username); - args.insert(QLatin1String("Bugzilla_password"), m_password); - break; - case UseCookies: - qDebug() << method << id << "using cookies"; - // Some KDE process other than Dr Konqi should provide cookies. - break; - } - } - - m_xmlRpcClient->call(QLatin1String(method), args, - this, SLOT(callMessage(QList,QVariant)), - this, SLOT(callFault(int,QString,QVariant)), - QLatin1String(id)); -} -// END Generic call to Bugzilla - -//BEGIN Login methods -void BugzillaManager::tryLogin(const QString& username, const QString& password) -{ - m_username = username; - if (m_security == UsePasswords) { - m_password = password; - } - m_logged = false; - - QMap args; - args.insert(QLatin1String("login"), username); - args.insert(QLatin1String("password"), password); - if (m_security == UseCookies) { - // Removed in Bugzilla 4.4.3 software, which no longer issues cookies. - args.insert(QLatin1String("remember"), false); - } - - callBugzilla("User.login", "login", args, SecurityDisabled); -} - -bool BugzillaManager::getLogged() const -{ - return m_logged; -} - -QString BugzillaManager::getUsername() const -{ - return m_username; -} -//END Login methods - -//BEGIN Bugzilla Action methods -void BugzillaManager::fetchBugReport(int bugnumber, QObject * jobOwner) -{ - QUrl url(m_bugTrackerUrl + QString(fetchBugUrl).arg(bugnumber)); - - if (!jobOwner) { - jobOwner = this; - } - - KIO::Job * fetchBugJob = KIO::storedGet(url, KIO::Reload, KIO::HideProgressInfo); - fetchBugJob->setParent(jobOwner); - connect(fetchBugJob, &KIO::Job::finished, this, &BugzillaManager::fetchBugJobFinished); -} - - -void BugzillaManager::searchBugs(const QStringList & products, - const QString & severity, const QString & date_start, - const QString & date_end, QString comment) -{ - QString product; - if (products.size() > 0) { - if (products.size() == 1) { - product = products.at(0); - } else { - Q_FOREACH(const QString & p, products) { - product += p + "&product="; - } - product = product.mid(0,product.size()-9); - } - } - - QString url = QString(m_bugTrackerUrl) + - QString(searchUrl).arg(product, comment.replace(' ' , '+'), date_start, - date_end, severity, QString(columns)); - - stopCurrentSearch(); - - m_searchJob = KIO::storedGet(QUrl(url) , KIO::Reload, KIO::HideProgressInfo); - connect(m_searchJob, &KIO::Job::finished, this, &BugzillaManager::searchBugsJobFinished); -} - -void BugzillaManager::sendReport(const BugReport & report) -{ - QMap args; - args.insert(QLatin1String("product"), report.product()); - args.insert(QLatin1String("component"), report.component()); - args.insert(QLatin1String("version"), report.version()); - args.insert(QLatin1String("summary"), report.shortDescription()); - args.insert(QLatin1String("description"), report.description()); - args.insert(QLatin1String("op_sys"), report.operatingSystem()); - args.insert(QLatin1String("platform"), report.platform()); - args.insert(QLatin1String("keywords"), report.keywords()); - args.insert(QLatin1String("priority"), report.priority()); - args.insert(QLatin1String("severity"), report.bugSeverity()); - - callBugzilla("Bug.create", "Bug.create", args, SecurityEnabled); -} - -void BugzillaManager::attachTextToReport(const QString & text, const QString & filename, - const QString & summary, int bugId, const QString & comment) -{ - QMap args; - args.insert(QLatin1String("ids"), QVariantList() << bugId); - args.insert(QLatin1String("file_name"), filename); - args.insert(QLatin1String("summary"), summary); - args.insert(QLatin1String("comment"), comment); - args.insert(QLatin1String("content_type"), QLatin1String("text/plain")); - - //data needs to be a QByteArray so that it is encoded in base64 (query.cpp:246) - args.insert(QLatin1String("data"), text.toUtf8()); - - callBugzilla("Bug.add_attachment", "Bug.add_attachment", args, - SecurityEnabled); -} - -void BugzillaManager::addMeToCC(int bugId) -{ - QMap args; - args.insert(QLatin1String("ids"), QVariantList() << bugId); - - QMap ccChanges; - ccChanges.insert(QLatin1String("add"), QVariantList() << m_username); - args.insert(QLatin1String("cc"), ccChanges); - - callBugzilla("Bug.update", "Bug.update.cc", args, SecurityEnabled); -} - -void BugzillaManager::fetchProductInfo(const QString & product) -{ - QMap args; - - args.insert(QStringLiteral("names"), (QStringList() << product) ) ; - - QStringList includeFields; - // currently we only need these informations - includeFields << QStringLiteral("name") << QStringLiteral("is_active") << QStringLiteral("components") << QStringLiteral("versions"); - - args.insert(QStringLiteral("include_fields"), includeFields) ; - - callBugzilla("Product.get", "Product.get.versions", args, SecurityDisabled); -} - - -//END Bugzilla Action methods - -//BEGIN Misc methods -QString BugzillaManager::urlForBug(int bug_number) const -{ - return QString(m_bugTrackerUrl) + QString(showBugUrl).arg(bug_number); -} - -void BugzillaManager::stopCurrentSearch() -{ - if (m_searchJob) { //Stop previous searchJob - m_searchJob->disconnect(); - m_searchJob->kill(); - m_searchJob = 0; - } -} -//END Misc methods - -//BEGIN Slots to handle KJob::finished - -void BugzillaManager::fetchBugJobFinished(KJob* job) -{ - if (!job->error()) { - KIO::StoredTransferJob * fetchBugJob = static_cast(job); - - BugReportXMLParser * parser = new BugReportXMLParser(fetchBugJob->data()); - BugReport report = parser->parse(); - - if (parser->isValid()) { - emit bugReportFetched(report, job->parent()); - } else { - emit bugReportError(i18nc("@info","Invalid report information (malformed data). This " - "could mean that the bug report does not exist, or the " - "bug tracking site is experiencing a problem."), job->parent()); - } - - delete parser; - } else { - emit bugReportError(job->errorString(), job->parent()); - } -} - -void BugzillaManager::searchBugsJobFinished(KJob * job) -{ - if (!job->error()) { - KIO::StoredTransferJob * searchBugsJob = static_cast(job); - - BugListCSVParser * parser = new BugListCSVParser(searchBugsJob->data()); - BugMapList list = parser->parse(); - - if (parser->isValid()) { - emit searchFinished(list); - } else { - emit searchError(i18nc("@info","Invalid bug list: corrupted data")); - } - - delete parser; - } else { - emit searchError(job->errorString()); - } - - m_searchJob = 0; -} - -static inline Component buildComponent(const QVariantMap& map) -{ - QString name = map.value(QStringLiteral("name")).toString(); - bool active = map.value(QStringLiteral("is_active")).toBool(); - - return Component(name, active); -} - -static inline Version buildVersion(const QVariantMap& map) -{ - QString name = map.value(QStringLiteral("name")).toString(); - bool active = map.value(QStringLiteral("is_active")).toBool(); - - return Version(name, active); -} - -static inline Product buildProduct(const QVariantMap& map) -{ - QString name = map.value(QStringLiteral("name")).toString(); - bool active = map.value(QStringLiteral("is_active")).toBool(); - - Product product(name, active); - - QVariantList components = map.value(QStringLiteral("components")).toList(); - foreach (const QVariant& c, components) { - Component component = buildComponent(c.toMap()); - product.addComponent(component); - - } - - QVariantList versions = map.value(QStringLiteral("versions")).toList(); - foreach (const QVariant& v, versions) { - Version version = buildVersion(v.toMap()); - product.addVersion(version); - } - - return product; -} - -void BugzillaManager::fetchProductInfoFinished(const QVariantMap & map) -{ - QList products; - - QVariantList plist = map.value(QStringLiteral("products")).toList(); - foreach (const QVariant& p, plist) { - Product product = buildProduct(p.toMap()); - products.append(product); - } - - if ( products.size() > 0 ) { - emit productInfoFetched(products.at(0)); - } else { - emit productInfoError(); - } -} - -//END Slots to handle KJob::finished - -void BugzillaManager::callMessage(const QList & result, const QVariant & id) -{ - qDebug() << id << result; - - if (id.toString() == QLatin1String("login")) { - if ((m_security == UseTokens) && (result.count() > 0)) { - QVariantMap map = result.at(0).toMap(); - m_token = map.value(QLatin1String("token")).toString(); - } - m_logged = true; - Q_EMIT loginFinished(true); - } else if (id.toString() == QLatin1String("Product.get.versions")) { - QVariantMap map = result.at(0).toMap(); - fetchProductInfoFinished(map); - } else if (id.toString() == QLatin1String("Bug.create")) { - QVariantMap map = result.at(0).toMap(); - int bug_id = map.value(QLatin1String("id")).toInt(); - Q_ASSERT(bug_id != 0); - Q_EMIT reportSent(bug_id); - } else if (id.toString() == QLatin1String("Bug.add_attachment")) { - QVariantMap map = result.at(0).toMap(); - if (map.contains(QLatin1String("attachments"))){ // for bugzilla 4.2 - map = map.value(QLatin1String("attachments")).toMap(); - map = map.constBegin()->toMap(); - const int attachment_id = map.value(QLatin1String("id")).toInt(); - Q_EMIT attachToReportSent(attachment_id); - } else if (map.contains(QLatin1String("ids"))) { // for bugzilla 4.4 - const int attachment_id = map.value(QLatin1String("ids")).toList().at(0).toInt(); - Q_EMIT attachToReportSent(attachment_id); - } - } else if (id.toString() == QLatin1String("Bug.update.cc")) { - QVariantMap map = result.at(0).toMap().value(QLatin1String("bugs")).toList().at(0).toMap(); - int bug_id = map.value(QLatin1String("id")).toInt(); - Q_ASSERT(bug_id != 0); - Q_EMIT addMeToCCFinished(bug_id); - } else if (id.toString() == QLatin1String("version")) { - QVariantMap map = result.at(0).toMap(); - QString bugzillaVersion = map.value(QLatin1String("version")).toString(); - setFeaturesForVersion(bugzillaVersion); - Q_EMIT bugzillaVersionFound(); - } -} - -void BugzillaManager::callFault(int errorCode, const QString & errorString, const QVariant & id) -{ - qDebug() << id << errorCode << errorString; - - QString genericError = i18nc("@info", "Received unexpected error code %1 from bugzilla. " - "Error message was: %2", errorCode, errorString); - - if (id.toString() == QLatin1String("login")) { - switch(errorCode) { - case 300: //invalid username or password - Q_EMIT loginFinished(false); //TODO replace with loginError - break; - default: - Q_EMIT loginError(genericError); - break; - } - } else if (id.toString() == QLatin1String("Bug.create")) { - switch (errorCode) { - case 51: //invalid object (one example is invalid platform value) - case 105: //invalid component - case 106: //invalid product - Q_EMIT sendReportErrorInvalidValues(); - break; - default: - Q_EMIT sendReportError(genericError); - break; - } - } else if (id.toString() == QLatin1String("Bug.add_attachment")) { - switch (errorCode) { - default: - Q_EMIT attachToReportError(genericError); - break; - } - } else if (id.toString() == QLatin1String("Bug.update.cc")) { - switch (errorCode) { - default: - Q_EMIT addMeToCCError(genericError); - break; - } - } -} - -//END BugzillaManager - -//BEGIN BugzillaCSVParser - -BugListCSVParser::BugListCSVParser(const QByteArray& data) -{ - m_data = data; - m_isValid = false; -} - -BugMapList BugListCSVParser::parse() -{ - BugMapList list; - - if (!m_data.isEmpty()) { - //Parse buglist CSV - QTextStream ts(&m_data); - QString headersLine = ts.readLine().remove(QLatin1Char('\"')) ; //Discard headers - QString expectedHeadersLine = QString(columns); - - if (headersLine == (QStringLiteral("bug_id,") + expectedHeadersLine)) { - QStringList headers = expectedHeadersLine.split(',', QString::KeepEmptyParts); - int headersCount = headers.count(); - - while (!ts.atEnd()) { - BugMap bug; //bug report data map - - QString line = ts.readLine(); - - //Get bug_id (always at first column) - int bug_id_index = line.indexOf(','); - QString bug_id = line.left(bug_id_index); - bug.insert(QStringLiteral("bug_id"), bug_id); - - line = line.mid(bug_id_index + 2); - - QStringList fields = line.split(QStringLiteral(",\"")); - - for (int i = 0; i < headersCount && i < fields.count(); i++) { - QString field = fields.at(i); - field = field.left(field.size() - 1) ; //Remove trailing " - bug.insert(headers.at(i), field); - } - - list.append(bug); - } - - m_isValid = true; - } - } - - return list; -} - -//END BugzillaCSVParser - -//BEGIN BugzillaXMLParser - -BugReportXMLParser::BugReportXMLParser(const QByteArray & data) -{ - m_valid = m_xml.setContent(data, true); -} - -BugReport BugReportXMLParser::parse() -{ - BugReport report; //creates an invalid and empty report object - - if (m_valid) { - //Check bug notfound - QDomNodeList bug_number = m_xml.elementsByTagName(QStringLiteral("bug")); - QDomNode d = bug_number.at(0); - QDomNamedNodeMap a = d.attributes(); - QDomNode d2 = a.namedItem(QStringLiteral("error")); - m_valid = d2.isNull(); - - if (m_valid) { - report.setValid(true); - - //Get basic fields - report.setBugNumber(getSimpleValue(QStringLiteral("bug_id"))); - report.setShortDescription(getSimpleValue(QStringLiteral("short_desc"))); - report.setProduct(getSimpleValue(QStringLiteral("product"))); - report.setComponent(getSimpleValue(QStringLiteral("component"))); - report.setVersion(getSimpleValue(QStringLiteral("version"))); - report.setOperatingSystem(getSimpleValue(QStringLiteral("op_sys"))); - report.setBugStatus(getSimpleValue(QStringLiteral("bug_status"))); - report.setResolution(getSimpleValue(QStringLiteral("resolution"))); - report.setPriority(getSimpleValue(QStringLiteral("priority"))); - report.setBugSeverity(getSimpleValue(QStringLiteral("bug_severity"))); - report.setMarkedAsDuplicateOf(getSimpleValue(QStringLiteral("dup_id"))); - report.setVersionFixedIn(getSimpleValue(QStringLiteral("cf_versionfixedin"))); - - //Parse full content + comments - QStringList m_commentList; - QDomNodeList comments = m_xml.elementsByTagName(QStringLiteral("long_desc")); - for (int i = 0; i < comments.count(); i++) { - QDomElement element = comments.at(i).firstChildElement(QStringLiteral("thetext")); - m_commentList << element.text(); - } - - report.setComments(m_commentList); - - } //isValid - } //isValid - - return report; -} - -QString BugReportXMLParser::getSimpleValue(const QString & name) //Extract an unique tag from XML -{ - QString ret; - - QDomNodeList bug_number = m_xml.elementsByTagName(name); - if (bug_number.count() == 1) { - QDomNode node = bug_number.at(0); - ret = node.toElement().text(); - } - return ret; -} - -//END BugzillaXMLParser - -void BugReport::setBugStatus(const QString &stat) -{ - setData(QStringLiteral("bug_status"), stat); - - m_status = parseStatus(stat); -} - -void BugReport::setResolution(const QString &res) -{ - setData(QStringLiteral("resolution"), res); - - m_resolution = parseResolution(res); -} - -BugReport::Status BugReport::parseStatus(const QString &stat) -{ - if (stat == QLatin1String("UNCONFIRMED")) { - return Unconfirmed; - } else if (stat == QLatin1String("CONFIRMED")) { - return New; - } else if (stat == QLatin1String("ASSIGNED")) { - return Assigned; - } else if (stat == QLatin1String("REOPENED")) { - return Reopened; - } else if (stat == QLatin1String("RESOLVED")) { - return Resolved; - } else if (stat == QLatin1String("NEEDSINFO")) { - return NeedsInfo; - } else if (stat == QLatin1String("VERIFIED")) { - return Verified; - } else if (stat == QLatin1String("CLOSED")) { - return Closed; - } else { - return UnknownStatus; - } -} - -BugReport::Resolution BugReport::parseResolution(const QString &res) -{ - if (res.isEmpty()) { - return NotResolved; - } else if (res == QLatin1String("FIXED")) { - return Fixed; - } else if (res == QLatin1String("INVALID")) { - return Invalid; - } else if (res == QLatin1String("WONTFIX")) { - return WontFix; - } else if (res == QLatin1String("LATER")) { - return Later; - } else if (res == QLatin1String("REMIND")) { - return Remind; - } else if (res == QLatin1String("DUPLICATE")) { - return Duplicate; - } else if (res == QLatin1String("WORKSFORME")) { - return WorksForMe; - } else if (res == QLatin1String("MOVED")) { - return Moved; - } else if (res == QLatin1String("UPSTREAM")) { - return Upstream; - } else if (res == QLatin1String("DOWNSTREAM")) { - return Downstream; - } else if (res == QLatin1String("WAITINGFORINFO")) { - return WaitingForInfo; - } else if (res == QLatin1String("BACKTRACE")) { - return Backtrace; - } else if (res == QLatin1String("UNMAINTAINED")) { - return Unmaintained; - } else { - return UnknownResolution; - } -} diff --git a/drkonqi/bugzillaintegration/bugzillalib.h b/drkonqi/bugzillaintegration/bugzillalib.h deleted file mode 100644 index 803c4caf5..000000000 --- a/drkonqi/bugzillaintegration/bugzillalib.h +++ /dev/null @@ -1,444 +0,0 @@ -/******************************************************************* -* bugzillalib.h -* Copyright 2009, 2011 Dario Andres Rodriguez -* Copyright 2012 George Kiagiadakis -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef BUGZILLALIB__H -#define BUGZILLALIB__H - -#include -#include -#include -#include - -#include - -namespace KIO { class Job; } -class KJob; -class QString; -class QByteArray; - -//Typedefs for Bug Report Listing -typedef QMap BugMap; //Report basic fields map -typedef QList BugMapList; //List of reports - -//Main bug report data, full fields + comments -class BugReport -{ -public: - enum Status { - UnknownStatus, - Unconfirmed, - New, - Assigned, - Reopened, - Resolved, - NeedsInfo, - Verified, - Closed - }; - - enum Resolution { - UnknownResolution, - NotResolved, - Fixed, - Invalid, - WontFix, - Later, - Remind, - Duplicate, - WorksForMe, - Moved, - Upstream, - Downstream, - WaitingForInfo, - Backtrace, - Unmaintained - }; - - BugReport() - : m_isValid(false), - m_status(UnknownStatus), - m_resolution(UnknownResolution) - {} - - void setBugNumber(const QString & value) { - setData(QStringLiteral("bug_id"), value); - } - QString bugNumber() const { - return getData(QStringLiteral("bug_id")); - } - int bugNumberAsInt() const { - return getData(QStringLiteral("bug_id")).toInt(); - } - - void setShortDescription(const QString & value) { - setData(QStringLiteral("short_desc"), value); - } - QString shortDescription() const { - return getData(QStringLiteral("short_desc")); - } - - void setProduct(const QString & value) { - setData(QStringLiteral("product"), value); - } - QString product() const { - return getData(QStringLiteral("product")); - } - - void setComponent(const QString & value) { - setData(QStringLiteral("component"), value); - } - QString component() const { - return getData(QStringLiteral("component")); - } - - void setVersion(const QString & value) { - setData(QStringLiteral("version"), value); - } - QString version() const { - return getData(QStringLiteral("version")); - } - - void setOperatingSystem(const QString & value) { - setData(QStringLiteral("op_sys"), value); - } - QString operatingSystem() const { - return getData(QStringLiteral("op_sys")); - } - - void setPlatform(const QString & value) { - setData(QStringLiteral("rep_platform"), value); - } - QString platform() const { - return getData(QStringLiteral("rep_platform")); - } - - void setBugStatus(const QString &status); - QString bugStatus() const { - return getData(QStringLiteral("bug_status")); - } - - void setResolution(const QString &resolution); - QString resolution() const { - return getData(QStringLiteral("resolution")); - } - - Status statusValue() const { - return m_status; - } - - Resolution resolutionValue() const { - return m_resolution; - } - - void setPriority(const QString & value) { - setData(QStringLiteral("priority"), value); - } - QString priority() const { - return getData(QStringLiteral("priority")); - } - - void setBugSeverity(const QString & value) { - setData(QStringLiteral("bug_severity"), value); - } - QString bugSeverity() const { - return getData(QStringLiteral("bug_severity")); - } - - void setKeywords(const QStringList & keywords) { - setData(QStringLiteral("keywords"), keywords.join(QStringLiteral(","))); - } - QStringList keywords() const { - return getData(QStringLiteral("keywords")).split(','); - } - - void setDescription(const QString & desc) { - m_commentList.insert(0, desc); - } - QString description() const { - return m_commentList.at(0); - } - - void setComments(const QStringList & comm) { - m_commentList.append(comm); - } - QStringList comments() const { - return m_commentList.mid(1); - } - - void setMarkedAsDuplicateOf(const QString & dupID) { - setData(QStringLiteral("dup_id"), dupID); - } - QString markedAsDuplicateOf() const { - return getData(QStringLiteral("dup_id")); - } - - void setVersionFixedIn(const QString & dupID) { - setData(QStringLiteral("cf_versionfixedin"), dupID); - } - QString versionFixedIn() const { - return getData(QStringLiteral("cf_versionfixedin")); - } - - void setValid(bool valid) { - m_isValid = valid; - } - bool isValid() const { - return m_isValid; - } - - /** - * @return true if the bug report is still open - * @note false does not mean, that the bug report is closed, - * as the status could be unknown - */ - bool isOpen() const { - return isOpen(m_status); - } - - static bool isOpen(Status status) { - return (status == Unconfirmed || status == New || status == Assigned || status == Reopened); - } - - /** - * @return true if the bug report is closed - * @note false does not mean, that the bug report is still open, - * as the status could be unknown - */ - bool isClosed() const { - return isClosed(m_status); - } - - static bool isClosed(Status status) { - return (status == Resolved || status == NeedsInfo || status == Verified || status == Closed); - } - - static Status parseStatus(const QString &text); - static Resolution parseResolution(const QString &text); - -private: - void setData(const QString & key, const QString & val) { - m_dataMap.insert(key, val); - } - QString getData(const QString & key) const { - return m_dataMap.value(key); - } - - bool m_isValid; - Status m_status; - Resolution m_resolution; - - BugMap m_dataMap; - QStringList m_commentList; -}; - -//XML parser that creates a BugReport object -class BugReportXMLParser -{ -public: - explicit BugReportXMLParser(const QByteArray &); - - BugReport parse(); - - bool isValid() const { - return m_valid; - } - -private: - QString getSimpleValue(const QString &); - - bool m_valid; - QDomDocument m_xml; -}; - -class BugListCSVParser -{ -public: - explicit BugListCSVParser(const QByteArray&); - - bool isValid() const { - return m_isValid; - } - - BugMapList parse(); - -private: - bool m_isValid; - QByteArray m_data; -}; - -class Component -{ -public: - Component(const QString& name, bool active): m_name(name), m_active(active) {} - - QString name() const { return m_name; } - bool active() const { return m_active; } - -private: - QString m_name; - bool m_active; -}; - -class Version -{ -public: - - Version(const QString& name, bool active): m_name(name), m_active(active) {} - - QString name() const { return m_name; } - bool active() const { return m_active; } - -private: - QString m_name; - bool m_active; -}; - - -class Product -{ -public: - - Product(const QString& name, bool active): m_name(name), m_active(active) {} - - bool isActive() const { return m_active; } - - void addComponent(const Component& component) { - m_allComponents.append(component.name()); - } - - void addVersion(const Version& version) { - m_allVersions.append(version.name()); - - if (version.active()) { - m_activeVersions.append(version.name()); - } else { - m_inactiveVersions.append(version.name()); - } - } - - QStringList components() const { return m_allComponents; } - - QStringList allVersions() const { return m_allVersions; } - QStringList activeVersions() const { return m_activeVersions; } - QStringList inactiveVersions() const { return m_inactiveVersions; } - -private: - - QString m_name; - bool m_active; - - QStringList m_allComponents; - - QStringList m_allVersions; - QStringList m_activeVersions; - QStringList m_inactiveVersions; - -}; - -class BugzillaManager : public QObject -{ - Q_OBJECT - -public: - // Note: it expect the bugTrackerUrl parameter to contain the trailing slash. - // so it should be "https://bugs.kde.org/", not "https://bugs.kde.org" - explicit BugzillaManager(const QString &bugTrackerUrl, QObject *parent = 0); - - /* Login methods */ - void tryLogin(const QString&, const QString&); - bool getLogged() const; - - QString getUsername() const; - - /* Bugzilla Action methods */ - void fetchBugReport(int, QObject * jobOwner = 0); - - void searchBugs(const QStringList & products, const QString & severity, - const QString & date_start, const QString & date_end , QString comment); - - void sendReport(const BugReport & report); - - void attachTextToReport(const QString & text, const QString & filename, - const QString & description, int bugId, const QString & comment); - - void addMeToCC(int bugId); - - void fetchProductInfo(const QString &); - - /* Misc methods */ - QString urlForBug(int bug_number) const; - - void stopCurrentSearch(); - - /* Codes for security methods used by Bugzilla in various versions. */ - enum SecurityMethod {UseCookies, UseTokens, UsePasswords}; - SecurityMethod securityMethod() { return m_security; }; - -private Q_SLOTS: - /* Slots to handle KJob::finished */ - void fetchBugJobFinished(KJob*); - void searchBugsJobFinished(KJob*); - void fetchProductInfoFinished(const QVariantMap&); - - void lookupVersion(); - - void callMessage(const QList & result, const QVariant & id); - void callFault(int errorCode, const QString & errorString, const QVariant &id); - -Q_SIGNALS: - /* Bugzilla actions finished successfully */ - void loginFinished(bool); - void bugReportFetched(BugReport, QObject *); - void searchFinished(const BugMapList &); - void reportSent(int); - void attachToReportSent(int); - void addMeToCCFinished(int); - void productInfoFetched(Product); - void bugzillaVersionFound(); - - /* Bugzilla actions had errors */ - void loginError(const QString & errorMsg, const QString & extendedErrorMsg = QString()); - void bugReportError(const QString &, QObject *); - void searchError(const QString &); - void sendReportError(const QString & errorMsg, const QString & extendedErrorMsg = QString()); - void sendReportErrorInvalidValues(); //To use default values - void attachToReportError(const QString & errorMsg, const QString & extendedErrorMsg = QString()); - void addMeToCCError(const QString & errorMsg, const QString & extendedErrorMsg = QString()); - void productInfoError(); - -private: - QString m_bugTrackerUrl; - QString m_username; - QString m_token; - QString m_password; - bool m_logged; - SecurityMethod m_security; - - KIO::Job * m_searchJob; - KXmlRpc::Client *m_xmlRpcClient; - - enum SecurityStatus {SecurityDisabled, SecurityEnabled}; - void callBugzilla(const char* method, const char* id, - QMap& args, - SecurityStatus security); - void setFeaturesForVersion(const QString& version); -}; - -#endif diff --git a/drkonqi/bugzillaintegration/duplicatefinderjob.cpp b/drkonqi/bugzillaintegration/duplicatefinderjob.cpp deleted file mode 100644 index 072ffd0c3..000000000 --- a/drkonqi/bugzillaintegration/duplicatefinderjob.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************* -* duplicatefinderjob.cpp -* Copyright 2011 Matthias Fuchs -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "duplicatefinderjob.h" - -#include - -#include "backtracegenerator.h" -#include "parser/backtraceparser.h" -#include "debuggermanager.h" -#include "drkonqi.h" -#include "parsebugbacktraces.h" - -DuplicateFinderJob::DuplicateFinderJob(const QList &bugIds, BugzillaManager *manager, QObject *parent) - : KJob(parent), - m_manager(manager), - m_bugIds(bugIds) -{ - qDebug() << "Possible duplicates:" << m_bugIds; - connect(m_manager, &BugzillaManager::bugReportFetched, this, &DuplicateFinderJob::slotBugReportFetched); - connect(m_manager, &BugzillaManager::bugReportError, this, &DuplicateFinderJob::slotBugReportError); -} - -DuplicateFinderJob::~DuplicateFinderJob() -{ -} - -void DuplicateFinderJob::start() -{ - analyzeNextBug(); -} - -DuplicateFinderJob::Result DuplicateFinderJob::result() const -{ - return m_result; -} - -void DuplicateFinderJob::analyzeNextBug() -{ - if (m_bugIds.isEmpty()) { - emitResult(); - return; - } - - const int bugId = m_bugIds.takeFirst(); - qDebug() << "Fetching:" << bugId; - m_manager->fetchBugReport(bugId, this); -} - -void DuplicateFinderJob::fetchBug(const QString &bugId) -{ - bool ok; - const int num = bugId.toInt(&ok); - if (ok) { - qDebug() << "Fetching:" << bugId; - m_manager->fetchBugReport(num, this); - } else { - qDebug() << "Bug id not valid:" << bugId; - analyzeNextBug(); - } -} - -void DuplicateFinderJob::slotBugReportFetched(const BugReport &bug, QObject *owner) -{ - if (this != owner) { - return; - } - - ParseBugBacktraces parse(bug, this); - parse.parse(); - - BacktraceGenerator *btGenerator = DrKonqi::debuggerManager()->backtraceGenerator(); - const ParseBugBacktraces::DuplicateRating rating = parse.findDuplicate(btGenerator->parser()->parsedBacktraceLines()); - qDebug() << "Duplicate rating:" << rating; - - //TODO handle more cases here - if (rating != ParseBugBacktraces::PerfectDuplicate) { - qDebug() << "Bug" << bug.bugNumber() << "most likely not a duplicate:" << rating; - analyzeNextBug(); - return; - } - - //The Bug is a duplicate, now find out the status and resolution of the existing report - if (bug.resolutionValue() == BugReport::Duplicate) { - qDebug() << "Found duplicate is a duplicate itself."; - if (!m_result.duplicate) { - m_result.duplicate = bug.bugNumberAsInt(); - } - fetchBug(bug.markedAsDuplicateOf()); - } else if ((bug.statusValue() == BugReport::UnknownStatus) || (bug.resolutionValue() == BugReport::UnknownResolution)) { - qDebug() << "Either the status or the resolution is unknown."; - qDebug() << "Status \"" << bug.bugStatus() << "\" known:" << (bug.statusValue() != BugReport::UnknownStatus); - qDebug() << "Resolution \"" << bug.resolution() << "\" known:" << (bug.resolutionValue() != BugReport::UnknownResolution); - analyzeNextBug(); - } else { - if (!m_result.duplicate) { - m_result.duplicate = bug.bugNumberAsInt(); - } - m_result.parentDuplicate = bug.bugNumberAsInt(); - m_result.status = bug.statusValue(); - m_result.resolution = bug.resolutionValue(); - qDebug() << "Found duplicate information (id/status/resolution):" << bug.bugNumber() << bug.bugStatus() << bug.resolution(); - emitResult(); - } -} - -void DuplicateFinderJob::slotBugReportError(const QString &message, QObject *owner) -{ - if (this != owner) { - return; - } - qDebug() << "Error fetching bug:" << message; - analyzeNextBug(); -} diff --git a/drkonqi/bugzillaintegration/duplicatefinderjob.h b/drkonqi/bugzillaintegration/duplicatefinderjob.h deleted file mode 100644 index d3d0ea5fb..000000000 --- a/drkonqi/bugzillaintegration/duplicatefinderjob.h +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************* -* duplicatefinderjob.h -* Copyright 2011 Matthias Fuchs -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef DUPLICATE_FINDER_H -#define DUPLICATE_FINDER_H - -#include - -#include - -#include "bugzillalib.h" - -/** - * Looks if of the current backtrace is a - * duplicate of any of the specified bug ids. - * If a duplicate is found result is emitted instantly - */ -class DuplicateFinderJob : public KJob -{ - Q_OBJECT - public: - struct Result - { - Result() - : duplicate(0), - parentDuplicate(0), - status(BugReport::UnknownStatus), - resolution(BugReport::UnknownResolution) - {} - - /** - * First duplicate that was found, it might be that - * this one is a duplicate itself, though this is still - * useful for example to inform the user that their - * backtrace is a duplicate of this bug, which is - * tracked at another number though. - * - * @note 0 means that there is no duplicate - * @see parrentDuplicate - */ - int duplicate; - - /** - * This always points to the parent bug, i.e. - * the bug that has no duplicates itself. - * If this is 0 it means that there are no duplicates - */ - int parentDuplicate; - - BugReport::Status status; - - BugReport::Resolution resolution; - }; - - DuplicateFinderJob(const QList &bugIds, BugzillaManager *manager, QObject *parent = 0); - ~DuplicateFinderJob() override; - - void start() override; - - /** - * Call this after result has been emitted to - * get the result - */ - Result result() const; - - private Q_SLOTS: - void slotBugReportFetched(const BugReport &bug, QObject *owner); - void slotBugReportError(const QString &message, QObject *owner); - - private: - void analyzeNextBug(); - void fetchBug(const QString &bugId); - - private: - BugzillaManager *m_manager; - QList m_bugIds; - Result m_result; -}; -#endif diff --git a/drkonqi/bugzillaintegration/parsebugbacktraces.cpp b/drkonqi/bugzillaintegration/parsebugbacktraces.cpp deleted file mode 100644 index 8222ad0be..000000000 --- a/drkonqi/bugzillaintegration/parsebugbacktraces.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************* -* parsebugbacktraces.cpp -* Copyright 2011 Matthias Fuchs -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "parsebugbacktraces.h" - -#include "parser/backtraceparser.h" - -typedef QList::const_iterator BacktraceConstIterator; - -BacktraceConstIterator findCrashStackFrame(BacktraceConstIterator it, BacktraceConstIterator itEnd) -{ - BacktraceConstIterator result = itEnd; - - //find the beginning of the crash - for ( ; it != itEnd; ++it) { - if (it->type() == BacktraceLine::KCrash) { - result = it; - break; - } - } - - //find the beginning of the stack frame - for (it = result; it != itEnd; ++it) { - if (it->type() == BacktraceLine::StackFrame) { - result = it; - break; - } - } - - return result; -} - -//TODO improve this stuff, it is just a HACK -ParseBugBacktraces::DuplicateRating rating(BacktraceConstIterator it, BacktraceConstIterator itEnd, BacktraceConstIterator it2, BacktraceConstIterator itEnd2) -{ - int matches = 0; - int lines = 0; - - it = findCrashStackFrame(it, itEnd); - it2 = findCrashStackFrame(it2, itEnd2); - - while (it != itEnd && it2 != itEnd2) { - if (it->type() == BacktraceLine::StackFrame && it2->type() == BacktraceLine::StackFrame) { - ++lines; - if (it->frameNumber() == it2->frameNumber() && it->functionName() == it2->functionName()) { - ++matches; - } - ++it; - ++it2; - continue; - } - - //if iters do not point to emptylines or a stackframe increase them - if (it->type() != BacktraceLine::StackFrame && it->type() != BacktraceLine::EmptyLine) { - ++it; - continue; - } - if (it2->type() != BacktraceLine::StackFrame && it2->type() != BacktraceLine::EmptyLine) { - ++it2; - continue; - } - - //one bt is shorter than the other - if (it->type() == BacktraceLine::StackFrame && it2->type() == BacktraceLine::EmptyLine) { - ++lines; - ++it; - continue; - } - if (it2->type() == BacktraceLine::StackFrame && it->type() == BacktraceLine::EmptyLine) { - ++lines; - ++it2; - continue; - } - - if (it->type() == BacktraceLine::EmptyLine && it2->type() == BacktraceLine::EmptyLine) { - //done - break; - } - } - - if (!lines) { - return ParseBugBacktraces::NoDuplicate; - } - - const int rating = matches * 100 / lines; - if (rating == 100) { - return ParseBugBacktraces::PerfectDuplicate; - } else if (rating >= 90) { - return ParseBugBacktraces::MostLikelyDuplicate; - } else if (rating >= 60) { - return ParseBugBacktraces::MaybeDuplicate; - } else { - return ParseBugBacktraces::NoDuplicate; - } - - return ParseBugBacktraces::NoDuplicate; -} - -ParseBugBacktraces::ParseBugBacktraces(const BugReport &bug, QObject *parent) - : QObject(parent), - m_bug(bug) -{ - m_parser = BacktraceParser::newParser(QStringLiteral("gdb"), this); - m_parser->connectToGenerator(this); -} - -void ParseBugBacktraces::parse() -{ - parse(m_bug.description()); - - QStringList comments = m_bug.comments(); - foreach (const QString &comment, comments) { - parse(comment); - } -} - -void ParseBugBacktraces::parse(const QString &comment) -{ - emit starting(); - - int start = 0; - int end = -1; - do { - start = end + 1; - end = comment.indexOf('\n', start); - emit newLine(comment.mid(start, (end != -1 ? end - start + 1 : end))); - } while (end != -1); - - //accepts anything as backtrace, the start of the backtrace is searched later anyway - m_backtraces << m_parser->parsedBacktraceLines(); -} - -ParseBugBacktraces::DuplicateRating ParseBugBacktraces::findDuplicate(const QList &backtrace) -{ - if (m_backtraces.isEmpty() || backtrace.isEmpty()) { - return NoDuplicate; - } - - DuplicateRating bestRating = NoDuplicate; - DuplicateRating currentRating = NoDuplicate; - - QList >::const_iterator itBts; - QList >::const_iterator itEndBts = m_backtraces.constEnd(); - for (itBts = m_backtraces.constBegin(); itBts != itEndBts; ++itBts) { - currentRating = rating(backtrace.constBegin(), backtrace.constEnd(), itBts->constBegin(), itBts->constEnd()); - if (currentRating < bestRating) { - bestRating = currentRating; - } - - if (bestRating == PerfectDuplicate) { - return bestRating; - } - } - - return bestRating; -} - - diff --git a/drkonqi/bugzillaintegration/parsebugbacktraces.h b/drkonqi/bugzillaintegration/parsebugbacktraces.h deleted file mode 100644 index 78016c125..000000000 --- a/drkonqi/bugzillaintegration/parsebugbacktraces.h +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************* -* parsebugbacktraces.h -* Copyright 2011 Matthias Fuchs -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef PARSE_BUG_BACKTRACES_H -#define PARSE_BUG_BACKTRACES_H - -#include "parser/backtraceline.h" -#include "bugzillalib.h" - -class BacktraceParser; - -/** - * Parses a Bugreport to find all the backtraces listed there - * NOTE it assumes that the backtraces provided were created - * by gdb - */ -class ParseBugBacktraces : QObject -{ - Q_OBJECT - public: - explicit ParseBugBacktraces(const BugReport &bug, QObject *parent = 0); - - void parse(); - - enum DuplicateRating { - PerfectDuplicate,//functionnames and stackframe numer match - MostLikelyDuplicate,//functionnames and stackframe numer match >=90% - MaybeDuplicate,//functionnames and stackframe numer match >=60% - NoDuplicate//functionnames and stackframe numer match <60% - }; - - DuplicateRating findDuplicate(const QList &backtrace); - - Q_SIGNALS: - void starting(); - void newLine(const QString &line); - - private: - void parse(const QString &comment); - - private: - BacktraceParser *m_parser; - const BugReport m_bug; - QList > m_backtraces; -}; - -#endif diff --git a/drkonqi/bugzillaintegration/productmapping.cpp b/drkonqi/bugzillaintegration/productmapping.cpp deleted file mode 100644 index 2dcbf7bbf..000000000 --- a/drkonqi/bugzillaintegration/productmapping.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/******************************************************************* -* productmapping.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "productmapping.h" - -#include -#include -#include -#include - -#include "bugzillalib.h" -#include "crashedapplication.h" - -ProductMapping::ProductMapping(const CrashedApplication * crashedApp, BugzillaManager * bzManager, QObject * parent) - : QObject(parent) - , m_crashedAppPtr(crashedApp) - , m_bugzillaManagerPtr(bzManager) - , m_bugzillaProductDisabled(false) - , m_bugzillaVersionDisabled(false) - -{ - //Default "fallback" values - m_bugzillaProduct = crashedApp->fakeExecutableBaseName(); - m_bugzillaComponent = QLatin1String("general"); - m_bugzillaVersionString = QLatin1String("unspecified"); - m_relatedBugzillaProducts = QStringList() << m_bugzillaProduct; - - map(crashedApp->fakeExecutableBaseName()); - - //Get valid versions - connect(m_bugzillaManagerPtr, &BugzillaManager::productInfoFetched, this, &ProductMapping::checkProductInfo); - - m_bugzillaManagerPtr->fetchProductInfo(m_bugzillaProduct); -} - -void ProductMapping::map(const QString & appName) -{ - mapUsingInternalFile(appName); - getRelatedProductsUsingInternalFile(m_bugzillaProduct); -} - -void ProductMapping::mapUsingInternalFile(const QString & appName) -{ - KConfig mappingsFile(QString::fromLatin1("mappings"), KConfig::NoGlobals, QStandardPaths::DataLocation); - const KConfigGroup mappings = mappingsFile.group("Mappings"); - if (mappings.hasKey(appName)) { - QString mappingString = mappings.readEntry(appName); - if (!mappingString.isEmpty()) { - QStringList list = mappingString.split('|', QString::SkipEmptyParts); - if (list.count()==2) { - m_bugzillaProduct = list.at(0); - m_bugzillaComponent = list.at(1); - m_relatedBugzillaProducts = QStringList() << m_bugzillaProduct; - } else { - qWarning() << "Error while reading mapping entry. Sections found " << list.count(); - } - } else { - qWarning() << "Error while reading mapping entry. Entry exists but it is empty " - "(or there was an error when reading)"; - } - } -} - -void ProductMapping::getRelatedProductsUsingInternalFile(const QString & bugzillaProduct) -{ - //ProductGroup -> kontact=kdepim - //Groups -> kdepim=kontact|kmail|korganizer|akonadi|pimlibs..etc - - KConfig mappingsFile(QString::fromLatin1("mappings"), KConfig::NoGlobals, QStandardPaths::DataLocation); - const KConfigGroup productGroup = mappingsFile.group("ProductGroup"); - - //Get groups of the application - QStringList groups; - if (productGroup.hasKey(bugzillaProduct)) { - QString group = productGroup.readEntry(bugzillaProduct); - if (group.isEmpty()) { - qWarning() << "Error while reading mapping entry. Entry exists but it is empty " - "(or there was an error when reading)"; - return; - } - groups = group.split('|', QString::SkipEmptyParts); - } - - //All KDE apps use the KDE Platform (basic libs) - groups << QLatin1String("kdeplatform"); - - //Add the product itself - m_relatedBugzillaProducts = QStringList() << m_bugzillaProduct; - - //Get related products of each related group - Q_FOREACH( const QString & group, groups ) { - const KConfigGroup bzGroups = mappingsFile.group("BZGroups"); - if (bzGroups.hasKey(group)) { - QString bzGroup = bzGroups.readEntry(group); - if (!bzGroup.isEmpty()) { - QStringList relatedGroups = bzGroup.split('|', QString::SkipEmptyParts); - if (relatedGroups.size()>0) { - m_relatedBugzillaProducts.append(relatedGroups); - } - } else { - qWarning() << "Error while reading mapping entry. Entry exists but it is empty " - "(or there was an error when reading)"; - } - } - } -} - -void ProductMapping::checkProductInfo(const Product & product) -{ - // check whether the product itself is disabled for new reports, - // which usually means that product/application is unmaintained. - m_bugzillaProductDisabled = !product.isActive(); - - // check whether the product on bugzilla contains the expected component - if (! product.components().contains(m_bugzillaComponent)) { - m_bugzillaComponent = QLatin1String("general"); - } - - // find the appropriate version to use on bugzilla - const QString version = m_crashedAppPtr->version(); - const QStringList& allVersions = product.allVersions(); - - if (allVersions.contains(version)) { - //The version the crash application provided is a valid bugzilla version: use it ! - m_bugzillaVersionString = version; - } else if (version.endsWith(QLatin1String(".00"))) { - //check if there is a version on bugzilla with just ".0" - const QString shorterVersion = version.left(version.size() - 1); - if (allVersions.contains(shorterVersion)) { - m_bugzillaVersionString = shorterVersion; - } - } - - // check whether that verions is disabled for new reports, which - // usually means that version is outdated and not supported anymore. - const QStringList& inactiveVersions = product.inactiveVersions(); - m_bugzillaVersionDisabled = inactiveVersions.contains(m_bugzillaVersionString); - -} - -QStringList ProductMapping::relatedBugzillaProducts() const -{ - return m_relatedBugzillaProducts; -} - -QString ProductMapping::bugzillaProduct() const -{ - return m_bugzillaProduct; -} - -QString ProductMapping::bugzillaComponent() const -{ - return m_bugzillaComponent; -} - -QString ProductMapping::bugzillaVersion() const -{ - return m_bugzillaVersionString; -} - -bool ProductMapping::bugzillaProductDisabled() const -{ - return m_bugzillaProductDisabled; -} - -bool ProductMapping::bugzillaVersionDisabled() const -{ - return m_bugzillaVersionDisabled; -} diff --git a/drkonqi/bugzillaintegration/productmapping.h b/drkonqi/bugzillaintegration/productmapping.h deleted file mode 100644 index f926c9db6..000000000 --- a/drkonqi/bugzillaintegration/productmapping.h +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************* -* productmapping.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef PRODUCTMAPPING__H -#define PRODUCTMAPPING__H - -#include -#include -#include - -class Product; -class BugzillaManager; -class CrashedApplication; - -class ProductMapping: public QObject -{ -Q_OBJECT -public: - explicit ProductMapping(const CrashedApplication *, BugzillaManager *, QObject * parent = 0); - - QString bugzillaProduct() const; - QString bugzillaComponent() const; - QString bugzillaVersion() const; - QStringList relatedBugzillaProducts() const; - - bool bugzillaProductDisabled() const; - bool bugzillaVersionDisabled() const; - -private Q_SLOTS: - void checkProductInfo(const Product &); - -private: - void map(const QString&); - void mapUsingInternalFile(const QString&); - void getRelatedProductsUsingInternalFile(const QString&); - - QStringList m_relatedBugzillaProducts; - QString m_bugzillaProduct; - QString m_bugzillaComponent; - - QString m_bugzillaVersionString; - - const CrashedApplication * m_crashedAppPtr; - BugzillaManager * m_bugzillaManagerPtr; - - bool m_bugzillaProductDisabled; - bool m_bugzillaVersionDisabled; - -}; - -#endif diff --git a/drkonqi/bugzillaintegration/reportassistantdialog.cpp b/drkonqi/bugzillaintegration/reportassistantdialog.cpp deleted file mode 100644 index a5d7eecaa..000000000 --- a/drkonqi/bugzillaintegration/reportassistantdialog.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/******************************************************************* -* reportassistantdialog.cpp -* Copyright 2009,2010 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "reportassistantdialog.h" - -#include - -#include -#include -#include - -#include "drkonqi.h" - -#include "parser/backtraceparser.h" -#include "debuggermanager.h" -#include "backtracegenerator.h" - -#include "crashedapplication.h" -#include "aboutbugreportingdialog.h" -#include "reportassistantpages_base.h" -#include "reportassistantpages_bugzilla.h" -#include "reportassistantpages_bugzilla_duplicates.h" -#include "reportinterface.h" - -static const char KDE_BUGZILLA_DESCRIPTION[] = I18N_NOOP("the KDE Bug Tracking System"); - -ReportAssistantDialog::ReportAssistantDialog(QWidget * parent) : - KAssistantDialog(parent), - m_aboutBugReportingDialog(0), - m_reportInterface(new ReportInterface(this)), - m_canClose(false) -{ - setAttribute(Qt::WA_DeleteOnClose, true); - - //Set window properties - setWindowTitle(i18nc("@title:window","Crash Reporting Assistant")); - setWindowIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"))); - - connect(this, &ReportAssistantDialog::currentPageChanged, this, &ReportAssistantDialog::currentPageChanged_slot); - connect(button(QDialogButtonBox::Help), &QPushButton::clicked, this, &ReportAssistantDialog::showHelp); - - //Create the assistant pages - - //-Introduction Page - KConfigGroup group(KSharedConfig::openConfig(), "ReportAssistant"); - const bool skipIntroduction = group.readEntry("SkipIntroduction", false); - - if (!skipIntroduction) { - IntroductionPage * m_introduction = new IntroductionPage(this); - - KPageWidgetItem * m_introductionPage = new KPageWidgetItem(m_introduction, - QLatin1String(PAGE_INTRODUCTION_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_INTRODUCTION_ID),m_introductionPage); - m_introductionPage->setHeader(i18nc("@title","Welcome to the Reporting Assistant")); - m_introductionPage->setIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"))); - - addPage(m_introductionPage); - } - - //-Bug Awareness Page - BugAwarenessPage * m_awareness = new BugAwarenessPage(this); - connectSignals(m_awareness); - - KPageWidgetItem * m_awarenessPage = new KPageWidgetItem(m_awareness, - QLatin1String(PAGE_AWARENESS_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_AWARENESS_ID),m_awarenessPage); - m_awarenessPage->setHeader(i18nc("@title","What do you know about the crash?")); - m_awarenessPage->setIcon(QIcon::fromTheme(QStringLiteral("checkbox"))); - - //-Crash Information Page - CrashInformationPage * m_backtrace = new CrashInformationPage(this); - connectSignals(m_backtrace); - - KPageWidgetItem * m_backtracePage = new KPageWidgetItem(m_backtrace, - QLatin1String(PAGE_CRASHINFORMATION_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_CRASHINFORMATION_ID),m_backtracePage); - m_backtracePage->setHeader(i18nc("@title","Fetching the Backtrace (Automatic Crash Information)")); - m_backtracePage->setIcon(QIcon::fromTheme(QStringLiteral("run-build"))); - - //-Results Page - ConclusionPage * m_conclusions = new ConclusionPage(this); - connectSignals(m_conclusions); - - KPageWidgetItem * m_conclusionsPage = new KPageWidgetItem(m_conclusions, - QLatin1String(PAGE_CONCLUSIONS_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_CONCLUSIONS_ID),m_conclusionsPage); - m_conclusionsPage->setHeader(i18nc("@title","Results of the Analyzed Crash Details")); - m_conclusionsPage->setIcon(QIcon::fromTheme(QStringLiteral("dialog-information"))); - connect(m_conclusions, &ConclusionPage::finished, this, &ReportAssistantDialog::assistantFinished); - - //-Bugzilla Login - BugzillaLoginPage * m_bugzillaLogin = new BugzillaLoginPage(this); - connectSignals(m_bugzillaLogin); - - KPageWidgetItem * m_bugzillaLoginPage = new KPageWidgetItem(m_bugzillaLogin, - QLatin1String(PAGE_BZLOGIN_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_BZLOGIN_ID),m_bugzillaLoginPage); - m_bugzillaLoginPage->setHeader(i18nc("@title", "Login into %1", i18n(KDE_BUGZILLA_DESCRIPTION))); - m_bugzillaLoginPage->setIcon(QIcon::fromTheme(QStringLiteral("user-identity"))); - connect(m_bugzillaLogin, &BugzillaLoginPage::loggedTurnToNextPage, this, &ReportAssistantDialog::loginFinished); - - //-Bugzilla duplicates - BugzillaDuplicatesPage * m_bugzillaDuplicates = new BugzillaDuplicatesPage(this); - connectSignals(m_bugzillaDuplicates); - - KPageWidgetItem * m_bugzillaDuplicatesPage = new KPageWidgetItem(m_bugzillaDuplicates, - QLatin1String(PAGE_BZDUPLICATES_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_BZDUPLICATES_ID),m_bugzillaDuplicatesPage); - m_bugzillaDuplicatesPage->setHeader(i18nc("@title","Look for Possible Duplicate Reports")); - m_bugzillaDuplicatesPage->setIcon(QIcon::fromTheme(QStringLiteral("repository"))); - - //-Bugzilla information - BugzillaInformationPage * m_bugzillaInformation = new BugzillaInformationPage(this); - connectSignals(m_bugzillaInformation); - - KPageWidgetItem * m_bugzillaInformationPage = new KPageWidgetItem(m_bugzillaInformation, - QLatin1String(PAGE_BZDETAILS_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_BZDETAILS_ID),m_bugzillaInformationPage); - m_bugzillaInformationPage->setHeader(i18nc("@title","Enter the Details about the Crash")); - m_bugzillaInformationPage->setIcon(QIcon::fromTheme(QStringLiteral("document-edit"))); - - //-Bugzilla Report Preview - BugzillaPreviewPage * m_bugzillaPreview = new BugzillaPreviewPage(this); - - KPageWidgetItem * m_bugzillaPreviewPage = new KPageWidgetItem(m_bugzillaPreview, - QLatin1String(PAGE_BZPREVIEW_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_BZPREVIEW_ID),m_bugzillaPreviewPage); - m_bugzillaPreviewPage->setHeader(i18nc("@title","Preview the Report")); - m_bugzillaPreviewPage->setIcon(QIcon::fromTheme(QStringLiteral("document-preview"))); - - //-Bugzilla commit - BugzillaSendPage * m_bugzillaSend = new BugzillaSendPage(this); - - KPageWidgetItem * m_bugzillaSendPage = new KPageWidgetItem(m_bugzillaSend, - QLatin1String(PAGE_BZSEND_ID)); - m_pageWidgetMap.insert(QLatin1String(PAGE_BZSEND_ID),m_bugzillaSendPage); - m_bugzillaSendPage->setHeader(i18nc("@title","Sending the Crash Report")); - m_bugzillaSendPage->setIcon(QIcon::fromTheme(QStringLiteral("applications-internet"))); - connect(m_bugzillaSend, &BugzillaSendPage::finished, this, &ReportAssistantDialog::assistantFinished); - - //TODO Remember to keep the pages ordered - addPage(m_awarenessPage); - addPage(m_backtracePage); - addPage(m_conclusionsPage); - addPage(m_bugzillaLoginPage); - addPage(m_bugzillaDuplicatesPage); - addPage(m_bugzillaInformationPage); - addPage(m_bugzillaPreviewPage); - addPage(m_bugzillaSendPage); - - setMinimumSize(QSize(600, 400)); - resize(minimumSize()); -} - -ReportAssistantDialog::~ReportAssistantDialog() -{ -} - -void ReportAssistantDialog::connectSignals(ReportAssistantPage * page) -{ - //React to the changes in the assistant pages - connect(page, &ReportAssistantPage::completeChanged, - this, &ReportAssistantDialog::completeChanged); -} - -void ReportAssistantDialog::currentPageChanged_slot(KPageWidgetItem * current , KPageWidgetItem * before) -{ - //Page changed - buttonBox()->button(QDialogButtonBox::Cancel)->setEnabled(true); - m_canClose = false; - - //Save data of the previous page - if (before) { - ReportAssistantPage* beforePage = dynamic_cast(before->widget()); - beforePage->aboutToHide(); - } - - //Load data of the current(new) page - if (current) { - ReportAssistantPage* currentPage = dynamic_cast(current->widget()); - nextButton()->setEnabled(currentPage->isComplete()); - currentPage->aboutToShow(); - } - - //If the current page is the last one, disable all the buttons until the bug is sent - if (current->name() == QLatin1String(PAGE_BZSEND_ID)) { - nextButton()->setEnabled(false); - backButton()->setEnabled(false); - finishButton()->setEnabled(false); - } -} - -void ReportAssistantDialog::completeChanged(ReportAssistantPage* page, bool isComplete) -{ - if (page == dynamic_cast(currentPage()->widget())) { - nextButton()->setEnabled(isComplete); - } -} - -void ReportAssistantDialog::assistantFinished(bool showBack) -{ - //The assistant finished: allow the user to close the dialog normally - - nextButton()->setEnabled(false); - backButton()->setEnabled(showBack); - finishButton()->setEnabled(true); - buttonBox()->button(QDialogButtonBox::Cancel)->setEnabled(false); - - m_canClose = true; -} - -void ReportAssistantDialog::loginFinished() -{ - //Bugzilla login finished, go to the next page - if (currentPage()->name() == QLatin1String(PAGE_BZLOGIN_ID)) { - next(); - } -} - -void ReportAssistantDialog::showHelp() -{ - //Show the bug reporting guide dialog - if (!m_aboutBugReportingDialog) { - m_aboutBugReportingDialog = new AboutBugReportingDialog(); - } - m_aboutBugReportingDialog->show(); - m_aboutBugReportingDialog->raise(); - m_aboutBugReportingDialog->activateWindow(); - m_aboutBugReportingDialog->showSection(QLatin1String(PAGE_HELP_BEGIN_ID)); - m_aboutBugReportingDialog->showSection(currentPage()->name()); -} - -//Override KAssistantDialog "next" page implementation -void ReportAssistantDialog::next() -{ - //Allow the widget to Ask a question to the user before changing the page - ReportAssistantPage * page = dynamic_cast(currentPage()->widget()); - if (page) { - if (!page->showNextPage()) { - return; - } - } - - const QString name = currentPage()->name(); - - //If the information the user can provide is not useful, skip the backtrace page - if (name == QLatin1String(PAGE_AWARENESS_ID)) - { - //Force save settings in the current page - page->aboutToHide(); - - if (!(m_reportInterface->isBugAwarenessPageDataUseful())) - { - setCurrentPage(m_pageWidgetMap.value(QLatin1String(PAGE_CONCLUSIONS_ID))); - return; - } - } else if (name == QLatin1String(PAGE_CRASHINFORMATION_ID)){ - //Force save settings in current page - page->aboutToHide(); - - //If the crash is worth reporting and it is BKO, skip the Conclusions page - if (m_reportInterface->isWorthReporting() && - DrKonqi::crashedApplication()->bugReportAddress().isKdeBugzilla()) - { - setCurrentPage(m_pageWidgetMap.value(QLatin1String(PAGE_BZLOGIN_ID))); - return; - } - } else if (name == QLatin1String(PAGE_BZDUPLICATES_ID)) { - //a duplicate has been found, yet the report is not being attached - if (m_reportInterface->duplicateId() && !m_reportInterface->attachToBugNumber()) { - setCurrentPage(m_pageWidgetMap.value(QLatin1String(PAGE_CONCLUSIONS_ID))); - return; - } - } - - KAssistantDialog::next(); -} - -//Override KAssistantDialog "back"(previous) page implementation -//It has to mirror the custom next() implementation -void ReportAssistantDialog::back() - { - if (currentPage()->name() == QLatin1String(PAGE_CONCLUSIONS_ID)) - { - if (m_reportInterface->duplicateId() && !m_reportInterface->attachToBugNumber()) { - setCurrentPage(m_pageWidgetMap.value(QLatin1String(PAGE_BZDUPLICATES_ID))); - return; - } - if (!(m_reportInterface->isBugAwarenessPageDataUseful())) - { - setCurrentPage(m_pageWidgetMap.value(QLatin1String(PAGE_AWARENESS_ID))); - return; - } - } - - if (currentPage()->name() == QLatin1String(PAGE_BZLOGIN_ID)) - { - if (m_reportInterface->isWorthReporting() && - DrKonqi::crashedApplication()->bugReportAddress().isKdeBugzilla()) - { - setCurrentPage(m_pageWidgetMap.value(QLatin1String(PAGE_CRASHINFORMATION_ID))); - return; - } - } - - KAssistantDialog::back(); -} - -void ReportAssistantDialog::reject() -{ - close(); -} - -void ReportAssistantDialog::closeEvent(QCloseEvent * event) -{ - //Handle the close event - if (!m_canClose) { - //If the assistant didn't finished yet, offer the user the possibilities to - //Close, Cancel, or Save the bug report and Close" - - KGuiItem closeItem = KStandardGuiItem::close(); - closeItem.setText(i18nc("@action:button", "Close the assistant")); - - KGuiItem keepOpenItem = KStandardGuiItem::cancel(); - keepOpenItem.setText(i18nc("@action:button", "Cancel")); - - BacktraceParser::Usefulness use = - DrKonqi::debuggerManager()->backtraceGenerator()->parser()->backtraceUsefulness(); - if (use == BacktraceParser::ReallyUseful || use == BacktraceParser::MayBeUseful) { - //Backtrace is still useful, let the user save it. - KGuiItem saveBacktraceItem = KStandardGuiItem::save(); - saveBacktraceItem.setText(i18nc("@action:button", "Save information and close")); - - int ret = KMessageBox::questionYesNoCancel(this, - xi18nc("@info","Do you really want to close the bug reporting assistant? " - "The crash information is still valid, so " - "you can save the report before closing if you want."), - i18nc("@title:window","Close the Assistant"), - closeItem, saveBacktraceItem, keepOpenItem, QString(), KMessageBox::Dangerous); - if(ret == KMessageBox::Yes) - { - event->accept(); - } else if (ret == KMessageBox::No) { - //Save backtrace and accept event (dialog will be closed) - DrKonqi::saveReport(reportInterface()->generateReportFullText(false)); - event->accept(); - } else { - event->ignore(); - } - } else { - if (KMessageBox::questionYesNo(this, i18nc("@info","Do you really want to close the bug " - "reporting assistant?"), - i18nc("@title:window","Close the Assistant"), - closeItem, keepOpenItem, QString(), KMessageBox::Dangerous) - == KMessageBox::Yes) { - event->accept(); - } else { - event->ignore(); - } - } - } else { - event->accept(); - } -} diff --git a/drkonqi/bugzillaintegration/reportassistantdialog.h b/drkonqi/bugzillaintegration/reportassistantdialog.h deleted file mode 100644 index 86b82646a..000000000 --- a/drkonqi/bugzillaintegration/reportassistantdialog.h +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************* -* reportassistantdialog.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef REPORTASSISTANTDIALOG__H -#define REPORTASSISTANTDIALOG__H - -#include - -#include - -class ReportAssistantPage; -class AboutBugReportingDialog; -class ReportInterface; -class QCloseEvent; - -class ReportAssistantDialog: public KAssistantDialog -{ - Q_OBJECT - -public: - explicit ReportAssistantDialog(QWidget * parent = 0); - ~ReportAssistantDialog() override; - - ReportInterface *reportInterface() const { - return m_reportInterface; - } - -private Q_SLOTS: - void currentPageChanged_slot(KPageWidgetItem *, KPageWidgetItem *); - - void completeChanged(ReportAssistantPage*, bool); - - void loginFinished(); - - void assistantFinished(bool); - - void showHelp(); - - void next() override; - void back() override; - - //Override default reject method - void reject() override; - -private: - void connectSignals(ReportAssistantPage *); - void closeEvent(QCloseEvent*) override; - - QHash m_pageWidgetMap; - - QPointer m_aboutBugReportingDialog; - ReportInterface * m_reportInterface; - - bool m_canClose; -}; - -#endif diff --git a/drkonqi/bugzillaintegration/reportassistantpage.cpp b/drkonqi/bugzillaintegration/reportassistantpage.cpp deleted file mode 100644 index a11a115bc..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpage.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************* -* reportassistantpage.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "reportassistantpage.h" -#include "reportinterface.h" - -ReportAssistantPage::ReportAssistantPage(ReportAssistantDialog * parent) - : QWidget(parent), m_assistant(parent) -{ -} - -bool ReportAssistantPage::isComplete() -{ - return true; -} - -bool ReportAssistantPage::showNextPage() -{ - return true; -} - -ReportInterface * ReportAssistantPage::reportInterface() const -{ - return m_assistant->reportInterface(); -} - -BugzillaManager * ReportAssistantPage::bugzillaManager() const -{ - return reportInterface()->bugzillaManager(); -} - -ReportAssistantDialog * ReportAssistantPage::assistant() const -{ - return m_assistant; -} - -void ReportAssistantPage::emitCompleteChanged() -{ - emit completeChanged(this, isComplete()); -} diff --git a/drkonqi/bugzillaintegration/reportassistantpage.h b/drkonqi/bugzillaintegration/reportassistantpage.h deleted file mode 100644 index d2fb150ad..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpage.h +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************* -* reportassistantpage.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef REPORTASSISTANTPAGE__H -#define REPORTASSISTANTPAGE__H - -#include - -#include "reportassistantdialog.h" - -class BugzillaManager; - -/** BASE interface which implements some signals, and -** aboutTo(Show|Hide) functions (also reimplements QWizard behaviour) **/ -class ReportAssistantPage: public QWidget -{ - Q_OBJECT - -public: - explicit ReportAssistantPage(ReportAssistantDialog * parent); - - /** Load the widget data if empty **/ - virtual void aboutToShow() {} - /** Save the widget data **/ - virtual void aboutToHide() {} - /** Tells the KAssistantDialog to enable the Next button **/ - virtual bool isComplete(); - - /** Last time checks to see if you can turn the page **/ - virtual bool showNextPage(); - - ReportInterface *reportInterface() const; - BugzillaManager *bugzillaManager() const; - ReportAssistantDialog * assistant() const; - -public Q_SLOTS: - void emitCompleteChanged(); - -Q_SIGNALS: - /** Tells the KAssistantDialog that the isComplete function changed value **/ - void completeChanged(ReportAssistantPage*, bool); - -private: - ReportAssistantDialog * const m_assistant; -}; - -#endif diff --git a/drkonqi/bugzillaintegration/reportassistantpages_base.cpp b/drkonqi/bugzillaintegration/reportassistantpages_base.cpp deleted file mode 100644 index 470481dda..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpages_base.cpp +++ /dev/null @@ -1,469 +0,0 @@ -/******************************************************************* -* reportassistantpages_base.cpp -* Copyright 2009 Dario Andres Rodriguez -* Copyright 2009 A. L. Spehr -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "reportassistantpages_base.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "drkonqi.h" -#include "debuggermanager.h" -#include "crashedapplication.h" -#include "reportinterface.h" -#include "parser/backtraceparser.h" -#include "backtracegenerator.h" -#include "backtracewidget.h" -#include "drkonqi_globals.h" -#include "applicationdetailsexamples.h" - -//BEGIN IntroductionPage - -IntroductionPage::IntroductionPage(ReportAssistantDialog * parent) - : ReportAssistantPage(parent) -{ - ui.setupUi(this); - ui.m_warningIcon->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(64,64)); -} - -//END IntroductionPage - -//BEGIN CrashInformationPage - -CrashInformationPage::CrashInformationPage(ReportAssistantDialog * parent) - : ReportAssistantPage(parent) -{ - m_backtraceWidget = new BacktraceWidget(DrKonqi::debuggerManager()->backtraceGenerator(), this, true); - connect(m_backtraceWidget, &BacktraceWidget::stateChanged, this, &CrashInformationPage::emitCompleteChanged); - - QVBoxLayout *layout = new QVBoxLayout(this); - layout->setContentsMargins(0,0,0,0); - layout->addWidget(m_backtraceWidget); - layout->addSpacing(10); //We need this for better usability until we get something better - - //If the backtrace was already fetched on the main dialog, save it. - BacktraceGenerator *btGenerator = DrKonqi::debuggerManager()->backtraceGenerator(); - if (btGenerator->state() == BacktraceGenerator::Loaded) { - BacktraceParser::Usefulness use = btGenerator->parser()->backtraceUsefulness(); - if (use != BacktraceParser::Useless && use != BacktraceParser::InvalidUsefulness) { - reportInterface()->setBacktrace(btGenerator->backtrace()); - } - } -} - -void CrashInformationPage::aboutToShow() -{ - m_backtraceWidget->generateBacktrace(); - m_backtraceWidget->hilightExtraDetailsLabel(false); - emitCompleteChanged(); -} - -void CrashInformationPage::aboutToHide() -{ - BacktraceGenerator *btGenerator = DrKonqi::debuggerManager()->backtraceGenerator(); - BacktraceParser::Usefulness use = btGenerator->parser()->backtraceUsefulness(); - - if (use != BacktraceParser::Useless && use != BacktraceParser::InvalidUsefulness) { - reportInterface()->setBacktrace(btGenerator->backtrace()); - } - reportInterface()->setFirstBacktraceFunctions(btGenerator->parser()->firstValidFunctions()); -} - -bool CrashInformationPage::isComplete() -{ - BacktraceGenerator *generator = DrKonqi::debuggerManager()->backtraceGenerator(); - return (generator->state() != BacktraceGenerator::NotLoaded && - generator->state() != BacktraceGenerator::Loading); -} - -bool CrashInformationPage::showNextPage() -{ - BacktraceParser::Usefulness use = - DrKonqi::debuggerManager()->backtraceGenerator()->parser()->backtraceUsefulness(); - - if (DrKonqi::ignoreQuality()) { - return true; - } - - if ((use == BacktraceParser::InvalidUsefulness || use == BacktraceParser::ProbablyUseless - || use == BacktraceParser::Useless) && m_backtraceWidget->canInstallDebugPackages()) { - if ( KMessageBox::Yes == KMessageBox::questionYesNo(this, - i18nc("@info","This crash information is not useful enough, " - "do you want to try to improve it? You will need " - "to install some debugging packages."), - i18nc("@title:window","Crash Information is not useful enough")) ) { - m_backtraceWidget->hilightExtraDetailsLabel(true); - m_backtraceWidget->focusImproveBacktraceButton(); - return false; //Cancel show next, to allow the user to write more - } else { - return true; //Allow to continue - } - } else { - return true; - } -} - -//END CrashInformationPage - -//BEGIN BugAwarenessPage - -BugAwarenessPage::BugAwarenessPage(ReportAssistantDialog * parent) - : ReportAssistantPage(parent) -{ - ui.setupUi(this); - - ui.m_actionsInsideApp->setText(i18nc("@option:check kind of information the user can provide " - "about the crash, %1 is the application name", - "What I was doing when the application \"%1\" crashed", - DrKonqi::crashedApplication()->name())); - - connect(ui.m_rememberGroup, static_cast(&QButtonGroup::buttonClicked), this, &BugAwarenessPage::updateCheckBoxes); - // Also listen to toggle so radio buttons are covered. - connect(ui.m_rememberGroup, static_cast(&QButtonGroup::buttonToggled), this, &BugAwarenessPage::updateCheckBoxes); - - ui.m_appSpecificDetailsExamples->setVisible(reportInterface()->appDetailsExamples()->hasExamples()); - ui.m_appSpecificDetailsExamples->setContextMenuPolicy(Qt::NoContextMenu); - - connect(ui.m_appSpecificDetailsExamples, &QLabel::linkActivated, this, &BugAwarenessPage::showApplicationDetailsExamples); -} - -void BugAwarenessPage::aboutToShow() -{ - updateCheckBoxes(); -} - -void BugAwarenessPage::aboutToHide() -{ - //Save data - ReportInterface::Reproducible reproducible = ReportInterface::ReproducibleUnsure; - switch(ui.m_reproducibleBox->currentIndex()) { - case 0: { - reproducible = ReportInterface::ReproducibleUnsure; - break; - } - case 1: { - reproducible = ReportInterface::ReproducibleNever; - break; - } - case 2: { - reproducible = ReportInterface::ReproducibleSometimes; - break; - } - case 3: { - reproducible = ReportInterface::ReproducibleEverytime; - break; - } - } - - reportInterface()->setBugAwarenessPageData(ui.m_rememberCrashSituationYes->isChecked(), - reproducible, - ui.m_actionsInsideApp->isChecked(), - ui.m_unusualSituation->isChecked(), - ui.m_appSpecificDetails->isChecked()); -} - -void BugAwarenessPage::updateCheckBoxes() -{ - const bool rememberSituation = ui.m_rememberCrashSituationYes->isChecked(); - - ui.m_reproducibleLabel->setEnabled(rememberSituation); - ui.m_reproducibleBox->setEnabled(rememberSituation); - - ui.m_informationLabel->setEnabled(rememberSituation); - ui.m_actionsInsideApp->setEnabled(rememberSituation); - ui.m_unusualSituation->setEnabled(rememberSituation); - - ui.m_appSpecificDetails->setEnabled(rememberSituation); - ui.m_appSpecificDetailsExamples->setEnabled(rememberSituation); -} - -void BugAwarenessPage::showApplicationDetailsExamples() -{ - QToolTip::showText(QCursor::pos(), - i18nc("@label examples about information the user can provide", - "Examples: %1", reportInterface()->appDetailsExamples()->examples()), - this); -} - -//END BugAwarenessPage - -//BEGIN ConclusionPage - -ConclusionPage::ConclusionPage(ReportAssistantDialog * parent) - : ReportAssistantPage(parent) - , m_needToReport(false) -{ - m_isBKO = DrKonqi::crashedApplication()->bugReportAddress().isKdeBugzilla(); - - ui.setupUi(this); - - KGuiItem::assign(ui.m_showReportInformationButton, - KGuiItem2(i18nc("@action:button", "&Show Contents of the Report"), - QIcon::fromTheme(QStringLiteral("document-preview")), - i18nc("@info:tooltip", "Use this button to show the generated " - "report information about this crash."))); - connect(ui.m_showReportInformationButton, &QPushButton::clicked, this, &ConclusionPage::openReportInformation); - - ui.m_restartAppOnFinish->setVisible(false); -} - -void ConclusionPage::finishClicked() -{ - //Manual report - if (m_needToReport && !m_isBKO) { - const CrashedApplication *crashedApp = DrKonqi::crashedApplication(); - BugReportAddress reportAddress = crashedApp->bugReportAddress(); - QString report = reportInterface()->generateReportFullText(false); - - if (reportAddress.isEmail()) { - QString subject = QStringLiteral("[%1] [%2] Automatic crash report generated by DrKonqi"); - subject= subject.arg(crashedApp->name()); - subject= subject.arg(crashedApp->datetime().toString(QStringLiteral("yyyy-MM-dd"))); - KToolInvocation::invokeMailer(reportAddress, QLatin1String(""), QLatin1String("") , subject, report); - } else { - QUrl url(reportAddress); - if (QUrl(reportAddress).isRelative()) { //Scheme is missing - url = QUrl(QString::fromLatin1("http://%1").arg(reportAddress)); - } - QDesktopServices::openUrl(url); - } - - //Show a copy of the bug reported - openReportInformation(); - } - - //Restart application - if (ui.m_restartAppOnFinish->isChecked()) { - DrKonqi::crashedApplication()->restart(); - } -} - -void ConclusionPage::aboutToShow() -{ - connect(assistant(), SIGNAL(user1Clicked()), this, SLOT(finishClicked())); - ui.m_restartAppOnFinish->setVisible(false); - ui.m_restartAppOnFinish->setChecked(false); - - const bool isDuplicate = reportInterface()->duplicateId() && !reportInterface()->attachToBugNumber(); - m_needToReport = reportInterface()->isWorthReporting() && !isDuplicate; - emitCompleteChanged(); - - BugReportAddress reportAddress = DrKonqi::crashedApplication()->bugReportAddress(); - BacktraceParser::Usefulness use = - DrKonqi::debuggerManager()->backtraceGenerator()->parser()->backtraceUsefulness(); - - QString explanationHTML = QLatin1String("

    "); - - bool backtraceGenerated = true; - switch (use) { - case BacktraceParser::ReallyUseful: { - explanationHTML += QStringLiteral("
  • %1
  • ").arg(i18nc("@info","The automatically generated " - "crash information is useful.")); - break; - } - case BacktraceParser::MayBeUseful: { - explanationHTML += QStringLiteral("
  • %1
  • ").arg(i18nc("@info","The automatically generated " - "crash information lacks some " - "details " - "but may be still be useful.")); - break; - } - case BacktraceParser::ProbablyUseless: { - explanationHTML += QStringLiteral("
  • %1
  • ").arg(i18nc("@info","The automatically generated " - "crash information lacks important details " - "and it is probably not helpful.")); - break; - } - case BacktraceParser::Useless: - case BacktraceParser::InvalidUsefulness: { - BacktraceGenerator::State state = DrKonqi::debuggerManager()->backtraceGenerator()->state(); - if (state == BacktraceGenerator::NotLoaded) { - backtraceGenerated = false; - explanationHTML += QStringLiteral("
  • %1
  • ").arg(i18nc("@info","The crash information was " - "not generated because it was not needed.")); - } else { - explanationHTML += QStringLiteral("
  • %1
    %2
  • ").arg( - i18nc("@info","The automatically generated crash " - "information does not contain enough information to be " - "helpful."), - xi18nc("@info","You can improve it by " - "installing debugging packages and reloading the crash on " - "the Crash Information page. You can get help with the Bug " - "Reporting Guide by clicking on the " - "Help button.")); - //but this guide doesn't mention bt packages? that's techbase - //->>and the help guide mention techbase page... - } - break; - } - } - - //User can provide enough information - if (reportInterface()->isBugAwarenessPageDataUseful()) { - explanationHTML += QStringLiteral("
  • %1
  • ").arg(i18nc("@info","The information you can " - "provide could be considered helpful.")); - } else { - explanationHTML += QStringLiteral("
  • %1
  • ").arg(i18nc("@info","The information you can " - "provide is not considered helpful enough in this case.")); - } - - if (isDuplicate) { - explanationHTML += QStringLiteral("
  • %1
  • ").arg(xi18nc("@info","Your problem has already been " - "reported as bug %1.", QString::number(reportInterface()->duplicateId()))); - } - - explanationHTML += QLatin1String("

"); - - ui.m_explanationLabel->setText(explanationHTML); - - //Hide the "Show contents of the report" button if the backtrace was not generated - ui.m_showReportInformationButton->setVisible(backtraceGenerated); - - if (m_needToReport) { - ui.m_conclusionsLabel->setText(QStringLiteral("

%1").arg(i18nc("@info","This " - "report is considered helpful."))); - - if (m_isBKO) { - emitCompleteChanged(); - ui.m_howToProceedLabel->setText(xi18nc("@info","This application's bugs are reported " - "to the KDE bug tracking system: click Next" - " to start the reporting process. " - "You can manually report at %1", - reportAddress)); - - } else { - if (!DrKonqi::crashedApplication()->hasBeenRestarted()) { - ui.m_restartAppOnFinish->setVisible(true); - } - - ui.m_howToProceedLabel->setText(xi18nc("@info","This application is not supported in the " - "KDE bug tracking system. Click " - "Finish to report this bug to " - "the application maintainer. Also, you can manually " - "report at %1.", reportAddress)); - - emit finished(false); - } - - } else { // (m_needToReport) - if (!DrKonqi::crashedApplication()->hasBeenRestarted()) { - ui.m_restartAppOnFinish->setVisible(true); - } - - ui.m_conclusionsLabel->setText(QStringLiteral("

%1
%2

").arg( - i18nc("@info","This report does not contain enough information for the " - "developers, so the automated bug reporting process is not " - "enabled for this crash."), - i18nc("@info","If you wish, you can go back and change your " - "answers. "))); - - //Only mention "manual reporting" if the backtrace was generated. - //FIXME separate the texts "manual reporting" / "click finish to close" - //"manual reporting" should be ~"manual report using the contents of the report".... - //FIXME for 4.5 (workflow, see ToDo) - if (backtraceGenerated) { - if (m_isBKO) { - ui.m_howToProceedLabel->setText(xi18nc("@info","You can manually report this bug " - "at %1. " - "Click Finish to close the " - "assistant.", - reportAddress)); - } else { - ui.m_howToProceedLabel->setText(xi18nc("@info","You can manually report this " - "bug to its maintainer at %1. " - "Click Finish to close the " - "assistant.", reportAddress)); - } - } - emit finished(true); - } -} - -void ConclusionPage::aboutToHide() -{ - assistant()->disconnect(SIGNAL(user1Clicked()), this, SLOT(finishClicked())); -} - -void ConclusionPage::openReportInformation() -{ - if (!m_infoDialog) { - QString info = reportInterface()->generateReportFullText(false) + QLatin1Char('\n') + - i18nc("@info report to url/mail address","Report to %1", - DrKonqi::crashedApplication()->bugReportAddress()); - - m_infoDialog = new ReportInformationDialog(info); - } - m_infoDialog->show(); - m_infoDialog->raise(); - m_infoDialog->activateWindow(); -} - -bool ConclusionPage::isComplete() -{ - return (m_isBKO && m_needToReport); -} - -//END ConclusionPage - -//BEGIN ReportInformationDialog - -ReportInformationDialog::ReportInformationDialog(const QString & reportText) - : QDialog() -{ - setAttribute(Qt::WA_DeleteOnClose, true); - setWindowTitle(i18nc("@title:window","Contents of the Report")); - - ui.setupUi(this); - ui.m_reportInformationBrowser->setPlainText(reportText); - - QPushButton* saveButton = new QPushButton(ui.buttonBox); - KGuiItem::assign(saveButton, KGuiItem2(i18nc("@action:button", "&Save to File..."), - QIcon::fromTheme(QStringLiteral("document-save")), - i18nc("@info:tooltip", "Use this button to save the " - "generated crash report information to " - "a file. You can use this option to report the " - "bug later."))); - connect(saveButton, &QPushButton::clicked, this, &ReportInformationDialog::saveReport); - ui.buttonBox->addButton(saveButton, QDialogButtonBox::ActionRole); - - resize(QSize(800, 600)); - KConfigGroup config(KSharedConfig::openConfig(), "ReportInformationDialog"); - KWindowConfig::restoreWindowSize(windowHandle(), config); -} - -ReportInformationDialog::~ReportInformationDialog() -{ - KConfigGroup config(KSharedConfig::openConfig(), "ReportInformationDialog"); - KWindowConfig::saveWindowSize(windowHandle(), config); -} - -void ReportInformationDialog::saveReport() -{ - DrKonqi::saveReport(ui.m_reportInformationBrowser->toPlainText(), this); -} - -//END ReportInformationDialog - diff --git a/drkonqi/bugzillaintegration/reportassistantpages_base.h b/drkonqi/bugzillaintegration/reportassistantpages_base.h deleted file mode 100644 index a5b021a84..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpages_base.h +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************* -* reportassistantpages_base.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef REPORTASSISTANTPAGES__BASE__H -#define REPORTASSISTANTPAGES__BASE__H - -#include -#include - -#include "reportassistantdialog.h" -#include "reportassistantpage.h" - -#include "ui_assistantpage_introduction.h" -#include "ui_assistantpage_bugawareness.h" -#include "ui_assistantpage_conclusions.h" -#include "ui_assistantpage_conclusions_dialog.h" - -class BacktraceWidget; - -/** Introduction page **/ -class IntroductionPage: public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit IntroductionPage(ReportAssistantDialog *); - -private: - Ui::AssistantPageIntroduction ui; -}; - -/** Backtrace page **/ -class CrashInformationPage: public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit CrashInformationPage(ReportAssistantDialog *); - - void aboutToShow() override; - void aboutToHide() override; - bool isComplete() override; - bool showNextPage() override; - -private: - BacktraceWidget * m_backtraceWidget; -}; - -/** Bug Awareness page **/ -class BugAwarenessPage: public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit BugAwarenessPage(ReportAssistantDialog *); - - void aboutToShow() override; - void aboutToHide() override; - -private Q_SLOTS: - void showApplicationDetailsExamples(); - - void updateCheckBoxes(); - -private: - Ui::AssistantPageBugAwareness ui; -}; - -/** Conclusions page **/ -class ConclusionPage : public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit ConclusionPage(ReportAssistantDialog *); - - void aboutToShow() override; - void aboutToHide() override; - - bool isComplete() override; - -private Q_SLOTS: - void finishClicked(); - - void openReportInformation(); - -private: - Ui::AssistantPageConclusions ui; - - QPointer m_infoDialog; - - bool m_isBKO; - bool m_needToReport; - -Q_SIGNALS: - void finished(bool); -}; - -class ReportInformationDialog : public QDialog -{ - Q_OBJECT -public: - explicit ReportInformationDialog(const QString & reportText); - ~ReportInformationDialog() override; - -private Q_SLOTS: - void saveReport(); - -private: - Ui::AssistantPageConclusionsDialog ui; -}; - -#endif diff --git a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla.cpp b/drkonqi/bugzillaintegration/reportassistantpages_bugzilla.cpp deleted file mode 100644 index d752718ba..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla.cpp +++ /dev/null @@ -1,889 +0,0 @@ -/******************************************************************* -* reportassistantpages_bugzilla.cpp -* Copyright 2009, 2010, 2011 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "reportassistantpages_bugzilla.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -/* Unhandled error dialog includes */ -#include -#include -#include -#include - -#include "reportinterface.h" -#include "systeminformation.h" -#include "crashedapplication.h" -#include "bugzillalib.h" -#include "statuswidget.h" -#include "drkonqi.h" -#include "drkonqi_globals.h" -#include "applicationdetailsexamples.h" - -static const char kWalletEntryName[] = "drkonqi_bugzilla"; -static const char kWalletEntryUsername[] = "username"; -static const char kWalletEntryPassword[] = "password"; - -static QString konquerorKWalletEntryName = KDE_BUGZILLA_URL + "index.cgi#login"; -static const char konquerorKWalletEntryUsername[] = "Bugzilla_login"; -static const char konquerorKWalletEntryPassword[] = "Bugzilla_password"; - -//BEGIN BugzillaLoginPage - -BugzillaLoginPage::BugzillaLoginPage(ReportAssistantDialog * parent) : - ReportAssistantPage(parent), - m_wallet(0), m_walletWasOpenedBefore(false), - m_bugzillaVersionFound(false) -{ - connect(bugzillaManager(), &BugzillaManager::bugzillaVersionFound, this, &BugzillaLoginPage::bugzillaVersionFound); - connect(bugzillaManager(), &BugzillaManager::loginFinished, this, &BugzillaLoginPage::loginFinished); - connect(bugzillaManager(), &BugzillaManager::loginError, this, &BugzillaLoginPage::loginError); - - ui.setupUi(this); - ui.m_statusWidget->setIdle(i18nc("@info:status '1' is replaced with the short URL of the bugzilla ", - "You need to login with your %1 account in order to proceed.", - QLatin1String(KDE_BUGZILLA_SHORT_URL))); - - KGuiItem::assign(ui.m_loginButton, KGuiItem2(i18nc("@action:button", "Login"), - QIcon::fromTheme(QStringLiteral("network-connect")), - i18nc("@info:tooltip", "Use this button to login " - "to the KDE bug tracking system using the provided " - "username and password."))); - ui.m_loginButton->setEnabled(false); - - connect(ui.m_loginButton, &QPushButton::clicked, this, &BugzillaLoginPage::loginClicked); - - connect(ui.m_userEdit, &KLineEdit::returnPressed, this, &BugzillaLoginPage::loginClicked); - connect(ui.m_passwordEdit, &KLineEdit::returnPressed, this, &BugzillaLoginPage::loginClicked); - - connect(ui.m_userEdit, &KLineEdit::textChanged, this, &BugzillaLoginPage::updateLoginButtonStatus); - connect(ui.m_passwordEdit, &KLineEdit::textChanged, this, &BugzillaLoginPage::updateLoginButtonStatus); - - ui.m_noticeLabel->setText( - xi18nc("@info/rich","You need a user account on the " - "KDE bug tracking system in order to " - "file a bug report, because we may need to contact you later " - "for requesting further information. If you do not have " - "one, you can freely create one here. " - "Please do not use disposable email accounts.", - DrKonqi::crashedApplication()->bugReportAddress(), - KDE_BUGZILLA_CREATE_ACCOUNT_URL)); -} - -bool BugzillaLoginPage::isComplete() -{ - return bugzillaManager()->getLogged(); -} - -void BugzillaLoginPage::bugzillaVersionFound() -{ - // Login depends on first knowing the Bugzilla software version number. - m_bugzillaVersionFound = true; - updateLoginButtonStatus(); -} - -void BugzillaLoginPage::updateLoginButtonStatus() -{ - ui.m_loginButton->setEnabled( !ui.m_userEdit->text().isEmpty() && - !ui.m_passwordEdit->text().isEmpty() && - m_bugzillaVersionFound ); -} - -void BugzillaLoginPage::loginError(const QString & err, const QString & extendedMessage) -{ - loginFinished(false); - ui.m_statusWidget->setIdle(xi18nc("@info:status","Error when trying to login: " - "%1.", err)); - if (!extendedMessage.isEmpty()) { - new UnhandledErrorDialog(this, err, extendedMessage); - } -} - -void BugzillaLoginPage::aboutToShow() -{ - if (bugzillaManager()->getLogged()) { - ui.m_loginButton->setEnabled(false); - - ui.m_userEdit->setEnabled(false); - ui.m_userEdit->clear(); - ui.m_passwordEdit->setEnabled(false); - ui.m_passwordEdit->clear(); - - ui.m_loginButton->setVisible(false); - ui.m_userEdit->setVisible(false); - ui.m_passwordEdit->setVisible(false); - ui.m_userLabel->setVisible(false); - ui.m_passwordLabel->setVisible(false); - - ui.m_savePasswordCheckBox->setVisible(false); - - ui.m_noticeLabel->setVisible(false); - - ui.m_statusWidget->setIdle(i18nc("@info:status the user is logged at the bugtracker site " - "as USERNAME", - "Logged in at the KDE bug tracking system (%1) as: %2.", - QLatin1String(KDE_BUGZILLA_SHORT_URL), - bugzillaManager()->getUsername())); - } else { - //Try to show wallet dialog once this dialog is shown - QTimer::singleShot(100, this, &BugzillaLoginPage::walletLogin); - } -} - -bool BugzillaLoginPage::kWalletEntryExists(const QString& entryName) -{ - return !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), - KWallet::Wallet::FormDataFolder(), - entryName); -} - -void BugzillaLoginPage::openWallet() -{ - //Store if the wallet was previously opened so we can know if we should close it later - m_walletWasOpenedBefore = KWallet::Wallet::isOpen(KWallet::Wallet::NetworkWallet()); - //Request open the wallet - m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), - static_cast(this->parent())->winId()); -} - -void BugzillaLoginPage::walletLogin() -{ - if (!m_wallet) { - if (kWalletEntryExists(QLatin1String(kWalletEntryName))) { //Key exists! - openWallet(); - ui.m_savePasswordCheckBox->setCheckState(Qt::Checked); - //Was the wallet opened? - if (m_wallet) { - m_wallet->setFolder(KWallet::Wallet::FormDataFolder()); - - //Use wallet data to try login - QMap values; - m_wallet->readMap(QLatin1String(kWalletEntryName), values); - QString username = values.value(QLatin1String(kWalletEntryUsername)); - QString password = values.value(QLatin1String(kWalletEntryPassword)); - - if (!username.isEmpty() && !password.isEmpty()) { - ui.m_userEdit->setText(username); - ui.m_passwordEdit->setText(password); - } - } - } else if (kWalletEntryExists(konquerorKWalletEntryName)) { - //If the DrKonqi entry is empty, but a Konqueror entry exists, use and copy it. - openWallet(); - if (m_wallet) { - m_wallet->setFolder(KWallet::Wallet::FormDataFolder()); - - //Fetch Konqueror data - QMap values; - m_wallet->readMap(konquerorKWalletEntryName, values); - QString username = values.value(QLatin1String(konquerorKWalletEntryUsername)); - QString password = values.value(QLatin1String(konquerorKWalletEntryPassword)); - - if (!username.isEmpty() && !password.isEmpty()) { - //Copy to DrKonqi own entries - values.clear(); - values.insert(QLatin1String(kWalletEntryUsername), username); - values.insert(QLatin1String(kWalletEntryPassword), password); - m_wallet->writeMap(QLatin1String(kWalletEntryName), values); - - ui.m_savePasswordCheckBox->setCheckState(Qt::Checked); - - ui.m_userEdit->setText(username); - ui.m_passwordEdit->setText(password); - } - } - - } - } -} - -bool BugzillaLoginPage::canSetCookies() -{ - if (bugzillaManager()->securityMethod() != BugzillaManager::UseCookies) { - qDebug() << "Bugzilla software no longer issues cookies."; - return false; - } - QDBusInterface kded(QLatin1String("org.kde.kded5"), - QLatin1String("/kded"), - QLatin1String("org.kde.kded5")); - QDBusReply kcookiejarLoaded = kded.call(QLatin1String("loadModule"), - QLatin1String("kcookiejar")); - if (!kcookiejarLoaded.isValid()) { - KMessageBox::error(this, i18n("Failed to communicate with kded. Make sure it is running.")); - return false; - } else if (!kcookiejarLoaded.value()) { - KMessageBox::error(this, i18n("Failed to load KCookieServer. Check your KDE installation.")); - return false; - } - - - QDBusInterface kcookiejar(QLatin1String("org.kde.kded5"), - QLatin1String("/modules/kcookiejar"), - QLatin1String("org.kde.KCookieServer")); - QDBusReply advice = kcookiejar.call(QLatin1String("getDomainAdvice"), - KDE_BUGZILLA_URL); - - if (!advice.isValid()) { - KMessageBox::error(this, i18n("Failed to communicate with KCookieServer.")); - return false; - } - - qDebug() << "Got reply from KCookieServer:" << advice.value(); - - if (advice.value() == QLatin1String("Reject")) { - QString msg = i18nc("@info 1 is the bugzilla website url", - "Cookies are not allowed in your KDE network settings. In order to " - "proceed, you need to allow %1 to set cookies.", KDE_BUGZILLA_URL); - - KGuiItem yesItem = KStandardGuiItem::yes(); - yesItem.setText(i18nc("@action:button 1 is the bugzilla website url", - "Allow %1 to set cookies", KDE_BUGZILLA_URL)); - - KGuiItem noItem = KStandardGuiItem::no(); - noItem.setText(i18nc("@action:button do not allow the bugzilla website " - "to set cookies", "No, do not allow")); - - if (KMessageBox::warningYesNo(this, msg, QString(), yesItem, noItem) == KMessageBox::Yes) { - QDBusReply success = kcookiejar.call(QStringLiteral("setDomainAdvice"), - KDE_BUGZILLA_URL, - QStringLiteral("Accept")); - if (!success.isValid() || !success.value()) { - qWarning() << "Failed to set domain advice in KCookieServer"; - return false; - } else { - return true; - } - } else { - return false; - } - } - - return true; -} - -void BugzillaLoginPage::loginClicked() -{ - if (!(ui.m_userEdit->text().isEmpty() || ui.m_passwordEdit->text().isEmpty())) { - - if ((bugzillaManager()->securityMethod() == BugzillaManager::UseCookies) - && (!canSetCookies())) { - return; - } - - ui.m_loginButton->setEnabled(false); - - ui.m_userLabel->setEnabled(false); - ui.m_passwordLabel->setEnabled(false); - - ui.m_userEdit->setEnabled(false); - ui.m_passwordEdit->setEnabled(false); - ui.m_savePasswordCheckBox->setEnabled(false); - - if (ui.m_savePasswordCheckBox->checkState()==Qt::Checked) { //Wants to save data - if (!m_wallet) { - openWallet(); - } - //Got wallet open ? - if (m_wallet) { - m_wallet->setFolder(KWallet::Wallet::FormDataFolder()); - - QMap values; - values.insert(QLatin1String(kWalletEntryUsername), ui.m_userEdit->text()); - values.insert(QLatin1String(kWalletEntryPassword), ui.m_passwordEdit->text()); - m_wallet->writeMap(QLatin1String(kWalletEntryName), values); - } - - } else { //User doesn't want to save or wants to remove. - if (kWalletEntryExists(QLatin1String(kWalletEntryName))) { - if (!m_wallet) { - openWallet(); - } - //Got wallet open ? - if (m_wallet) { - m_wallet->setFolder(KWallet::Wallet::FormDataFolder()); - m_wallet->removeEntry(QLatin1String(kWalletEntryName)); - } - } - } - - ui.m_statusWidget->setBusy(i18nc("@info:status '1' is a url, '2' the username", - "Performing login at %1 as %2...", - QLatin1String(KDE_BUGZILLA_SHORT_URL), ui.m_userEdit->text())); - - bugzillaManager()->tryLogin(ui.m_userEdit->text(), ui.m_passwordEdit->text()); - } else { - loginFinished(false); - } -} - -void BugzillaLoginPage::loginFinished(bool logged) -{ - if (logged) { - emitCompleteChanged(); - - aboutToShow(); - if (m_wallet) { - if (m_wallet->isOpen() && !m_walletWasOpenedBefore) { - m_wallet->lockWallet(); - } - } - - emit loggedTurnToNextPage(); - } else { - ui.m_statusWidget->setIdle(i18nc("@info:status","Error: Invalid username or " - "password")); - - ui.m_loginButton->setEnabled(true); - - ui.m_userEdit->setEnabled(true); - ui.m_passwordEdit->setEnabled(true); - ui.m_savePasswordCheckBox->setEnabled(true); - - ui.m_userEdit->setFocus(Qt::OtherFocusReason); - } -} - -BugzillaLoginPage::~BugzillaLoginPage() -{ - //Close wallet if we close the assistant in this step - if (m_wallet) { - if (m_wallet->isOpen() && !m_walletWasOpenedBefore) { - m_wallet->lockWallet(); - } - delete m_wallet; - } -} - -//END BugzillaLoginPage - -//BEGIN BugzillaInformationPage - -BugzillaInformationPage::BugzillaInformationPage(ReportAssistantDialog * parent) - : ReportAssistantPage(parent), - m_textsOK(false), m_distributionComboSetup(false), m_distroComboVisible(false), - m_requiredCharacters(1) -{ - ui.setupUi(this); - m_textCompleteBar = new KCapacityBar(KCapacityBar::DrawTextInline, this); - ui.horizontalLayout_2->addWidget(m_textCompleteBar); - - connect(ui.m_titleEdit, &KLineEdit::textChanged, this, &BugzillaInformationPage::checkTexts); - connect(ui.m_detailsEdit, &QTextEdit::textChanged, this, &BugzillaInformationPage::checkTexts); - - connect(ui.m_titleLabel, &QLabel::linkActivated, this, &BugzillaInformationPage::showTitleExamples); - connect(ui.m_detailsLabel, &QLabel::linkActivated, this, &BugzillaInformationPage::showDescriptionHelpExamples); - - ui.m_compiledSourcesCheckBox->setChecked( - DrKonqi::systemInformation()->compiledSources()); - -} - -void BugzillaInformationPage::aboutToShow() -{ - if (!m_distributionComboSetup) { - //Autodetecting distro failed ? - if (DrKonqi::systemInformation()->bugzillaPlatform() == QLatin1String("unspecified")) { - m_distroComboVisible = true; - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Unspecified"),"unspecified"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Archlinux"), "Archlinux Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Chakra"), "Chakra"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Debian stable"), "Debian stable"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Debian testing"), "Debian testing"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Debian unstable"), "Debian unstable"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Exherbo"), "Exherbo Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Fedora"), "Fedora RPMs"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Gentoo"), "Gentoo Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Mageia"), "Mageia RPMs"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Mandriva"), "Mandriva RPMs"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Neon"), "Neon Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "OpenSUSE"), "openSUSE RPMs"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Pardus"), "Pardus Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "RedHat"), "RedHat RPMs"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Slackware"), "Slackware Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Ubuntu (and derivatives)"), - "Ubuntu Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "FreeBSD (Ports)"), "FreeBSD Ports"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "NetBSD (pkgsrc)"), "NetBSD pkgsrc"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "OpenBSD"), "OpenBSD Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Mac OS X"), "MacPorts Packages"); - ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method", - "Solaris"), "Solaris Packages"); - - //Restore previously selected bugzilla platform (distribution) - KConfigGroup config(KSharedConfig::openConfig(), "BugzillaInformationPage"); - QString entry = config.readEntry("BugzillaPlatform","unspecified"); - int index = ui.m_distroChooserCombo->findData(entry); - if ( index == -1 ) index = 0; - ui.m_distroChooserCombo->setCurrentIndex(index); - } else { - ui.m_distroChooserCombo->setVisible(false); - } - m_distributionComboSetup = true; - } - - //Calculate the minimum number of characters required for a description - //If creating a new report: minimum 40, maximum 80 - //If attaching to an existent report: minimum 30, maximum 50 - int multiplier = (reportInterface()->attachToBugNumber() == 0) ? 10 : 5; - m_requiredCharacters = 20 + (reportInterface()->selectedOptionsRating() * multiplier); - - //Fill the description textedit with some headings: - QString descriptionTemplate; - if (ui.m_detailsEdit->toPlainText().isEmpty()) { - if (reportInterface()->userCanProvideActionsAppDesktop()) { - descriptionTemplate += QLatin1String("- What I was doing when the application crashed:\n\n"); - } - if (reportInterface()->userCanProvideUnusualBehavior()) { - descriptionTemplate += QLatin1String("- Unusual behavior I noticed:\n\n"); - } - if (reportInterface()->userCanProvideApplicationConfigDetails()) { - descriptionTemplate += QLatin1String("- Custom settings of the application:\n\n"); - } - ui.m_detailsEdit->setText(descriptionTemplate); - } - - checkTexts(); //May be the options (canDetail) changed and we need to recheck -} - -int BugzillaInformationPage::currentDescriptionCharactersCount() -{ - QString description = ui.m_detailsEdit->toPlainText(); - - //Do not count template messages, and other misc chars - description.remove(QStringLiteral("What I was doing when the application crashed")); - description.remove(QStringLiteral("Unusual behavior I noticed")); - description.remove(QStringLiteral("Custom settings of the application")); - description.remove('\n'); - description.remove('-'); - description.remove(':'); - description.remove(' '); - - return description.size(); -} - -void BugzillaInformationPage::checkTexts() -{ - //If attaching this report to an existing one then the title is not needed - bool showTitle = (reportInterface()->attachToBugNumber() == 0); - ui.m_titleEdit->setVisible(showTitle); - ui.m_titleLabel->setVisible(showTitle); - - bool ok = !((ui.m_titleEdit->isVisible() && ui.m_titleEdit->text().isEmpty()) - || ui.m_detailsEdit->toPlainText().isEmpty()); - - QString message; - int percent = currentDescriptionCharactersCount() * 100 / m_requiredCharacters; - if (percent >= 100) { - percent = 100; - message = i18nc("the minimum required length of a text was reached", - "Minimum length reached"); - } else { - message = i18nc("the minimum required length of a text wasn't reached yet", - "Provide more information"); - } - m_textCompleteBar->setValue(percent); - m_textCompleteBar->setText(message); - - if (ok != m_textsOK) { - m_textsOK = ok; - emitCompleteChanged(); - } -} - -bool BugzillaInformationPage::showNextPage() -{ - checkTexts(); - - if (m_textsOK) { - bool detailsShort = currentDescriptionCharactersCount() < m_requiredCharacters; - - if (detailsShort) { - //The user input is less than we want.... encourage to write more - QString message = i18nc("@info","The description about the crash details does not provide " - "enough information yet.

"); - - message += ' ' + i18nc("@info","The amount of required information is proportional to " - "the quality of the other information like the backtrace " - "or the reproducibility rate." - "

"); - - if (reportInterface()->userCanProvideActionsAppDesktop() - || reportInterface()->userCanProvideUnusualBehavior() - || reportInterface()->userCanProvideApplicationConfigDetails()) { - message += ' ' + i18nc("@info","Previously, you told DrKonqi that you could provide some " - "contextual information. Try writing more details about your situation. " - "(even little ones could help us.)

"); - } - - message += ' ' + i18nc("@info","If you cannot provide more information, your report " - "will probably waste developers' time. Can you tell us more?"); - - KGuiItem yesItem = KStandardGuiItem::yes(); - yesItem.setText(i18n("Yes, let me add more information")); - - KGuiItem noItem = KStandardGuiItem::no(); - noItem.setText(i18n("No, I cannot add any other information")); - - if (KMessageBox::warningYesNo(this, message, - i18nc("@title:window","We need more information"), - yesItem, noItem) - == KMessageBox::No) { - //Request the assistant to close itself (it will prompt for confirmation anyways) - assistant()->close(); - return false; - } - } else { - return true; - } - } - - return false; -} - -bool BugzillaInformationPage::isComplete() -{ - return m_textsOK; -} - -void BugzillaInformationPage::aboutToHide() -{ - //Save fields data - reportInterface()->setTitle(ui.m_titleEdit->text()); - reportInterface()->setDetailText(ui.m_detailsEdit->toPlainText()); - - if (m_distroComboVisible) { - //Save bugzilla platform (distribution) - QString bugzillaPlatform = ui.m_distroChooserCombo->itemData( - ui.m_distroChooserCombo->currentIndex()).toString(); - KConfigGroup config(KSharedConfig::openConfig(), "BugzillaInformationPage"); - config.writeEntry("BugzillaPlatform", bugzillaPlatform); - DrKonqi::systemInformation()->setBugzillaPlatform(bugzillaPlatform); - } - bool compiledFromSources = ui.m_compiledSourcesCheckBox->checkState() == Qt::Checked; - DrKonqi::systemInformation()->setCompiledSources(compiledFromSources); - -} - -void BugzillaInformationPage::showTitleExamples() -{ - QString titleExamples = xi18nc("@info:tooltip examples of good bug report titles", - "Examples of good titles:\"Plasma crashed after adding the Notes " - "widget and writing on it\"\"Konqueror crashed when accessing the Facebook " - "application 'X'\"\"Kopete suddenly closed after resuming the computer and " - "talking to a MSN buddy\"\"Kate closed while editing a log file and pressing the " - "Delete key a couple of times\""); - QToolTip::showText(QCursor::pos(), titleExamples); -} - -void BugzillaInformationPage::showDescriptionHelpExamples() -{ - QString descriptionHelp = i18nc("@info:tooltip help and examples of good bug descriptions", - "Describe in as much detail as possible the crash circumstances:"); - if (reportInterface()->userCanProvideActionsAppDesktop()) { - descriptionHelp += "
" + - i18nc("@info:tooltip help and examples of good bug descriptions", - "- Detail which actions were you taking inside and outside the " - "application an instant before the crash."); - } - if (reportInterface()->userCanProvideUnusualBehavior()) { - descriptionHelp += "
" + - i18nc("@info:tooltip help and examples of good bug descriptions", - "- Note if you noticed any unusual behavior in the application " - "or in the whole environment."); - } - if (reportInterface()->userCanProvideApplicationConfigDetails()) { - descriptionHelp += "
" + - i18nc("@info:tooltip help and examples of good bug descriptions", - "- Note any non-default configuration in the application."); - if (reportInterface()->appDetailsExamples()->hasExamples()) { - descriptionHelp += ' ' + - i18nc("@info:tooltip examples of configuration details. " - "the examples are already translated", - "Examples: %1", - reportInterface()->appDetailsExamples()->examples()); - } - } - QToolTip::showText(QCursor::pos(), descriptionHelp); -} - -//END BugzillaInformationPage - -//BEGIN BugzillaPreviewPage - -BugzillaPreviewPage::BugzillaPreviewPage(ReportAssistantDialog * parent) - : ReportAssistantPage(parent) -{ - ui.setupUi(this); -} - -void BugzillaPreviewPage::aboutToShow() -{ - ui.m_previewEdit->setText(reportInterface()->generateReportFullText(true)); -} - -//END BugzillaPreviewPage - -//BEGIN BugzillaSendPage - -BugzillaSendPage::BugzillaSendPage(ReportAssistantDialog * parent) - : ReportAssistantPage(parent), - m_contentsDialog(0) -{ - connect(reportInterface(), &ReportInterface::reportSent, this, &BugzillaSendPage::sent); - connect(reportInterface(), &ReportInterface::sendReportError, this, &BugzillaSendPage::sendError); - - ui.setupUi(this); - - KGuiItem::assign(ui.m_retryButton, KGuiItem2(i18nc("@action:button", "Retry..."), - QIcon::fromTheme(QStringLiteral("view-refresh")), - i18nc("@info:tooltip", "Use this button to retry " - "sending the crash report if it failed before."))); - - KGuiItem::assign(ui.m_showReportContentsButton, - KGuiItem2(i18nc("@action:button", "Sho&w Contents of the Report"), - QIcon::fromTheme(QStringLiteral("document-preview")), - i18nc("@info:tooltip", "Use this button to show the generated " - "report information about this crash."))); - connect(ui.m_showReportContentsButton, &QPushButton::clicked, this, &BugzillaSendPage::openReportContents); - - ui.m_retryButton->setVisible(false); - connect(ui.m_retryButton, &QAbstractButton::clicked, this , &BugzillaSendPage::retryClicked); - - ui.m_launchPageOnFinish->setVisible(false); - ui.m_restartAppOnFinish->setVisible(false); - - connect(assistant(), SIGNAL(user1Clicked()), this, SLOT(finishClicked())); -} - -void BugzillaSendPage::retryClicked() -{ - ui.m_retryButton->setEnabled(false); - aboutToShow(); -} - -void BugzillaSendPage::aboutToShow() -{ - ui.m_statusWidget->setBusy(i18nc("@info:status","Sending crash report... (please wait)")); - reportInterface()->sendBugReport(); -} - -void BugzillaSendPage::sent(int bug_id) -{ - ui.m_statusWidget->setVisible(false); - ui.m_retryButton->setEnabled(false); - ui.m_retryButton->setVisible(false); - - ui.m_showReportContentsButton->setVisible(false); - - ui.m_launchPageOnFinish->setVisible(true); - ui.m_restartAppOnFinish->setVisible(!DrKonqi::crashedApplication()->hasBeenRestarted()); - ui.m_restartAppOnFinish->setChecked(false); - - reportUrl = bugzillaManager()->urlForBug(bug_id); - ui.m_finishedLabel->setText(xi18nc("@info/rich","Crash report sent." - "URL: %1" - "Thank you for being part of KDE. " - "You can now close this window.", reportUrl)); - - emit finished(false); -} - -void BugzillaSendPage::sendError(const QString & errorString, const QString & extendedMessage) -{ - ui.m_statusWidget->setIdle(xi18nc("@info:status","Error sending the crash report: " - "%1.", errorString)); - - ui.m_retryButton->setEnabled(true); - ui.m_retryButton->setVisible(true); - - if (!extendedMessage.isEmpty()) { - new UnhandledErrorDialog(this,errorString, extendedMessage); - } -} - -void BugzillaSendPage::finishClicked() -{ - if (ui.m_launchPageOnFinish->isChecked() && !reportUrl.isEmpty()) { - QDesktopServices::openUrl(QUrl(reportUrl)); - } - if (ui.m_restartAppOnFinish->isChecked()) { - DrKonqi::crashedApplication()->restart(); - } -} - -void BugzillaSendPage::openReportContents() -{ - if (!m_contentsDialog) - { - QString report = reportInterface()->generateReportFullText(false) + QLatin1Char('\n') + - i18nc("@info report to KDE bugtracker address","Report to %1", - DrKonqi::crashedApplication()->bugReportAddress()); - m_contentsDialog = new ReportInformationDialog(report); - } - m_contentsDialog->show(); - m_contentsDialog->raise(); - m_contentsDialog->activateWindow(); -} - -//END BugzillaSendPage - -/* Dialog for Unhandled Bugzilla Errors */ -/* The user can save the bugzilla html output to check the error and/or to report this as a DrKonqi bug */ - -//BEGIN UnhandledErrorDialog - -UnhandledErrorDialog::UnhandledErrorDialog(QWidget * parent, const QString & error, const QString & extendedMessage) - : QDialog(parent) -{ - setWindowTitle(i18nc("@title:window", "Unhandled Bugzilla Error")); - setWindowModality(Qt::ApplicationModal); - - QPushButton* saveButton = new QPushButton(this); - saveButton->setText(i18nc("@action:button save html to a file","Save to a file")); - saveButton->setIcon(QIcon::fromTheme(QStringLiteral("document-save"))); - connect(saveButton, &QPushButton::clicked, this, &UnhandledErrorDialog::saveErrorMessage); - - setAttribute(Qt::WA_DeleteOnClose); - - QTextBrowser * htmlView = new QTextBrowser(this); - - QLabel * iconLabel = new QLabel(this); - iconLabel->setFixedSize(32, 32); - iconLabel->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(32, 32)); - - QLabel * mainLabel = new QLabel(this); - mainLabel->setWordWrap(true); - mainLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); - - QHBoxLayout * titleLayout = new QHBoxLayout(); - titleLayout->setContentsMargins(5,2,5,2); - titleLayout->setSpacing(5); - titleLayout->addWidget(iconLabel); - titleLayout->addWidget(mainLabel); - - QDialogButtonBox* buttonBox = new QDialogButtonBox(this); - buttonBox->setStandardButtons(QDialogButtonBox::Close); - connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); - - QVBoxLayout * layout = new QVBoxLayout(); - layout->addLayout(titleLayout); - layout->addWidget(htmlView); - layout->addWidget(buttonBox); - setLayout(layout); - - m_extendedHTMLError = extendedMessage; - mainLabel->setText(i18nc("@label", "There was an unhandled Bugzilla error: %1.
" - "Below is the HTML that DrKonqi received. " - "Try to perform the action again or save this error page " - "to submit a bug against DrKonqi.").arg(error)); - htmlView->setHtml(extendedMessage); - - setMinimumSize(QSize(550, 350)); - resize(minimumSize()); - - show(); -} - -void UnhandledErrorDialog::saveErrorMessage() -{ - QString defaultName = QLatin1String("drkonqi-unhandled-bugzilla-error.html"); - QPointer dlg(new QFileDialog(this)); - dlg->selectFile(defaultName); - dlg->setWindowTitle(i18nc("@title:window","Select Filename")); - dlg->setAcceptMode(QFileDialog::AcceptSave); - dlg->setFileMode(QFileDialog::AnyFile); - dlg->setConfirmOverwrite(true); - - if ( dlg->exec() == QDialog::Accepted ) - { - if (!dlg) { - //Dialog closed externally (ex. via DBus) - return; - } - - QUrl fileUrl; - if(!dlg->selectedUrls().isEmpty()) - fileUrl = dlg->selectedUrls().first(); - - if (fileUrl.isValid()) { - QTemporaryFile tf; - if (tf.open()) { - QTextStream ts(&tf); - ts << m_extendedHTMLError; - ts.flush(); - } else { - KMessageBox::sorry(this, xi18nc("@info","Cannot open file %1 " - "for writing.", tf.fileName())); - delete dlg; - return; - } - - KIO::FileCopyJob* job = KIO::file_copy(QUrl::fromLocalFile(tf.fileName()), fileUrl); - KJobWidgets::setWindow(job, this); - if (!job->exec()) { - KMessageBox::sorry(this, job->errorString()); - } - } - } - delete dlg; - -} - -//END UnhandledErrorDialog diff --git a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla.h b/drkonqi/bugzillaintegration/reportassistantpages_bugzilla.h deleted file mode 100644 index dad94bcb5..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla.h +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************* -* reportassistantpages_bugzilla.h -* Copyright 2009, 2011 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef REPORTASSISTANTPAGES__BUGZILLA__H -#define REPORTASSISTANTPAGES__BUGZILLA__H - -#include "reportassistantpage.h" - -#include "reportassistantpages_base.h" - -#include "ui_assistantpage_bugzilla_login.h" -#include "ui_assistantpage_bugzilla_information.h" -#include "ui_assistantpage_bugzilla_preview.h" -#include "ui_assistantpage_bugzilla_send.h" - -namespace KWallet { class Wallet; } -class KCapacityBar; - -/** Bugzilla login **/ -class BugzillaLoginPage: public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit BugzillaLoginPage(ReportAssistantDialog *); - ~BugzillaLoginPage() override; - - void aboutToShow() override; - bool isComplete() override; - -private Q_SLOTS: - void bugzillaVersionFound(); - void loginClicked(); - void loginFinished(bool); - void loginError(const QString &, const QString &); - - void walletLogin(); - - void updateLoginButtonStatus(); - -Q_SIGNALS: - void loggedTurnToNextPage(); - -private: - bool kWalletEntryExists(const QString&); - void openWallet(); - bool canSetCookies(); - - Ui::AssistantPageBugzillaLogin ui; - - KWallet::Wallet * m_wallet; - bool m_walletWasOpenedBefore; - bool m_bugzillaVersionFound; -}; - -/** Title and details page **/ -class BugzillaInformationPage : public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit BugzillaInformationPage(ReportAssistantDialog *); - - void aboutToShow() override; - void aboutToHide() override; - - bool isComplete() override; - bool showNextPage() override; - -private Q_SLOTS: - void showTitleExamples(); - void showDescriptionHelpExamples(); - - void checkTexts(); - -private: - int currentDescriptionCharactersCount(); - - Ui::AssistantPageBugzillaInformation ui; - KCapacityBar * m_textCompleteBar; - - bool m_textsOK; - bool m_distributionComboSetup; - bool m_distroComboVisible; - - int m_requiredCharacters; -}; - -/** Preview report page **/ -class BugzillaPreviewPage : public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit BugzillaPreviewPage(ReportAssistantDialog *); - - void aboutToShow() override; - -private: - Ui::AssistantPageBugzillaPreview ui; -}; - -/** Send crash report page **/ -class BugzillaSendPage : public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit BugzillaSendPage(ReportAssistantDialog *); - - void aboutToShow() override; - -private Q_SLOTS: - void sent(int); - void sendError(const QString &, const QString &); - - void retryClicked(); - void finishClicked(); - - void openReportContents(); - -private: - Ui::AssistantPageBugzillaSend ui; - QString reportUrl; - - QPointer m_contentsDialog; - -Q_SIGNALS: - void finished(bool); - -}; - -class UnhandledErrorDialog: public QDialog -{ - Q_OBJECT - -public: - UnhandledErrorDialog(QWidget * parent, const QString &, const QString &); - -private Q_SLOTS: - void saveErrorMessage(); - -private: - QString m_extendedHTMLError; -}; - -#endif diff --git a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp b/drkonqi/bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp deleted file mode 100644 index de4f9a24c..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp +++ /dev/null @@ -1,1002 +0,0 @@ -/******************************************************************* -* reportassistantpages_bugzilla_duplicates.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "reportassistantpages_bugzilla_duplicates.h" - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "drkonqi_globals.h" -#include "reportinterface.h" -#include "statuswidget.h" - -//BEGIN BugzillaDuplicatesPage - -BugzillaDuplicatesPage::BugzillaDuplicatesPage(ReportAssistantDialog * parent): - ReportAssistantPage(parent), - m_searching(false), - m_foundDuplicate(false) -{ - resetDates(); - - connect(bugzillaManager(), &BugzillaManager::searchFinished, - this, &BugzillaDuplicatesPage::searchFinished); - connect(bugzillaManager(), SIGNAL(searchError(QString)), - this, SLOT(searchError(QString))); - - ui.setupUi(this); - ui.information->hide(); - - connect(ui.m_bugListWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), - this, SLOT(itemClicked(QTreeWidgetItem*,int))); - connect(ui.m_bugListWidget, &QTreeWidget::itemSelectionChanged, this, &BugzillaDuplicatesPage::itemSelectionChanged); - - QHeaderView * header = ui.m_bugListWidget->header(); - header->setSectionResizeMode(0, QHeaderView::ResizeToContents); - header->setSectionResizeMode(1, QHeaderView::Interactive); - - //Create manual bug report entry (first one) - QTreeWidgetItem * customBugItem = new QTreeWidgetItem( - QStringList() << i18nc("@item:intable custom/manaul bug report number", "Manual") - << i18nc("@item:intable custom bug report number description", - "Manually enter a bug report ID")); - customBugItem->setData(0, Qt::UserRole, QLatin1String("custom")); - customBugItem->setIcon(1, QIcon::fromTheme(QStringLiteral("edit-rename"))); - - QString helpMessage = i18nc("@info:tooltip / whatsthis", - "Select this option to manually load a specific bug report"); - customBugItem->setToolTip(0, helpMessage); - customBugItem->setToolTip(1, helpMessage); - customBugItem->setWhatsThis(0, helpMessage); - customBugItem->setWhatsThis(1, helpMessage); - - ui.m_bugListWidget->addTopLevelItem(customBugItem); - - m_searchMoreGuiItem = KGuiItem2(i18nc("@action:button", "Search for more reports"), - QIcon::fromTheme(QStringLiteral("edit-find")), - i18nc("@info:tooltip", "Use this button to " - "search for more similar bug reports on an " - "earlier date.")); - KGuiItem::assign(ui.m_searchMoreButton, m_searchMoreGuiItem); - connect(ui.m_searchMoreButton, &QAbstractButton::clicked, this, &BugzillaDuplicatesPage::searchMore); - - m_retrySearchGuiItem = KGuiItem2(i18nc("@action:button", "Retry search"), - QIcon::fromTheme(QStringLiteral("edit-find")), - i18nc("@info:tooltip", "Use this button to " - "retry the search that previously " - "failed.")); - - KGuiItem::assign(ui.m_openReportButton, KGuiItem2(i18nc("@action:button", "Open selected report"), - QIcon::fromTheme(QStringLiteral("document-preview")), - i18nc("@info:tooltip", "Use this button to view " - "the information of the selected bug report."))); - connect(ui.m_openReportButton, &QAbstractButton::clicked, this, &BugzillaDuplicatesPage::openSelectedReport); - - KGuiItem::assign(ui.m_stopSearchButton, KGuiItem2(i18nc("@action:button", "Stop searching"), - QIcon::fromTheme(QStringLiteral("process-stop")), - i18nc("@info:tooltip", "Use this button to stop " - "the current search."))); - ui.m_stopSearchButton->setText(QString()); //FIXME - connect(ui.m_stopSearchButton, &QAbstractButton::clicked, this, &BugzillaDuplicatesPage::stopCurrentSearch); - - //Possible duplicates list and buttons - connect(ui.m_selectedDuplicatesList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), - this, SLOT(itemClicked(QListWidgetItem*))); - connect(ui.m_selectedDuplicatesList, &QListWidget::itemSelectionChanged, - this, &BugzillaDuplicatesPage::possibleDuplicateSelectionChanged); - - KGuiItem::assign(ui.m_removeSelectedDuplicateButton, - KGuiItem2(i18nc("@action:button remove the selected item from a list", "Remove"), - QIcon::fromTheme(QStringLiteral("list-remove")), - i18nc("@info:tooltip", "Use this button to remove a selected possible duplicate"))); - ui.m_removeSelectedDuplicateButton->setEnabled(false); - connect(ui.m_removeSelectedDuplicateButton, &QAbstractButton::clicked, this, - &BugzillaDuplicatesPage::removeSelectedDuplicate); - - ui.m_attachToReportIcon->setPixmap(QIcon::fromTheme(QStringLiteral("mail-attachment")).pixmap(16,16)); - ui.m_attachToReportIcon->setFixedSize(16,16); - ui.m_attachToReportIcon->setVisible(false); - ui.m_attachToReportLabel->setVisible(false); - ui.m_attachToReportLabel->setContextMenuPolicy(Qt::NoContextMenu); - connect(ui.m_attachToReportLabel, &QLabel::linkActivated, this, - &BugzillaDuplicatesPage::cancelAttachToBugReport); - ui.information->setContextMenuPolicy(Qt::NoContextMenu); - connect(ui.information, &QLabel::linkActivated, this, &BugzillaDuplicatesPage::informationClicked); - showDuplicatesPanel(false); -} - -BugzillaDuplicatesPage::~BugzillaDuplicatesPage() -{ -} - -void BugzillaDuplicatesPage::aboutToShow() -{ - //Perform initial search if we are not currently searching and if there are no results yet - if (!m_searching && ui.m_bugListWidget->topLevelItemCount() == 1 && canSearchMore()) { - searchMore(); - } -} - -void BugzillaDuplicatesPage::aboutToHide() -{ - stopCurrentSearch(); - - //Save selected possible duplicates by user - QStringList possibleDuplicates; - int count = ui.m_selectedDuplicatesList->count(); - for(int i = 0; iitem(i)->text(); - } - reportInterface()->setPossibleDuplicates(possibleDuplicates); - - //Save possible duplicates by query - QStringList duplicatesByQuery; - count = ui.m_bugListWidget->topLevelItemCount(); - for(int i = 1; itopLevelItem(i)->text(0); - } - reportInterface()->setPossibleDuplicatesByQuery(duplicatesByQuery); -} - -bool BugzillaDuplicatesPage::isComplete() -{ - return !m_searching; -} - -bool BugzillaDuplicatesPage::showNextPage() -{ - //Ask the user to check all the possible duplicates... - if (ui.m_bugListWidget->topLevelItemCount() != 1 && ui.m_selectedDuplicatesList->count() == 0 - && reportInterface()->attachToBugNumber() == 0 && !m_foundDuplicate) { - //The user didn't selected any possible duplicate nor a report to attach the new info. - //Double check this, we need to reduce the duplicate count. - KGuiItem noDuplicatesButton; - noDuplicatesButton.setText(i18n("There are no real duplicates")); - noDuplicatesButton.setWhatsThis(i18n("Press this button to declare that, in your opinion " - "and according to your experience, the reports found " - "as similar do not match the crash you have " - "experienced, and you believe it is unlikely that a " - "better match would be found after further review.")); - noDuplicatesButton.setIcon(QIcon::fromTheme(QStringLiteral("dialog-cancel"))); - - KGuiItem letMeCheckMoreReportsButton; - letMeCheckMoreReportsButton.setText(i18n("Let me check more reports")); - letMeCheckMoreReportsButton.setWhatsThis(i18n("Press this button if you would rather " - "review more reports in order to find a " - "match for the crash you have experienced.")); - letMeCheckMoreReportsButton.setIcon(QIcon::fromTheme(QStringLiteral("document-preview"))); - - if (KMessageBox::questionYesNo(this, - i18nc("@info","You have not selected any possible duplicates, or a report to which to attach your " - "crash information. Have you read all the reports, and can you confirm that there are no " - "real duplicates?"), - i18nc("@title:window","No selected possible duplicates"), letMeCheckMoreReportsButton, - noDuplicatesButton) - == KMessageBox::Yes) { - return false; - } - } - return true; -} - -//BEGIN Search related methods -void BugzillaDuplicatesPage::searchMore() -{ - //1 year back - m_searchingEndDate = m_startDate; - m_searchingStartDate = m_searchingEndDate.addYears(-1); - - performSearch(); -} - -void BugzillaDuplicatesPage::performSearch() -{ - markAsSearching(true); - - QString startDateStr = m_searchingStartDate.toString(QStringLiteral("yyyy-MM-dd")); - QString endDateStr = m_searchingEndDate.toString(QStringLiteral("yyyy-MM-dd")); - - ui.m_statusWidget->setBusy(i18nc("@info:status","Searching for duplicates (from %1 to %2)...", - startDateStr, endDateStr)); - - //Bugzilla will not search on Today bugs if we send the date. - //we need to send "Now" - if (m_searchingEndDate == QDate::currentDate()) { - endDateStr = QLatin1String("Now"); - } - -#if 1 - BugReport report = reportInterface()->newBugReportTemplate(); - bugzillaManager()->searchBugs(reportInterface()->relatedBugzillaProducts(), - report.bugSeverity(), startDateStr, endDateStr, - reportInterface()->firstBacktraceFunctions().join(QStringLiteral(" "))); -#else //Test search - bugzillaManager()->searchBugs(QStringList() << "plasma", "crash", startDateStr, endDateStr, - "QGraphicsScenePrivate::processDirtyItemsRecursive"); -#endif -} - -void BugzillaDuplicatesPage::stopCurrentSearch() -{ - if (m_searching) { - bugzillaManager()->stopCurrentSearch(); - - markAsSearching(false); - - if (m_startDate==m_endDate) { //Never searched - ui.m_statusWidget->setIdle(i18nc("@info:status","Search stopped.")); - } else { - ui.m_statusWidget->setIdle(i18nc("@info:status","Search stopped. Showing results from " - "%1 to %2", m_startDate.toString(QStringLiteral("yyyy-MM-dd")), - m_endDate.toString(QStringLiteral("yyyy-MM-dd")))); - } - } -} - -void BugzillaDuplicatesPage::markAsSearching(bool searching) -{ - m_searching = searching; - emitCompleteChanged(); - - ui.m_bugListWidget->setEnabled(!searching); - ui.m_searchMoreButton->setEnabled(!searching); - ui.m_searchMoreButton->setVisible(!searching); - ui.m_stopSearchButton->setEnabled(searching); - ui.m_stopSearchButton->setVisible(searching); - - ui.m_selectedDuplicatesList->setEnabled(!searching); - ui.m_selectedPossibleDuplicatesLabel->setEnabled(!searching); - ui.m_removeSelectedDuplicateButton->setEnabled(!searching && - !ui.m_selectedDuplicatesList->selectedItems().isEmpty()); - - ui.m_attachToReportLabel->setEnabled(!searching); - - if (!searching) { - itemSelectionChanged(); - } else { - ui.m_openReportButton->setEnabled(false); - } -} - -bool BugzillaDuplicatesPage::canSearchMore() -{ - return (m_startDate.year() >= 2009); -} - -void BugzillaDuplicatesPage::searchFinished(const BugMapList & list) -{ - KGuiItem::assign(ui.m_searchMoreButton, m_searchMoreGuiItem); - m_startDate = m_searchingStartDate; - - int results = list.count(); - if (results > 0) { - markAsSearching(false); - - ui.m_statusWidget->setIdle(i18nc("@info:status","Showing results from %1 to %2", - m_startDate.toString(QStringLiteral("yyyy-MM-dd")), - m_endDate.toString(QStringLiteral("yyyy-MM-dd")))); - - QList bugIds; - for (int i = 0; i < results; i++) { - BugMap bug = list.at(i); - - bool ok; - int bugId = bug.value(QStringLiteral("bug_id")).toInt(&ok); - if (ok) { - bugIds << bugId; - } - - QString title; - - //Generate a non-geek readable status - QString customStatusString; - BugReport::Status status = BugReport::parseStatus(bug.value(QStringLiteral("bug_status"))); - BugReport::Resolution resolution = BugReport::parseResolution(bug.value(QStringLiteral("resolution"))); - if (BugReport::isOpen(status)) { - customStatusString = i18nc("@info bug status", "[Open]"); - } else if (BugReport::isClosed(status) && status != BugReport::NeedsInfo) { - if (resolution == BugReport::Fixed) { - customStatusString = i18nc("@info bug resolution", "[Fixed]"); - } else if (resolution == BugReport::WorksForMe) { - customStatusString = i18nc("@info bug resolution", "[Non-reproducible]"); - } else if (resolution == BugReport::Duplicate) { - customStatusString = i18nc("@info bug resolution", "[Duplicate report]"); - } else if (resolution == BugReport::Invalid) { - customStatusString = i18nc("@info bug resolution", "[Invalid]"); - } else if (resolution == BugReport::Downstream - || resolution == BugReport::Upstream) { - customStatusString = i18nc("@info bug resolution", "[External problem]"); - } - } else if (status == BugReport::NeedsInfo) { - customStatusString = i18nc("@info bug status", "[Incomplete]"); - } - - title = customStatusString + ' ' + bug[QStringLiteral("short_desc")]; - - QStringList fields = QStringList() << bug[QStringLiteral("bug_id")] << title; - - QTreeWidgetItem * item = new QTreeWidgetItem(fields); - item->setToolTip(0, bug[QStringLiteral("short_desc")]); - item->setToolTip(1, bug[QStringLiteral("short_desc")]); - - ui.m_bugListWidget->addTopLevelItem(item); - } - - if (!m_foundDuplicate) { - markAsSearching(true); - DuplicateFinderJob *job = new DuplicateFinderJob(bugIds, bugzillaManager(), this); - connect(job, SIGNAL(result(KJob*)), this, SLOT(analyzedDuplicates(KJob*))); - job->start(); - } - - ui.m_bugListWidget->sortItems(0 , Qt::DescendingOrder); - ui.m_bugListWidget->resizeColumnToContents(1); - - if (!canSearchMore()) { - ui.m_searchMoreButton->setEnabled(false); - } - - } else { - - if (canSearchMore()) { - //We don't call markAsSearching(false) to avoid flicker - //Delayed call to searchMore to avoid unexpected behaviour (signal/slot) - //because we are in a slot, and searchMore() will be ending calling this slot again - QTimer::singleShot(0, this, &BugzillaDuplicatesPage::searchMore); - } else { - markAsSearching(false); - ui.m_statusWidget->setIdle(i18nc("@info:status","Search Finished. " - "No reports found.")); - ui.m_searchMoreButton->setEnabled(false); - if (ui.m_bugListWidget->topLevelItemCount() == 0) { - //No reports to mark as possible duplicate - ui.m_selectedDuplicatesList->setEnabled(false); - } - } - } -} - -void BugzillaDuplicatesPage::analyzedDuplicates(KJob *j) -{ - markAsSearching(false); - - DuplicateFinderJob *job = static_cast(j); - m_result = job->result(); - m_foundDuplicate = m_result.parentDuplicate; - reportInterface()->setDuplicateId(m_result.parentDuplicate); - ui.m_searchMoreButton->setEnabled(!m_foundDuplicate); - ui.information->setVisible(m_foundDuplicate); - BugReport::Status status = m_result.status; - const int duplicate = m_result.duplicate; - const int parentDuplicate = m_result.parentDuplicate; - - if (m_foundDuplicate) { - const QList items = ui.m_bugListWidget->findItems(QString::number(parentDuplicate), Qt::MatchExactly, 0); - const QBrush brush = KColorScheme(QPalette::Active, KColorScheme::View).background(KColorScheme::NeutralBackground); - Q_FOREACH (QTreeWidgetItem* item, items) { - for (int i = 0; i < item->columnCount(); ++i) { - item->setBackground(i, brush); - } - } - - QString text; - if (BugReport::isOpen(status) || (BugReport::isClosed(status) && status == BugReport::NeedsInfo)) { - text = (parentDuplicate == duplicate ? i18nc("@label", "Your crash is a duplicate and has already been reported as
Bug %1.", QString::number(duplicate)) : - i18nc("@label", "Your crash has already been reported as Bug %1, which is a duplicate of Bug %2", QString::number(duplicate), QString::number(parentDuplicate))) + - '\n' + i18nc("@label", "Only attach if you can add needed information to the bug report.", QStringLiteral("attach")); - } else if (BugReport::isClosed(status)) { - text = (parentDuplicate == duplicate ? i18nc("@label", "Your crash has already been reported as Bug %1 which has been closed.", QString::number(duplicate)) : - i18nc("@label", "Your crash has already been reported as Bug %1, which is a duplicate of the closed Bug %2.", QString::number(duplicate), QString::number(parentDuplicate))); - } - ui.information->setText(text); - } -} - -void BugzillaDuplicatesPage::informationClicked(const QString &activatedLink) -{ - if (activatedLink == QLatin1String("attach")) { - attachToBugReport(m_result.parentDuplicate); - } else { - int number = activatedLink.toInt(); - if (number) { - showReportInformationDialog(number, false); - } - } -} - -void BugzillaDuplicatesPage::searchError(QString err) -{ - KGuiItem::assign(ui.m_searchMoreButton, m_retrySearchGuiItem); - markAsSearching(false); - - ui.m_statusWidget->setIdle(i18nc("@info:status","Error fetching the bug report list")); - - KMessageBox::error(this , xi18nc("@info/rich","Error fetching the bug report list" - "%1." - "Please wait some time and try again.", err)); -} - -void BugzillaDuplicatesPage::resetDates() -{ - m_endDate = QDate::currentDate(); - m_startDate = m_endDate; -} -//END Search related methods - -//BEGIN Duplicates list related methods -void BugzillaDuplicatesPage::openSelectedReport() -{ - QList selected = ui.m_bugListWidget->selectedItems(); - if (selected.count() == 1) { - itemClicked(selected.at(0), 0); - } -} - -void BugzillaDuplicatesPage::itemClicked(QTreeWidgetItem * item, int col) -{ - Q_UNUSED(col); - - int bugNumber = 0; - if (item->data(0, Qt::UserRole) == QLatin1String("custom")) { - bool ok = false; - bugNumber = QInputDialog::getInt(this, - i18nc("@title:window", "Enter a custom bug report number"), - i18nc("@label", "Enter the number of the bug report you want to check"), - 0, 0, 1000000, 1, &ok); - } else { - bugNumber = item->text(0).toInt(); - } - showReportInformationDialog(bugNumber); -} - -void BugzillaDuplicatesPage::itemClicked(QListWidgetItem * item) -{ - showReportInformationDialog(item->text().toInt()); -} - -void BugzillaDuplicatesPage::showReportInformationDialog(int bugNumber, bool relatedButtonEnabled) -{ - if (bugNumber <= 0) { - return; - } - - BugzillaReportInformationDialog * infoDialog = new BugzillaReportInformationDialog(this); - connect(infoDialog, &BugzillaReportInformationDialog::possibleDuplicateSelected, this, - &BugzillaDuplicatesPage::addPossibleDuplicateNumber); - connect(infoDialog, &BugzillaReportInformationDialog::attachToBugReportSelected, this, &BugzillaDuplicatesPage::attachToBugReport); - - infoDialog->showBugReport(bugNumber, relatedButtonEnabled); -} - -void BugzillaDuplicatesPage::itemSelectionChanged() -{ - ui.m_openReportButton->setEnabled(ui.m_bugListWidget->selectedItems().count() == 1); -} -//END Duplicates list related methods - -//BEGIN Selected duplicates list related methods -void BugzillaDuplicatesPage::addPossibleDuplicateNumber(int bugNumber) -{ - QString stringNumber = QString::number(bugNumber); - if (ui.m_selectedDuplicatesList->findItems(stringNumber, Qt::MatchExactly).isEmpty()) { - ui.m_selectedDuplicatesList->addItem(stringNumber); - } - - showDuplicatesPanel(true); -} - -void BugzillaDuplicatesPage::removeSelectedDuplicate() -{ - QList items = ui.m_selectedDuplicatesList->selectedItems(); - if (items.length() > 0) { - delete ui.m_selectedDuplicatesList->takeItem(ui.m_selectedDuplicatesList->row(items.at(0))); - } - - if (ui.m_selectedDuplicatesList->count() == 0) { - showDuplicatesPanel(false); - } -} - -void BugzillaDuplicatesPage::showDuplicatesPanel(bool show) -{ - ui.m_removeSelectedDuplicateButton->setVisible(show); - ui.m_selectedDuplicatesList->setVisible(show); - ui.m_selectedPossibleDuplicatesLabel->setVisible(show); -} - -void BugzillaDuplicatesPage::possibleDuplicateSelectionChanged() -{ - ui.m_removeSelectedDuplicateButton->setEnabled( - !ui.m_selectedDuplicatesList->selectedItems().isEmpty()); -} -//END Selected duplicates list related methods - -//BEGIN Attach to bug related methods -void BugzillaDuplicatesPage::attachToBugReport(int bugNumber) -{ - ui.m_attachToReportLabel->setText(xi18nc("@label", "The report is going to be " - "attached to bug %1. " - "Cancel", QString::number(bugNumber))); - ui.m_attachToReportLabel->setVisible(true); - ui.m_attachToReportIcon->setVisible(true); - reportInterface()->setAttachToBugNumber(bugNumber); -} - -void BugzillaDuplicatesPage::cancelAttachToBugReport() -{ - ui.m_attachToReportLabel->setVisible(false); - ui.m_attachToReportIcon->setVisible(false); - reportInterface()->setAttachToBugNumber(0); -} -//END Attach to bug related methods - -//END BugzillaDuplicatesPage - -//BEGIN BugzillaReportInformationDialog - -BugzillaReportInformationDialog::BugzillaReportInformationDialog(BugzillaDuplicatesPage * parent) : - QDialog(parent), - m_relatedButtonEnabled(true), - m_parent(parent), - m_bugNumber(0), - m_duplicatesCount(0) -{ - setWindowTitle(i18nc("@title:window","Bug Description")); - - ui.setupUi(this); - - KGuiItem::assign(ui.m_retryButton, KGuiItem2(i18nc("@action:button", "Retry..."), - QIcon::fromTheme(QStringLiteral("view-refresh")), - i18nc("@info:tooltip", "Use this button to retry " - "loading the bug report."))); - connect(ui.m_retryButton, &QPushButton::clicked, this, &BugzillaReportInformationDialog::reloadReport); - - m_suggestButton = new QPushButton(this); - ui.buttonBox->addButton(m_suggestButton, QDialogButtonBox::ActionRole); - KGuiItem::assign(m_suggestButton, - KGuiItem2(i18nc("@action:button", "Suggest this crash is related"), - QIcon::fromTheme(QStringLiteral("list-add")), i18nc("@info:tooltip", "Use this button to suggest that " - "the crash you experienced is related to this bug " - "report"))); - connect(m_suggestButton, &QPushButton::clicked, this, &BugzillaReportInformationDialog::relatedReportClicked); - - connect(ui.m_showOwnBacktraceCheckBox, &QAbstractButton::toggled, this, &BugzillaReportInformationDialog::toggleShowOwnBacktrace); - - //Connect bugzillalib signals - connect(m_parent->bugzillaManager(), &BugzillaManager::bugReportFetched, - this, &BugzillaReportInformationDialog::bugFetchFinished); - connect(m_parent->bugzillaManager(), SIGNAL(bugReportError(QString,QObject*)), - this, SLOT(bugFetchError(QString,QObject*))); - - resize(QSize(800, 600)); - KConfigGroup config(KSharedConfig::openConfig(), "BugzillaReportInformationDialog"); - KWindowConfig::restoreWindowSize(windowHandle(), config); -} - -BugzillaReportInformationDialog::~BugzillaReportInformationDialog() -{ - disconnect(m_parent->bugzillaManager(), &BugzillaManager::bugReportFetched, - this, &BugzillaReportInformationDialog::bugFetchFinished); - disconnect(m_parent->bugzillaManager(), SIGNAL(bugReportError(QString,QObject*)), - this, SLOT(bugFetchError(QString,QObject*))); - - KConfigGroup config(KSharedConfig::openConfig(), "BugzillaReportInformationDialog"); - KWindowConfig::saveWindowSize(windowHandle(), config); -} - -void BugzillaReportInformationDialog::reloadReport() -{ - showBugReport(m_bugNumber); -} - -void BugzillaReportInformationDialog::showBugReport(int bugNumber, bool relatedButtonEnabled) -{ - m_relatedButtonEnabled = relatedButtonEnabled; - ui.m_retryButton->setVisible(false); - - m_closedStateString.clear(); - m_bugNumber = bugNumber; - m_parent->bugzillaManager()->fetchBugReport(m_bugNumber, this); - - m_suggestButton->setEnabled(false); - m_suggestButton->setVisible(m_relatedButtonEnabled); - - ui.m_infoBrowser->setText(i18nc("@info:status","Loading...")); - ui.m_infoBrowser->setEnabled(false); - - ui.m_linkLabel->setText(xi18nc("@info","Report's webpage", - m_parent->bugzillaManager()->urlForBug(m_bugNumber))); - - ui.m_statusWidget->setBusy(xi18nc("@info:status","Loading information about bug " - "%1 from %2....", - QString::number(m_bugNumber), - QLatin1String(KDE_BUGZILLA_SHORT_URL))); - - ui.m_backtraceBrowser->setPlainText( - i18nc("@info","Backtrace of the crash I experienced:\n\n") + - m_parent->reportInterface()->backtrace()); - - KConfigGroup config(KSharedConfig::openConfig(), "BugzillaReportInformationDialog"); - bool showOwnBacktrace = config.readEntry("ShowOwnBacktrace", false); - ui.m_showOwnBacktraceCheckBox->setChecked(showOwnBacktrace); - if (!showOwnBacktrace) { //setChecked(false) will not emit toggled(false) - toggleShowOwnBacktrace(false); - } - - show(); -} - -void BugzillaReportInformationDialog::bugFetchFinished(BugReport report, QObject * jobOwner) -{ - if (jobOwner == this && isVisible()) { - if (report.isValid()) { - - //Handle duplicate state - QString duplicate = report.markedAsDuplicateOf(); - if (!duplicate.isEmpty()) { - bool ok = false; - int dupId = duplicate.toInt(&ok); - if (ok && dupId > 0) { - ui.m_statusWidget->setIdle(QString()); - - KGuiItem yesItem = KStandardGuiItem::yes(); - yesItem.setText(i18nc("@action:button let the user to choose to read the " - "main report", "Yes, read the main report")); - - KGuiItem noItem = KStandardGuiItem::no(); - noItem.setText(i18nc("@action:button let the user choose to read the original " - "report", "No, let me read the report I selected")); - - if (KMessageBox::questionYesNo(this, - xi18nc("@info","The report you selected (bug %1) is already " - "marked as duplicate of bug %2. " - "Do you want to read that report instead? (recommended)", - report.bugNumber(), QString::number(dupId)), - i18nc("@title:window","Nested duplicate detected"), yesItem, noItem) - == KMessageBox::Yes) { - showBugReport(dupId); - return; - } - } - } - - //Generate html for comments (with proper numbering) - QLatin1String duplicatesMark = QLatin1String("has been marked as a duplicate of this bug."); - - QString comments; - QStringList commentList = report.comments(); - for (int i = 0; i < commentList.count(); i++) { - QString comment = commentList.at(i); - //Don't add duplicates mark comments - if (!comment.contains(duplicatesMark)) { - comment.replace('\n', QLatin1String("
")); - comments += i18nc("comment $number to use as subtitle", "

Comment %1:

", (i+1)) - + "

" + comment + "


"; - //Count the inline attached crashes (DrKonqi feature) - QLatin1String attachedCrashMark = - QLatin1String("New crash information added by DrKonqi"); - if (comment.contains(attachedCrashMark)) { - m_duplicatesCount++; - } - } else { - //Count duplicate - m_duplicatesCount++; - } - } - - //Generate a non-geek readable status - QString customStatusString; - BugReport::Status status = report.statusValue(); - BugReport::Resolution resolution = report.resolutionValue(); - if (status == BugReport::Unconfirmed) { - customStatusString = i18nc("@info bug status", "Opened (Unconfirmed)"); - } else if (report.isOpen()) { - customStatusString = i18nc("@info bug status", "Opened (Unfixed)"); - } else if (report.isClosed() && status != BugReport::NeedsInfo) { - QString customResolutionString; - if (resolution == BugReport::Fixed) { - if (!report.versionFixedIn().isEmpty()) { - customResolutionString = i18nc("@info bug resolution, fixed in version", - "Fixed in version \"%1\"", - report.versionFixedIn()); - m_closedStateString = i18nc("@info bug resolution, fixed by kde devs in version", - "the bug was fixed by KDE developers in version \"%1\"", - report.versionFixedIn()); - } else { - customResolutionString = i18nc("@info bug resolution", "Fixed"); - m_closedStateString = i18nc("@info bug resolution", "the bug was fixed by KDE developers"); - } - } else if (resolution == BugReport::WorksForMe) { - customResolutionString = i18nc("@info bug resolution", "Non-reproducible"); - } else if (resolution == BugReport::Duplicate) { - customResolutionString = i18nc("@info bug resolution", "Duplicate report " - "(Already reported before)"); - } else if (resolution == BugReport::Invalid) { - customResolutionString = i18nc("@info bug resolution", "Not a valid report/crash"); - } else if (resolution == BugReport::Downstream || resolution == BugReport::Upstream) { - customResolutionString = i18nc("@info bug resolution", "Not caused by a problem " - "in the KDE's Applications or libraries"); - m_closedStateString = i18nc("@info bug resolution", "the bug is caused by a " - "problem in an external application or library, or " - "by a distribution or packaging issue"); - } else { - customResolutionString = report.resolution(); - } - - customStatusString = i18nc("@info bug status, %1 is the resolution", "Closed (%1)", - customResolutionString); - } else if (status == BugReport::NeedsInfo) { - customStatusString = i18nc("@info bug status", "Temporarily closed, because of a lack " - "of information"); - } else { //Fallback to other raw values - customStatusString = QStringLiteral("%1 (%2)").arg(report.bugStatus(), report.resolution()); - } - - //Generate notes - QString notes = xi18n("

The bug report's title is often written by its reporter " - "and may not reflect the bug's nature, root cause or other visible " - "symptoms you could use to compare to your crash. Please read the " - "complete report and all the comments below.

"); - - if (m_duplicatesCount >= 10) { //Consider a possible mass duplicate crash - notes += xi18np("

This bug report has %1 duplicate report. That means this " - "is probably a common crash. Please consider only " - "adding a comment or a note if you can provide new valuable " - "information which was not already mentioned.

", - "

This bug report has %1 duplicate reports. That means this " - "is probably a common crash. Please consider only " - "adding a comment or a note if you can provide new valuable " - "information which was not already mentioned.

", - m_duplicatesCount); - } - - //A manually entered bug ID could represent a normal bug - if (report.bugSeverity() != QLatin1String("crash") - && report.bugSeverity() != QLatin1String("major") - && report.bugSeverity() != QLatin1String("grave") - && report.bugSeverity() != QLatin1String("critical")) - { - notes += xi18n("

This bug report is not about a crash or about any other " - "critical bug.

"); - } - - //Generate HTML text - QString text = - i18nc("@info bug report title (quoted)", - "

\"%1\"

", report.shortDescription()) + - notes + - i18nc("@info bug report status", - "

Bug Report Status: %1

", customStatusString) + - i18nc("@info bug report product and component", - "

Affected Component: %1 (%2)

", - report.product(), report.component()) + - i18nc("@info bug report description", - "

Description of the bug

%1

", - report.description().replace('\n', QLatin1String("
"))); - - if (!comments.isEmpty()) { - text += i18nc("@label:textbox bug report comments (already formatted)", - "

Additional Comments

%1", comments); - } - - ui.m_infoBrowser->setText(text); - ui.m_infoBrowser->setEnabled(true); - - m_suggestButton->setEnabled(m_relatedButtonEnabled); - m_suggestButton->setVisible(m_relatedButtonEnabled); - - ui.m_statusWidget->setIdle(xi18nc("@info:status", "Showing bug %1", - QString::number(report.bugNumberAsInt()))); - } else { - bugFetchError(i18nc("@info", "Invalid report information (malformed data). This could " - "mean that the bug report does not exist, or the bug tracking site " - "is experiencing a problem."), this); - } - } -} - -void BugzillaReportInformationDialog::markAsDuplicate() -{ - emit possibleDuplicateSelected(m_bugNumber); - hide(); -} - -void BugzillaReportInformationDialog::attachToBugReport() -{ - emit attachToBugReportSelected(m_bugNumber); - hide(); -} - -void BugzillaReportInformationDialog::cancelAssistant() -{ - m_parent->assistant()->close(); - hide(); -} - -void BugzillaReportInformationDialog::relatedReportClicked() -{ - BugzillaReportConfirmationDialog * confirmation = - new BugzillaReportConfirmationDialog(m_bugNumber, (m_duplicatesCount >= 10), - m_closedStateString, this); - confirmation->show(); -} - -void BugzillaReportInformationDialog::bugFetchError(QString err, QObject * jobOwner) -{ - if (jobOwner == this && isVisible()) { - KMessageBox::error(this , xi18nc("@info/rich","Error fetching the bug report" - "%1." - "Please wait some time and try again.", err)); - m_suggestButton->setEnabled(false); - ui.m_infoBrowser->setText(i18nc("@info","Error fetching the bug report")); - ui.m_statusWidget->setIdle(i18nc("@info:status","Error fetching the bug report")); - ui.m_retryButton->setVisible(true); - } -} - -void BugzillaReportInformationDialog::toggleShowOwnBacktrace(bool show) -{ - QList sizes; - if (show) { - int size = (ui.m_reportSplitter->sizeHint().width()-ui.m_reportSplitter->handleWidth())/2; - sizes << size << size; - } else { - sizes << ui.m_reportSplitter->sizeHint().width() << 0; //Hide backtrace - } - ui.m_reportSplitter->setSizes(sizes); - - //Save the current show value - KConfigGroup config(KSharedConfig::openConfig(), "BugzillaReportInformationDialog"); - config.writeEntry("ShowOwnBacktrace", show); -} - -//END BugzillaReportInformationDialog - -//BEGIN BugzillaReportConfirmationDialog - -BugzillaReportConfirmationDialog::BugzillaReportConfirmationDialog(int bugNumber, bool commonCrash, - QString closedState, BugzillaReportInformationDialog * parent) - : QDialog(parent), - m_parent(parent), - m_showProceedQuestion(false), - m_bugNumber(bugNumber) -{ - setAttribute(Qt::WA_DeleteOnClose, true); - setModal(true); - - ui.setupUi(this); - - //Setup dialog - setWindowTitle(i18nc("@title:window", "Related Bug Report")); - - //Setup buttons - ui.buttonBox->button(QDialogButtonBox::Cancel)->setText(i18nc("@action:button", "Cancel (Go back to the report)")); - ui.buttonBox->button(QDialogButtonBox::Ok)->setText(i18nc("@action:button continue with the selected option " - "and close the dialog", "Continue")); - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); - - connect(this, &BugzillaReportConfirmationDialog::accepted, - this, &BugzillaReportConfirmationDialog::proceedClicked); - connect(this, &BugzillaReportConfirmationDialog::rejected, - this, &BugzillaReportConfirmationDialog::hide); - - //Set introduction text - ui.introLabel->setText(i18n("You are going to mark your crash as related to bug %1", - QString::number(m_bugNumber))); - - if (commonCrash) { //Common ("massive") crash - m_showProceedQuestion = true; - ui.commonCrashIcon->setPixmap(QIcon::fromTheme(QStringLiteral("edit-bomb")).pixmap(22,22)); - } else { - ui.commonCrashLabel->setVisible(false); - ui.commonCrashIcon->setVisible(false); - } - - if (!closedState.isEmpty()) { //Bug report closed - ui.closedReportLabel->setText( - i18nc("@info", "The report is closed because %1. " - "If the crash is the same, adding further information will be useless " - "and will consume developers' time.", - closedState)); - ui.closedReportIcon->setPixmap(QIcon::fromTheme(QStringLiteral("document-close")).pixmap(22,22)); - m_showProceedQuestion = true; - } else { - ui.closedReportLabel->setVisible(false); - ui.closedReportIcon->setVisible(false); - } - - //Disable all the radio buttons - ui.proceedRadioYes->setChecked(false); - ui.proceedRadioNo->setChecked(false); - ui.markAsDuplicateCheck->setChecked(false); - ui.attachToBugReportCheck->setChecked(false); - - connect(ui.buttonGroupProceed, SIGNAL(buttonClicked(int)), this, SLOT(checkProceed())); - connect(ui.buttonGroupProceedQuestion, SIGNAL(buttonClicked(int)), this, SLOT(checkProceed())); - // Also listen to toggle so radio buttons are covered. - connect(ui.buttonGroupProceed, static_cast(&QButtonGroup::buttonToggled), - this, &BugzillaReportConfirmationDialog::checkProceed); - connect(ui.buttonGroupProceedQuestion, static_cast(&QButtonGroup::buttonToggled), - this, &BugzillaReportConfirmationDialog::checkProceed); - - if (!m_showProceedQuestion) { - ui.proceedLabel->setEnabled(false); - ui.proceedRadioYes->setEnabled(false); - ui.proceedRadioNo->setEnabled(false); - - ui.proceedLabel->setVisible(false); - ui.proceedRadioYes->setVisible(false); - ui.proceedRadioNo->setVisible(false); - - ui.proceedRadioYes->setChecked(true); - } - - checkProceed(); - - setMinimumSize(QSize(600, 350)); - resize(QSize(600, 350)); -} - -BugzillaReportConfirmationDialog::~BugzillaReportConfirmationDialog() -{ -} - -void BugzillaReportConfirmationDialog::checkProceed() -{ - bool yes = ui.proceedRadioYes->isChecked(); - bool no = ui.proceedRadioNo->isChecked(); - - //Enable/disable labels and controls - ui.areYouSureLabel->setEnabled(yes); - ui.markAsDuplicateCheck->setEnabled(yes); - ui.attachToBugReportCheck->setEnabled(yes); - - //Enable Continue button if valid options are selected - bool possibleDupe = ui.markAsDuplicateCheck->isChecked(); - bool attach = ui.attachToBugReportCheck->isChecked(); - bool enableContinueButton = yes ? (possibleDupe || attach) : no; - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(enableContinueButton); -} - -void BugzillaReportConfirmationDialog::proceedClicked() -{ - if (ui.proceedRadioYes->isChecked()) { - if (ui.markAsDuplicateCheck->isChecked()) { - m_parent->markAsDuplicate(); - hide(); - } else { - m_parent->attachToBugReport(); - hide(); - } - } else { - hide(); - m_parent->cancelAssistant(); - } -} - -//END BugzillaReportConfirmationDialog diff --git a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla_duplicates.h b/drkonqi/bugzillaintegration/reportassistantpages_bugzilla_duplicates.h deleted file mode 100644 index cd66e7b9e..000000000 --- a/drkonqi/bugzillaintegration/reportassistantpages_bugzilla_duplicates.h +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************* -* reportassistantpages_bugzilla_duplicates.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef REPORTASSISTANTPAGES__BUGZILLA__DUPLICATES_H -#define REPORTASSISTANTPAGES__BUGZILLA__DUPLICATES_H - -#include "reportassistantpage.h" - -#include "duplicatefinderjob.h" -#include "bugzillalib.h" - -#include "ui_assistantpage_bugzilla_duplicates.h" -#include "ui_assistantpage_bugzilla_duplicates_dialog.h" -#include "ui_assistantpage_bugzilla_duplicates_dialog_confirmation.h" -#include -#include -#include - -class QDate; -class QTreeWidgetItem; - -class KGuiItem; - -class BugzillaReportInformationDialog; - -/** Searching for duplicates and showing report information page**/ -class BugzillaDuplicatesPage : public ReportAssistantPage -{ - Q_OBJECT - -public: - explicit BugzillaDuplicatesPage(ReportAssistantDialog *); - ~BugzillaDuplicatesPage() override; - - void aboutToShow() override; - void aboutToHide() override; - - bool isComplete() override; - bool showNextPage() override; - -private Q_SLOTS: - /* Search related methods */ - void searchMore(); - void performSearch(); - void stopCurrentSearch(); - - void markAsSearching(bool); - - bool canSearchMore(); - - void searchFinished(const BugMapList&); - void searchError(QString); - void analyzedDuplicates(KJob *job); - - void resetDates(); - - /* Duplicates list related methods */ - void openSelectedReport(); - void itemClicked(QTreeWidgetItem *, int); - void itemClicked(QListWidgetItem *); - void showReportInformationDialog(int, bool relatedButtonEnabled = true); - void itemSelectionChanged(); - - /* Selected duplicates list related methods */ - void addPossibleDuplicateNumber(int); - void removeSelectedDuplicate(); - - void showDuplicatesPanel(bool); - - void possibleDuplicateSelectionChanged(); - - /* Attach to bug related methods */ - void attachToBugReport(int); - void cancelAttachToBugReport(); - void informationClicked(const QString &activatedLink); - -private: - bool m_searching; - bool m_foundDuplicate; - - Ui::AssistantPageBugzillaDuplicates ui; - - //Dates of current Results - QDate m_startDate; - QDate m_endDate; - //Dates of searching process - QDate m_searchingStartDate; - QDate m_searchingEndDate; - - KGuiItem m_searchMoreGuiItem; - KGuiItem m_retrySearchGuiItem; - DuplicateFinderJob::Result m_result; -}; - -/** Internal bug-info dialog **/ -class BugzillaReportInformationDialog : public QDialog -{ - Q_OBJECT - -public: - explicit BugzillaReportInformationDialog(BugzillaDuplicatesPage*parent=0); - ~BugzillaReportInformationDialog() override; - - void showBugReport(int bugNumber, bool relatedButtonEnabled = true); - - void markAsDuplicate(); - void attachToBugReport(); - void cancelAssistant(); - -private Q_SLOTS: - void bugFetchFinished(BugReport,QObject *); - void bugFetchError(QString, QObject *); - - void reloadReport(); - - void relatedReportClicked(); - - void toggleShowOwnBacktrace(bool); - -Q_SIGNALS: - void possibleDuplicateSelected(int); - void attachToBugReportSelected(int); - -private: - Ui::AssistantPageBugzillaDuplicatesDialog ui; - bool m_relatedButtonEnabled; - BugzillaDuplicatesPage * m_parent; - - int m_bugNumber; - QString m_closedStateString; - int m_duplicatesCount; - QPushButton* m_suggestButton; -}; - -class BugzillaReportConfirmationDialog : public QDialog -{ - Q_OBJECT - -public: - BugzillaReportConfirmationDialog(int bugNumber, bool commonCrash, QString closedState, - BugzillaReportInformationDialog * parent); - ~BugzillaReportConfirmationDialog() override; - -private Q_SLOTS: - void proceedClicked(); - - void checkProceed(); - -private: - Ui::ConfirmationDialog ui; - - BugzillaReportInformationDialog * m_parent; - - bool m_showProceedQuestion; - - int m_bugNumber; -}; -#endif diff --git a/drkonqi/bugzillaintegration/reportinterface.cpp b/drkonqi/bugzillaintegration/reportinterface.cpp deleted file mode 100644 index 7033bcc28..000000000 --- a/drkonqi/bugzillaintegration/reportinterface.cpp +++ /dev/null @@ -1,448 +0,0 @@ -/******************************************************************* -* reportinterface.cpp -* Copyright 2009,2010, 2011 Dario Andres Rodriguez -* Copyright 2009 George Kiagiadakis -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "reportinterface.h" - -#include - -#include "drkonqi.h" -#include "bugzillalib.h" -#include "productmapping.h" -#include "systeminformation.h" -#include "crashedapplication.h" -#include "debuggermanager.h" -#include "parser/backtraceparser.h" -#include "backtracegenerator.h" -#include "applicationdetailsexamples.h" - -ReportInterface::ReportInterface(QObject *parent) - : QObject(parent), - m_duplicate(0) -{ - m_bugzillaManager = new BugzillaManager(KDE_BUGZILLA_URL, this); - - m_productMapping = new ProductMapping(DrKonqi::crashedApplication(), m_bugzillaManager, this); - - m_appDetailsExamples = new ApplicationDetailsExamples(this); - - //Information the user can provide about the crash - m_userRememberCrashSituation = false; - m_reproducible = ReproducibleUnsure; - m_provideActionsApplicationDesktop = false; - m_provideUnusualBehavior = false; - m_provideApplicationConfigurationDetails = false; - - //Do not attach the bug report to any other existent report (create a new one) - m_attachToBugNumber = 0; -} - -void ReportInterface::setBugAwarenessPageData(bool rememberSituation, - Reproducible reproducible, bool actions, - bool unusual, bool configuration) -{ - //Save the information the user can provide about the crash from the assistant page - m_userRememberCrashSituation = rememberSituation; - m_reproducible = reproducible; - m_provideActionsApplicationDesktop = actions; - m_provideUnusualBehavior = unusual; - m_provideApplicationConfigurationDetails = configuration; -} - -bool ReportInterface::isBugAwarenessPageDataUseful() const -{ - //Determine if the assistant should proceed, considering the amount of information - //the user can provide - int rating = selectedOptionsRating(); - - //Minimum information required even for a good backtrace. - bool useful = m_userRememberCrashSituation && - (rating >= 2 || (m_reproducible==ReproducibleSometimes || - m_reproducible==ReproducibleEverytime)); - return useful; -} - -int ReportInterface::selectedOptionsRating() const -{ - //Check how many information the user can provide and generate a rating - int rating = 0; - if (m_provideActionsApplicationDesktop) { - rating += 3; - } - if (m_provideApplicationConfigurationDetails) { - rating += 2; - } - if (m_provideUnusualBehavior) { - rating += 1; - } - return rating; -} - -QString ReportInterface::backtrace() const -{ - return m_backtrace; -} - -void ReportInterface::setBacktrace(const QString & backtrace) -{ - m_backtrace = backtrace; -} - -QStringList ReportInterface::firstBacktraceFunctions() const -{ - return m_firstBacktraceFunctions; -} - -void ReportInterface::setFirstBacktraceFunctions(const QStringList & functions) -{ - m_firstBacktraceFunctions = functions; -} - -QString ReportInterface::title() const -{ - return m_reportTitle; -} - -void ReportInterface::setTitle(const QString & text) -{ - m_reportTitle = text; -} - -void ReportInterface::setDetailText(const QString & text) -{ - m_reportDetailText = text; -} - -void ReportInterface::setPossibleDuplicates(const QStringList & list) -{ - m_possibleDuplicates = list; -} - -QString ReportInterface::generateReportFullText(bool drKonqiStamp) const -{ - //Note: no translations should be done in this function's strings - - const CrashedApplication * crashedApp = DrKonqi::crashedApplication(); - const SystemInformation * sysInfo = DrKonqi::systemInformation(); - - QString report; - - //Program name and versions - report.append(QStringLiteral("Application: %1 (%2)\n").arg(crashedApp->fakeExecutableBaseName(), - crashedApp->version())); - if ( sysInfo->compiledSources() ) { - report.append(QStringLiteral(" (Compiled from sources)\n")); - } else { - report.append(QStringLiteral("\n")); - } - report.append(QStringLiteral("Qt Version: %1\n").arg(sysInfo->qtVersion())); - report.append(QStringLiteral("Frameworks Version: %1\n").arg(sysInfo->frameworksVersion())); - - report.append(QStringLiteral("Operating System: %1\n").arg(sysInfo->operatingSystem())); - - //LSB output or manually selected distro - if ( !sysInfo->lsbRelease().isEmpty() ) { - report.append(QStringLiteral("Distribution: %1\n").arg(sysInfo->lsbRelease())); - } else if ( !sysInfo->bugzillaPlatform().isEmpty() && - sysInfo->bugzillaPlatform() != QLatin1String("unspecified")) { - report.append(QStringLiteral("Distribution (Platform): %1\n").arg( - sysInfo->bugzillaPlatform())); - } - report.append(QLatin1Char('\n')); - - //Details of the crash situation - if (isBugAwarenessPageDataUseful()) { - report.append(QStringLiteral("-- Information about the crash:\n")); - if (!m_reportDetailText.isEmpty()) { - report.append(m_reportDetailText.trimmed()); - } else { - //If the user manual reports this crash, he/she should know what to put in here. - //This message is the only one translated in this function - report.append(xi18nc("@info/plain","In detail, tell us what you were doing " - " when the application crashed.")); - } - report.append(QLatin1String("\n\n")); - } - - //Crash reproducibility (only if useful) - if (m_reproducible != ReproducibleUnsure) { - if (m_reproducible == ReproducibleEverytime) { - report.append(QStringLiteral("The crash can be reproduced every time.\n\n")); - } else if (m_reproducible == ReproducibleSometimes) { - report.append(QStringLiteral("The crash can be reproduced sometimes.\n\n")); - } else if (m_reproducible == ReproducibleNever) { - report.append(QStringLiteral("The crash does not seem to be reproducible.\n\n")); - } - } - - //Backtrace - report.append(QStringLiteral("-- Backtrace:\n")); - if (!m_backtrace.isEmpty()) { - QString formattedBacktrace = m_backtrace.trimmed(); - report.append(formattedBacktrace + QLatin1Char('\n')); - } else { - report.append(QStringLiteral("A useful backtrace could not be generated\n")); - } - - //Possible duplicates (selected by the user) - if (!m_possibleDuplicates.isEmpty()) { - report.append(QLatin1Char('\n')); - QString duplicatesString; - Q_FOREACH(const QString & dupe, m_possibleDuplicates) { - duplicatesString += QLatin1String("bug ") + dupe + QLatin1String(", "); - } - duplicatesString = duplicatesString.left(duplicatesString.length()-2) + '.'; - report.append(QStringLiteral("The reporter indicates this bug may be a duplicate of or related to %1\n") - .arg(duplicatesString)); - } - - //Several possible duplicates (by bugzilla query) - if (!m_allPossibleDuplicatesByQuery.isEmpty()) { - report.append(QLatin1Char('\n')); - QString duplicatesString; - int count = m_allPossibleDuplicatesByQuery.count(); - for(int i=0; i < count && i < 5; i++) { - duplicatesString += QLatin1String("bug ") + m_allPossibleDuplicatesByQuery.at(i) + - QLatin1String(", "); - } - duplicatesString = duplicatesString.left(duplicatesString.length()-2) + '.'; - report.append(QStringLiteral("Possible duplicates by query: %1\n").arg(duplicatesString)); - } - - if (drKonqiStamp) { - report.append(QLatin1String("\nReported using DrKonqi")); - } - - return report; -} - -QString ReportInterface::generateAttachmentComment() const -{ - //Note: no translations should be done in this function's strings - - const CrashedApplication * crashedApp = DrKonqi::crashedApplication(); - const SystemInformation * sysInfo = DrKonqi::systemInformation(); - - QString comment; - - //Program name and versions - comment.append(QStringLiteral("%1 (%2) using Qt %4\n\n") - .arg(crashedApp->fakeExecutableBaseName()) - .arg(crashedApp->version()) - .arg(sysInfo->qtVersion())); - - //Details of the crash situation - if (isBugAwarenessPageDataUseful()) { - comment.append(QStringLiteral("%1\n\n").arg(m_reportDetailText.trimmed())); - } - - //Backtrace (only 6 lines) - comment.append(QStringLiteral("-- Backtrace (Reduced):\n")); - QString reducedBacktrace = - DrKonqi::debuggerManager()->backtraceGenerator()->parser()->simplifiedBacktrace(); - comment.append(reducedBacktrace.trimmed()); - - return comment; -} - -BugReport ReportInterface::newBugReportTemplate() const -{ - //Generate a new bug report template with some values on it - BugReport report; - - const SystemInformation * sysInfo = DrKonqi::systemInformation(); - - report.setProduct(m_productMapping->bugzillaProduct()); - report.setComponent(m_productMapping->bugzillaComponent()); - report.setVersion(m_productMapping->bugzillaVersion()); - report.setOperatingSystem(sysInfo->bugzillaOperatingSystem()); - if (sysInfo->compiledSources()) { - report.setPlatform(QLatin1String("Compiled Sources")); - } else { - report.setPlatform(sysInfo->bugzillaPlatform()); - } - report.setKeywords(QStringList() << QStringLiteral("drkonqi")); - report.setPriority(QLatin1String("NOR")); - report.setBugSeverity(QLatin1String("crash")); - - /* - Disable the backtrace functions on title for RELEASE. - It also needs a bit of polishment - - QString title = m_reportTitle; - - //If there are not too much possible duplicates by query then there are more possibilities - //that this report is unique. Let's add the backtrace functions to the title - if (m_allPossibleDuplicatesByQuery.count() <= 2) { - if (!m_firstBacktraceFunctions.isEmpty()) { - title += (QLatin1String(" [") + m_firstBacktraceFunctions.join(", ").trimmed() - + QLatin1String("]")); - } - } - */ - - report.setShortDescription(m_reportTitle); - return report; -} - -void ReportInterface::sendBugReport() const -{ - if (m_attachToBugNumber > 0) - { - //We are going to attach the report to an existent one - connect(m_bugzillaManager, &BugzillaManager::addMeToCCFinished, this, &ReportInterface::addedToCC); - connect(m_bugzillaManager, &BugzillaManager::addMeToCCError, this, &ReportInterface::sendReportError); - //First add the user to the CC list, then attach - m_bugzillaManager->addMeToCC(m_attachToBugNumber); - } else { - //Creating a new bug report - BugReport report = newBugReportTemplate(); - report.setDescription(generateReportFullText(true)); - report.setValid(true); - - connect(m_bugzillaManager, &BugzillaManager::sendReportErrorInvalidValues, this, &ReportInterface::sendUsingDefaultProduct); - connect(m_bugzillaManager, &BugzillaManager::reportSent, this, &ReportInterface::reportSent); - connect(m_bugzillaManager, &BugzillaManager::sendReportError, this, &ReportInterface::sendReportError); - m_bugzillaManager->sendReport(report); - } -} - -void ReportInterface::sendUsingDefaultProduct() const -{ - //Fallback function: if some of the custom values fail, we need to reset all the fields to the default - //(and valid) bugzilla values; and try to resend - BugReport report = newBugReportTemplate(); - report.setProduct(QLatin1String("kde")); - report.setComponent(QLatin1String("general")); - report.setPlatform(QLatin1String("unspecified")); - report.setDescription(generateReportFullText(true)); - report.setValid(true); - m_bugzillaManager->sendReport(report); -} - -void ReportInterface::addedToCC() -{ - //The user was added to the CC list, proceed with the attachment - connect(m_bugzillaManager, &BugzillaManager::attachToReportSent, this, &ReportInterface::attachSent); - connect(m_bugzillaManager, &BugzillaManager::attachToReportError, this, &ReportInterface::sendReportError); - - QString reportText = generateReportFullText(true); - QString comment = generateAttachmentComment(); - QString filename = getSuggestedKCrashFilename(DrKonqi::crashedApplication()); - QLatin1String summary("New crash information added by DrKonqi"); - - //Attach the report. The comment of the attachment also includes the bug description - m_bugzillaManager->attachTextToReport(reportText, filename, summary, - m_attachToBugNumber, comment); -} - -void ReportInterface::attachSent(int attachId) -{ - Q_UNUSED(attachId); - - //The bug was attached, consider it "sent" - emit reportSent(m_attachToBugNumber); -} - -QStringList ReportInterface::relatedBugzillaProducts() const -{ - return m_productMapping->relatedBugzillaProducts(); -} - -bool ReportInterface::isWorthReporting() const -{ - if (DrKonqi::ignoreQuality()) { - return true; - } - - //Evaluate if the provided information is useful enough to enable the automatic report - bool needToReport = false; - - if (!m_userRememberCrashSituation) { - //This should never happen... but... - return false; - } - - int rating = selectedOptionsRating(); - - BacktraceParser::Usefulness use = - DrKonqi::debuggerManager()->backtraceGenerator()->parser()->backtraceUsefulness(); - - switch (use) { - case BacktraceParser::ReallyUseful: { - //Perfect backtrace: require at least one option or a 100%-50% reproducible crash - needToReport = (rating >=2) || - (m_reproducible == ReproducibleEverytime || m_reproducible == ReproducibleSometimes); - break; - } - case BacktraceParser::MayBeUseful: { - //Not perfect backtrace: require at least two options or a 100% reproducible crash - needToReport = (rating >=3) || (m_reproducible == ReproducibleEverytime); - break; - } - case BacktraceParser::ProbablyUseless: - //Bad backtrace: require at least two options and always reproducible (strict) - needToReport = (rating >=5) && (m_reproducible == ReproducibleEverytime); - break; - case BacktraceParser::Useless: - case BacktraceParser::InvalidUsefulness: { - needToReport = false; - } - } - - return needToReport; -} - -void ReportInterface::setAttachToBugNumber(uint bugNumber) -{ - //If bugNumber>0, the report is going to be attached to bugNumber - m_attachToBugNumber = bugNumber; -} - -uint ReportInterface::attachToBugNumber() const -{ - return m_attachToBugNumber; -} - -void ReportInterface::setDuplicateId(uint duplicate) -{ - m_duplicate = duplicate; -} - -uint ReportInterface::duplicateId() const -{ - return m_duplicate; -} - -void ReportInterface::setPossibleDuplicatesByQuery(const QStringList & list) -{ - m_allPossibleDuplicatesByQuery = list; -} - -BugzillaManager * ReportInterface::bugzillaManager() const -{ - return m_bugzillaManager; -} - -ApplicationDetailsExamples * ReportInterface::appDetailsExamples() const -{ - return m_appDetailsExamples; -} - - diff --git a/drkonqi/bugzillaintegration/reportinterface.h b/drkonqi/bugzillaintegration/reportinterface.h deleted file mode 100644 index c7e374ee3..000000000 --- a/drkonqi/bugzillaintegration/reportinterface.h +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************* -* reportinterface.h -* Copyright 2009, 2011 Dario Andres Rodriguez -* Copyright 2009 George Kiagiadakis -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef REPORTINTERFACE__H -#define REPORTINTERFACE__H - -#include -#include - -class BugReport; - -class BugzillaManager; -class ProductMapping; -class ApplicationDetailsExamples; - -class ReportInterface : public QObject -{ - Q_OBJECT -public: - enum Reproducible { ReproducibleUnsure, ReproducibleNever, - ReproducibleSometimes, ReproducibleEverytime }; - - explicit ReportInterface(QObject *parent = 0); - - void setBugAwarenessPageData(bool, Reproducible, bool, bool, bool); - bool isBugAwarenessPageDataUseful() const; - - int selectedOptionsRating() const; - - QStringList firstBacktraceFunctions() const; - void setFirstBacktraceFunctions(const QStringList & functions); - - QString backtrace() const; - void setBacktrace(const QString & backtrace); - - QString title() const; - void setTitle(const QString & text); - - void setDetailText(const QString & text); - void setPossibleDuplicates(const QStringList & duplicatesList); - - QString generateReportFullText(bool drKonqiStamp) const; - - BugReport newBugReportTemplate() const; - void sendBugReport() const; - - QStringList relatedBugzillaProducts() const; - - bool isWorthReporting() const; - - //Zero means creating a new bug report - void setAttachToBugNumber(uint); - uint attachToBugNumber() const; - - //Zero means there is no duplicate - void setDuplicateId(uint); - uint duplicateId() const; - - void setPossibleDuplicatesByQuery(const QStringList &); - - BugzillaManager * bugzillaManager() const; - ApplicationDetailsExamples * appDetailsExamples() const; - - bool userCanProvideActionsAppDesktop() const { - return m_provideActionsApplicationDesktop; - } - - bool userCanProvideUnusualBehavior() const { - return m_provideUnusualBehavior; - } - - bool userCanProvideApplicationConfigDetails() const { - return m_provideApplicationConfigurationDetails; - } - -private Q_SLOTS: - void sendUsingDefaultProduct() const; - void addedToCC(); - void attachSent(int); - -Q_SIGNALS: - void reportSent(int); - void sendReportError(const QString &, const QString &); - -private: - QString generateAttachmentComment() const; - - //Information the user can provide - bool m_userRememberCrashSituation; - Reproducible m_reproducible; - bool m_provideActionsApplicationDesktop; - bool m_provideUnusualBehavior; - bool m_provideApplicationConfigurationDetails; - - - QString m_backtrace; - QStringList m_firstBacktraceFunctions; - - QString m_reportTitle; - QString m_reportDetailText; - QStringList m_possibleDuplicates; - - QStringList m_allPossibleDuplicatesByQuery; - - uint m_attachToBugNumber; - uint m_duplicate; - - ProductMapping * m_productMapping; - BugzillaManager * m_bugzillaManager; - ApplicationDetailsExamples * m_appDetailsExamples; -}; - -#endif diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugawareness.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugawareness.ui deleted file mode 100644 index edf67cc94..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugawareness.ui +++ /dev/null @@ -1,334 +0,0 @@ - - - AssistantPageBugAwareness - - - - 0 - 0 - 508 - 319 - - - - - - - <strong>Do you remember what you were doing prior to the crash?</strong> - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - Yes - - - m_rememberGroup - - - - - - - No - - - true - - - m_rememberGroup - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - false - - - <strong>Does the application crash again if you repeat the same situation?</strong> - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - false - - - If you tried to repeat the situation, select how often the application crashes - - - If you tried to repeat the situation, select how often the application crashes - - - - I did not try again - - - - - Never - - - - - Sometimes - - - - - Every time - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - false - - - <strong>Please select which additional information you can provide:</strong> - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - false - - - Check this option if you can describe what were you doing inside the application before it crashed - - - Check this option if you can describe what were you doing inside the application before it crashed - - - - - - - false - - - Check this option if you can describe any unusual behavior or appearance in the application or the whole desktop - - - Check this option if you can describe any unusual behavior or appearance in the application or the whole desktop - - - Unusual desktop behavior I noticed - - - - - - - 0 - - - - - false - - - Check this option if you can provide application specific details or settings that may be related to the crash. You can check the examples (if available.) - - - Check this option if you can provide application specific details or settings that may be related to the crash. You can check the examples (if available.) - - - Custom settings of the application that may be related - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - false - - - - 0 - 0 - - - - <a href="#">Examples</a> - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - KComboBox - QComboBox -
kcombobox.h
-
-
- - - - - -
diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates.ui deleted file mode 100644 index 9168e4976..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates.ui +++ /dev/null @@ -1,217 +0,0 @@ - - - AssistantPageBugzillaDuplicates - - - - 0 - 0 - 563 - 517 - - - - - - - See if your bug has already been reported. Double click a report in the list and compare it to yours. You can suggest that your crash is a duplicate of that report or directly attach your information to it. - - - true - - - - - - - - - - 0 - 0 - - - - - - - - false - - - - - - - false - - - - - - - - - - - 2 - - - - - true - - - false - - - true - - - - Bug ID - - - - - Description - - - - - - - - 2 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - - - - - - - - - 2 - - - - - Possible duplicates: - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 120 - 16777215 - - - - - - - - 2 - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 0 - 0 - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - - - StatusWidget - QWidget -
statuswidget.h
- 1 -
-
- - -
diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog.ui deleted file mode 100644 index be0ff757f..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog.ui +++ /dev/null @@ -1,153 +0,0 @@ - - - AssistantPageBugzillaDuplicatesDialog - - - - 0 - 0 - 592 - 345 - - - - - 400 - 300 - - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - true - - - - - - - - 0 - 0 - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - - - - - - - - Show the backtrace of the crash I experienced to compare (advanced) - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - QDialogButtonBox::Close - - - - - - - - StatusWidget - QWidget -
statuswidget.h
- 1 -
-
- - - - buttonBox - accepted() - AssistantPageBugzillaDuplicatesDialog - accept() - - - 514 - 333 - - - 515 - 344 - - - - - buttonBox - rejected() - AssistantPageBugzillaDuplicatesDialog - reject() - - - 259 - 331 - - - 260 - 345 - - - - -
diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog_confirmation.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog_confirmation.ui deleted file mode 100644 index e017bc9cd..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog_confirmation.ui +++ /dev/null @@ -1,291 +0,0 @@ - - - ConfirmationDialog - - - - 0 - 0 - 548 - 486 - - - - - - - false - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 17 - 5 - - - - - - - - - - This is likely to be a <strong>common crash</strong>, and a lot of different cases' details may have been provided already. <i>Proceed only if you can add new information (not already mentioned). </i> - - - true - - - - - - - true - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - true - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - true - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 5 - - - - - - - - <strong>Do you want to proceed with the reporting process?</strong> - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - No, do not file &a new bug report, and cancel the assistant - - - buttonGroupProceedQuestion - - - - - - - Proceed with reporting &the bug - - - buttonGroupProceedQuestion - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 5 - - - - - - - - <strong>Are you sure this report matches your crash situation?</strong> - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - Not &really sure: mark as a possible duplicate - - - buttonGroupProceed - - - - - - - Completely sure: attach my &information to this report - - - buttonGroupProceed - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - ConfirmationDialog - accept() - - - 345 - 461 - - - 342 - 483 - - - - - buttonBox - rejected() - ConfirmationDialog - reject() - - - 230 - 470 - - - 232 - 492 - - - - - - - - - diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_information.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_information.ui deleted file mode 100644 index 9fc5843fd..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_information.ui +++ /dev/null @@ -1,120 +0,0 @@ - - - AssistantPageBugzillaInformation - - - - 0 - 0 - 513 - 345 - - - - - - - <strong>Please provide the following information in English.</strong> - - - true - - - - - - - <strong>Title of the bug report:</strong> (<a href="#">examples</a>) - - - - - - - - - - - - <strong>Information about the crash:</strong> (<a href="#">help and examples</a>) - - - - - - - - - Information about the crash text - - - false - - - - - - - Distribution method: - - - - - - - - - - - KDE Platform is compiled from sources - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - <i>Note</i>: The crash and system information will be automatically added to the bug report. - - - true - - - - - - - - KComboBox - QComboBox -
kcombobox.h
-
- - KLineEdit - QLineEdit -
klineedit.h
-
-
- - -
diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_login.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_login.ui deleted file mode 100644 index a46a14ed8..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_login.ui +++ /dev/null @@ -1,163 +0,0 @@ - - - AssistantPageBugzillaLogin - - - - 0 - 0 - 488 - 472 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 5 - - - - - - - - - - Username: - - - - - - - Password: - - - - - - - Password input - - - true - - - true - - - - - - - Username input - - - true - - - - - - - - - Save login information using the KDE Wallet system - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - true - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - KLineEdit - QLineEdit -
klineedit.h
-
- - StatusWidget - QWidget -
statuswidget.h
- 1 -
-
- - m_userEdit - m_passwordEdit - m_savePasswordCheckBox - m_loginButton - - - -
diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_preview.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_preview.ui deleted file mode 100644 index 3c94c4811..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_preview.ui +++ /dev/null @@ -1,37 +0,0 @@ - - - AssistantPageBugzillaPreview - - - - 0 - 0 - 545 - 300 - - - - - - - This is a preview of the report's contents which will be sent. - -If you want to modify it go to the previous pages. - - - true - - - - - - - true - - - - - - - - diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_send.ui b/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_send.ui deleted file mode 100644 index 5f9215ec8..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_bugzilla_send.ui +++ /dev/null @@ -1,127 +0,0 @@ - - - AssistantPageBugzillaSend - - - - 0 - 0 - 545 - 300 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - Qt::RichText - - - true - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Open the bug report page when clicking the Finish button - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 5 - - - - - - - - Restart the application when clicking the Finish button - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - StatusWidget - QWidget -
statuswidget.h
- 1 -
-
- - -
diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_conclusions.ui b/drkonqi/bugzillaintegration/ui/assistantpage_conclusions.ui deleted file mode 100644 index 5a9d5920f..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_conclusions.ui +++ /dev/null @@ -1,131 +0,0 @@ - - - AssistantPageConclusions - - - - 0 - 0 - 506 - 460 - - - - - - - true - - - - - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - true - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 5 - - - - - - - - Restart the application when clicking the Finish button - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 5 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_conclusions_dialog.ui b/drkonqi/bugzillaintegration/ui/assistantpage_conclusions_dialog.ui deleted file mode 100644 index 8b17babc0..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_conclusions_dialog.ui +++ /dev/null @@ -1,67 +0,0 @@ - - - AssistantPageConclusionsDialog - - - - 0 - 0 - 466 - 385 - - - - - 450 - 350 - - - - - - - - - - QDialogButtonBox::Close - - - - - - - - - buttonBox - accepted() - AssistantPageConclusionsDialog - accept() - - - 342 - 372 - - - 462 - 313 - - - - - buttonBox - rejected() - AssistantPageConclusionsDialog - reject() - - - 421 - 375 - - - 464 - 352 - - - - - diff --git a/drkonqi/bugzillaintegration/ui/assistantpage_introduction.ui b/drkonqi/bugzillaintegration/ui/assistantpage_introduction.ui deleted file mode 100644 index 962f7153d..000000000 --- a/drkonqi/bugzillaintegration/ui/assistantpage_introduction.ui +++ /dev/null @@ -1,103 +0,0 @@ - - - AssistantPageIntroduction - - - - 0 - 0 - 536 - 364 - - - - - - - This assistant will analyze the crash information and guide you through the bug reporting process. - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - - 0 - 0 - - - - - 64 - 64 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 5 - - - - - - - - <p><i>Note</i>: Since communication between you and the developers is required for effective debugging, to continue reporting this bug <strong>it is required for you to agree that developers may contact you.</strong></p><p>Feel free to close this dialog if you do not accept this.</p> - - - true - - - - - - - - - Qt::Vertical - - - - 20 - 249 - - - - - - - - - diff --git a/drkonqi/config-drkonqi.h.cmake b/drkonqi/config-drkonqi.h.cmake deleted file mode 100644 index 94b876de0..000000000 --- a/drkonqi/config-drkonqi.h.cmake +++ /dev/null @@ -1,6 +0,0 @@ -#cmakedefine HAVE_STRSIGNAL 1 -#cmakedefine HAVE_UNAME 1 -#cmakedefine HAVE_X11 1 -#define HAVE_XMLRPCCLIENT 1 - -#define DEBUG_PACKAGE_INSTALLER_NAME "@DEBUG_PACKAGE_INSTALLER_NAME@" diff --git a/drkonqi/crashedapplication.cpp b/drkonqi/crashedapplication.cpp deleted file mode 100644 index b35877d5c..000000000 --- a/drkonqi/crashedapplication.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include - -#include "crashedapplication.h" - -#if defined(HAVE_STRSIGNAL) && defined(Q_OS_UNIX) -# include -# include -# include -#else -# if defined(Q_OS_UNIX) -# include -# else -# include -# endif -#endif - -#include - -CrashedApplication::CrashedApplication(QObject *parent) - : QObject(parent), m_restarted(false) -{ -} - -CrashedApplication::~CrashedApplication() -{ -} - -QString CrashedApplication::name() const -{ - return m_name.isEmpty() ? fakeExecutableBaseName() : m_name; -} - -QFileInfo CrashedApplication::executable() const -{ - return m_executable; -} - -QString CrashedApplication::fakeExecutableBaseName() const -{ - if (!m_fakeBaseName.isEmpty()) { - return m_fakeBaseName; - } else { - return m_executable.baseName(); - } -} - -QString CrashedApplication::version() const -{ - return m_version; -} - -BugReportAddress CrashedApplication::bugReportAddress() const -{ - return m_reportAddress; -} - -int CrashedApplication::pid() const -{ - return m_pid; -} - -int CrashedApplication::signalNumber() const -{ - return m_signalNumber; -} - -QString CrashedApplication::signalName() const -{ -#if defined(HAVE_STRSIGNAL) && defined(Q_OS_UNIX) - const char * oldLocale = std::setlocale(LC_MESSAGES, NULL); - char * savedLocale; - if (oldLocale) { - savedLocale = strdup(oldLocale); - } else { - savedLocale = NULL; - } - std::setlocale(LC_MESSAGES, "C"); - const char *name = strsignal(m_signalNumber); - std::setlocale(LC_MESSAGES, savedLocale); - std::free(savedLocale); - return QString::fromLocal8Bit(name != NULL ? name : "Unknown"); -#else - switch (m_signalNumber) { -# if defined(Q_OS_UNIX) - case SIGILL: return QLatin1String("SIGILL"); - case SIGABRT: return QLatin1String("SIGABRT"); - case SIGFPE: return QLatin1String("SIGFPE"); - case SIGSEGV: return QLatin1String("SIGSEGV"); - case SIGBUS: return QLatin1String("SIGBUS"); -# else - case EXCEPTION_ACCESS_VIOLATION: return QLatin1String("EXCEPTION_ACCESS_VIOLATION"); - case EXCEPTION_DATATYPE_MISALIGNMENT: return QLatin1String("EXCEPTION_DATATYPE_MISALIGNMENT"); - case EXCEPTION_BREAKPOINT: return QLatin1String("EXCEPTION_BREAKPOINT"); - case EXCEPTION_SINGLE_STEP: return QLatin1String("EXCEPTION_SINGLE_STEP"); - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: return QLatin1String("EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); - case EXCEPTION_FLT_DENORMAL_OPERAND: return QLatin1String("EXCEPTION_FLT_DENORMAL_OPERAND"); - case EXCEPTION_FLT_DIVIDE_BY_ZERO: return QLatin1String("EXCEPTION_FLT_DIVIDE_BY_ZERO"); - case EXCEPTION_FLT_INEXACT_RESULT: return QLatin1String("EXCEPTION_FLT_INEXACT_RESULT"); - case EXCEPTION_FLT_INVALID_OPERATION: return QLatin1String("EXCEPTION_FLT_INVALID_OPERATION"); - case EXCEPTION_FLT_OVERFLOW: return QLatin1String("EXCEPTION_FLT_OVERFLOW"); - case EXCEPTION_FLT_STACK_CHECK: return QLatin1String("EXCEPTION_FLT_STACK_CHECK"); - case EXCEPTION_FLT_UNDERFLOW: return QLatin1String("EXCEPTION_FLT_UNDERFLOW"); - case EXCEPTION_INT_DIVIDE_BY_ZERO: return QLatin1String("EXCEPTION_INT_DIVIDE_BY_ZERO"); - case EXCEPTION_INT_OVERFLOW: return QLatin1String("EXCEPTION_INT_OVERFLOW"); - case EXCEPTION_PRIV_INSTRUCTION: return QLatin1String("EXCEPTION_PRIV_INSTRUCTION"); - case EXCEPTION_IN_PAGE_ERROR: return QLatin1String("EXCEPTION_IN_PAGE_ERROR"); - case EXCEPTION_ILLEGAL_INSTRUCTION: return QLatin1String("EXCEPTION_ILLEGAL_INSTRUCTION"); - case EXCEPTION_NONCONTINUABLE_EXCEPTION: return QLatin1String("EXCEPTION_NONCONTINUABLE_EXCEPTION"); - case EXCEPTION_STACK_OVERFLOW: return QLatin1String("EXCEPTION_STACK_OVERFLOW"); - case EXCEPTION_INVALID_DISPOSITION: return QLatin1String("EXCEPTION_INVALID_DISPOSITION"); -# endif - default: return QLatin1String("Unknown"); - } -#endif -} - -bool CrashedApplication::hasBeenRestarted() const -{ - return m_restarted; -} - -int CrashedApplication::thread() const -{ - return m_thread; -} - -const QDateTime& CrashedApplication::datetime() const -{ - return m_datetime; -} - -void CrashedApplication::restart() -{ - if (m_restarted) { - return; - } - - int ret = -1; - - //start the application via kdeinit, as it needs to have a pristine environment and - //KProcess::startDetached() can't start a new process with custom environment variables. - if (!m_fakeBaseName.isEmpty()) { - // if m_fakeBaseName is set, this means m_executable is the path to kdeinit4 - // so we need to use the fakeBaseName to restart the app - ret = KToolInvocation::kdeinitExec(m_fakeBaseName); - } else { - ret = KToolInvocation::kdeinitExec(m_executable.absoluteFilePath()); - } - - const bool success = (ret == 0); - - m_restarted = success; - emit restarted(success); -} - -QString getSuggestedKCrashFilename(const CrashedApplication* app) -{ - QString filename = app->fakeExecutableBaseName() + '-' + - app->datetime().toString(QStringLiteral("yyyyMMdd-hhmmss")) + - ".kcrash.txt"; - - if (filename.contains('/')) { - filename = filename.mid(filename.lastIndexOf('/') + 1); - } - - return filename; -} - - diff --git a/drkonqi/crashedapplication.h b/drkonqi/crashedapplication.h deleted file mode 100644 index c03d62f5e..000000000 --- a/drkonqi/crashedapplication.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef CRASHEDAPPLICATION_H -#define CRASHEDAPPLICATION_H - -#include -#include -#include - -#include "bugreportaddress.h" - -class KCrashBackend; - -class CrashedApplication : public QObject -{ - Q_OBJECT -public: - ~CrashedApplication() override; - - /** Returns the crashed program's name, possibly translated (ex. "The KDE Crash Handler") */ - QString name() const; - - /** Returns a QFileInfo with information about the executable that crashed */ - QFileInfo executable() const; - - /** When an application is run via kdeinit, the executable() method returns kdeinit4, but - * we still need a way to know which is the application that was loaded by kdeinit. So, - * this method returns the base name of the executable that would have been launched if - * the app had not been loaded by kdeinit (ex. "plasma-desktop"). If the application was - * not launched via kdeinit, this method returns executable().baseName(); - */ - QString fakeExecutableBaseName() const; - - /** Returns the version of the crashed program */ - QString version() const; - - /** Returns the address where the bug report for this application should go */ - BugReportAddress bugReportAddress() const; - - /** Returns the pid of the crashed program */ - int pid() const; - - /** Returns the signal number that the crashed program received */ - int signalNumber() const; - - /** Returns the name of the signal (ex. SIGSEGV) */ - QString signalName() const; - - bool hasBeenRestarted() const; - - int thread() const; - - const QDateTime& datetime() const; - -public Q_SLOTS: - void restart(); - -Q_SIGNALS: - void restarted(bool success); - -protected: - friend class KCrashBackend; - CrashedApplication(QObject *parent = 0); - - int m_pid; - int m_signalNumber; - QString m_name; - QFileInfo m_executable; - QString m_fakeBaseName; - QString m_version; - BugReportAddress m_reportAddress; - bool m_restarted; - int m_thread; - QDateTime m_datetime; -}; - -QString getSuggestedKCrashFilename(const CrashedApplication* app); - -#endif // CRASHEDAPPLICATION_H diff --git a/drkonqi/data/CMakeLists.txt b/drkonqi/data/CMakeLists.txt deleted file mode 100644 index 43df28e46..000000000 --- a/drkonqi/data/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -install(FILES mappings DESTINATION ${KDE_INSTALL_DATADIR}/drkonqi) -install(DIRECTORY debuggers DESTINATION ${KDE_INSTALL_DATADIR}/drkonqi PATTERN ".svn" EXCLUDE) diff --git a/drkonqi/data/debuggers/external/gdbrc b/drkonqi/data/debuggers/external/gdbrc deleted file mode 100644 index 215b93ec9..000000000 --- a/drkonqi/data/debuggers/external/gdbrc +++ /dev/null @@ -1,78 +0,0 @@ -[General] -Name=gdb -Name[bg]=gdb -Name[bn]=gdb -Name[bs]=gDB -Name[ca]=gdb -Name[ca@valencia]=gdb -Name[cs]=gdb -Name[csb]=gdb -Name[da]=gdb -Name[de]=gdb -Name[el]=gdb -Name[en_GB]=gdb -Name[eo]=gdb -Name[es]=gdb -Name[et]=gdb -Name[eu]=gdb -Name[fa]=gdb -Name[fi]=gdb -Name[fr]=gdb -Name[fy]=gdb -Name[ga]=gdb -Name[gl]=gdb -Name[gu]=gdb -Name[he]=gdb -Name[hi]=gdb -Name[hr]=gdb -Name[hu]=gdb -Name[ia]=gdb -Name[id]=gdb -Name[is]=gdb -Name[it]=gdb -Name[ja]=gdb -Name[ka]=gdb -Name[kk]=gdb -Name[km]=gdb -Name[kn]=gdb -Name[ko]=gdb -Name[lt]=gdb -Name[lv]=gdb -Name[mai]=gdb -Name[mk]=gdb -Name[ml]=ജിഡിബി -Name[mr]=gdb -Name[nb]=gdb -Name[nds]=GDB -Name[nl]=gdb -Name[nn]=gdb -Name[pa]=gdb -Name[pl]=gdb -Name[pt]=gdb -Name[pt_BR]=gdb -Name[ro]=gdb -Name[ru]=gdb -Name[si]=gdb -Name[sk]=gdb -Name[sl]=gdb -Name[sr]=ГДБ -Name[sr@ijekavian]=ГДБ -Name[sr@ijekavianlatin]=GDB -Name[sr@latin]=GDB -Name[sv]=gdb -Name[tg]=gdb -Name[th]=gdb -Name[tr]=gdb -Name[ug]=gdb -Name[uk]=gdb -Name[vi]=gdb -Name[wa]=gdb -Name[x-test]=xxgdbxx -Name[zh_CN]=gdb -Name[zh_TW]=gdb -TryExec=gdb -Backends=KCrash - -[KCrash] -Exec=konsole --nofork -e gdb -nw -p %pid %execpath -Terminal=true diff --git a/drkonqi/data/debuggers/external/kdbgrc b/drkonqi/data/debuggers/external/kdbgrc deleted file mode 100644 index aa145143d..000000000 --- a/drkonqi/data/debuggers/external/kdbgrc +++ /dev/null @@ -1,77 +0,0 @@ -[General] -Name=kdbg -Name[bg]=kdbg -Name[bn]=kdbg -Name[bs]=kdbg -Name[ca]=kdbg -Name[ca@valencia]=kdbg -Name[cs]=kdbg -Name[csb]=kdbg -Name[da]=kdbg -Name[de]=kdbg -Name[el]=kdbg -Name[en_GB]=kdbg -Name[eo]=kdbg -Name[es]=kdbg -Name[et]=kdbg -Name[eu]=kdbg -Name[fa]=kdbg -Name[fi]=kdbg -Name[fr]=kdbg -Name[fy]=kdbg -Name[ga]=kdbg -Name[gl]=kdbg -Name[gu]=kdbg -Name[he]=kdbg -Name[hi]=kdbg -Name[hr]=kdbg -Name[hu]=kdbg -Name[ia]=kdbg -Name[id]=kdbg -Name[is]=kdbg -Name[it]=kdbg -Name[ja]=kdbg -Name[ka]=kdbg -Name[kk]=kdbg -Name[km]=kdbg -Name[kn]=kdbg -Name[ko]=kdbg -Name[lt]=kdbg -Name[lv]=kdbg -Name[mai]=kdbg -Name[mk]=kdbg -Name[ml]=കെഡിബിജി -Name[mr]=kdbg -Name[nb]=kdbg -Name[nds]=KDbg -Name[nl]=kdbg -Name[nn]=kdbg -Name[pa]=kdbg -Name[pl]=kdbg -Name[pt]=kdbg -Name[pt_BR]=kdbg -Name[ro]=kdbg -Name[ru]=kdbg -Name[si]=kdbg -Name[sk]=kdbg -Name[sl]=kdbg -Name[sr]=Кдбг -Name[sr@ijekavian]=Кдбг -Name[sr@ijekavianlatin]=KDbg -Name[sr@latin]=KDbg -Name[sv]=kdbg -Name[tg]=kdbg -Name[th]=kdbg -Name[tr]=kdbg -Name[ug]=kdbg -Name[uk]=kdbg -Name[vi]=kdbg -Name[wa]=kdbg -Name[x-test]=xxkdbgxx -Name[zh_CN]=kdbg -Name[zh_TW]=kdbg -TryExec=kdbg -Backends=KCrash - -[KCrash] -Exec=kdbg -p %pid %execpath diff --git a/drkonqi/data/debuggers/internal/dbxrc b/drkonqi/data/debuggers/internal/dbxrc deleted file mode 100644 index 7847265ec..000000000 --- a/drkonqi/data/debuggers/internal/dbxrc +++ /dev/null @@ -1,74 +0,0 @@ -[General] -Name=dbx -Name[bg]=dbx -Name[bn]=dbx -Name[bs]=dBX -Name[ca]=dbx -Name[ca@valencia]=dbx -Name[cs]=dbx -Name[da]=dbx -Name[de]=dbx -Name[el]=dbx -Name[en_GB]=dbx -Name[eo]=dbx -Name[es]=dbx -Name[et]=dbx -Name[eu]=dbx -Name[fa]=dbx -Name[fi]=dbx -Name[fr]=dbx -Name[ga]=dbx -Name[gl]=dbx -Name[gu]=dbx -Name[he]=dbx -Name[hi]=dbx -Name[hr]=dbx -Name[hu]=dbx -Name[ia]=dbx -Name[id]=dbx -Name[is]=dbx -Name[it]=dbx -Name[ja]=dbx -Name[kk]=dbx -Name[km]=dbx -Name[kn]=dbx -Name[ko]=dbx -Name[lt]=dbx -Name[lv]=dbx -Name[mai]=dbx -Name[mr]=dbx -Name[nb]=dbx -Name[nds]=dbx -Name[nl]=dbx -Name[nn]=dbx -Name[pa]=dbx -Name[pl]=dbx -Name[pt]=dbx -Name[pt_BR]=dbx -Name[ro]=dbx -Name[ru]=dbx -Name[si]=dbx -Name[sk]=dbx -Name[sl]=dbx -Name[sr]=ДБИкс -Name[sr@ijekavian]=ДБИкс -Name[sr@ijekavianlatin]=DBX -Name[sr@latin]=DBX -Name[sv]=dbx -Name[tg]=dbx -Name[th]=dbx -Name[tr]=dbx -Name[ug]=dbx -Name[uk]=dbx -Name[vi]=dbx -Name[wa]=dbx -Name[x-test]=xxdbxxx -Name[zh_CN]=dbx -Name[zh_TW]=dbx -TryExec=dbx -Backends=KCrash - -[KCrash] -Exec=dbx -c "where -l -v -h;quit" - %pid -BatchCommands=where - diff --git a/drkonqi/data/debuggers/internal/gdbrc b/drkonqi/data/debuggers/internal/gdbrc deleted file mode 100644 index 0b02daedc..000000000 --- a/drkonqi/data/debuggers/internal/gdbrc +++ /dev/null @@ -1,78 +0,0 @@ -[General] -Name=gdb -Name[bg]=gdb -Name[bn]=gdb -Name[bs]=gDB -Name[ca]=gdb -Name[ca@valencia]=gdb -Name[cs]=gdb -Name[csb]=gdb -Name[da]=gdb -Name[de]=gdb -Name[el]=gdb -Name[en_GB]=gdb -Name[eo]=gdb -Name[es]=gdb -Name[et]=gdb -Name[eu]=gdb -Name[fa]=gdb -Name[fi]=gdb -Name[fr]=gdb -Name[fy]=gdb -Name[ga]=gdb -Name[gl]=gdb -Name[gu]=gdb -Name[he]=gdb -Name[hi]=gdb -Name[hr]=gdb -Name[hu]=gdb -Name[ia]=gdb -Name[id]=gdb -Name[is]=gdb -Name[it]=gdb -Name[ja]=gdb -Name[ka]=gdb -Name[kk]=gdb -Name[km]=gdb -Name[kn]=gdb -Name[ko]=gdb -Name[lt]=gdb -Name[lv]=gdb -Name[mai]=gdb -Name[mk]=gdb -Name[ml]=ജിഡിബി -Name[mr]=gdb -Name[nb]=gdb -Name[nds]=GDB -Name[nl]=gdb -Name[nn]=gdb -Name[pa]=gdb -Name[pl]=gdb -Name[pt]=gdb -Name[pt_BR]=gdb -Name[ro]=gdb -Name[ru]=gdb -Name[si]=gdb -Name[sk]=gdb -Name[sl]=gdb -Name[sr]=ГДБ -Name[sr@ijekavian]=ГДБ -Name[sr@ijekavianlatin]=GDB -Name[sr@latin]=GDB -Name[sv]=gdb -Name[tg]=gdb -Name[th]=gdb -Name[tr]=gdb -Name[ug]=gdb -Name[uk]=gdb -Name[vi]=gdb -Name[wa]=gdb -Name[x-test]=xxgdbxx -Name[zh_CN]=gdb -Name[zh_TW]=gdb -TryExec=gdb -Backends=KCrash - -[KCrash] -Exec=gdb -nw -n -batch -x %tempfile -p %pid %execpath -BatchCommands=set width 200\nthread\nthread apply all bt diff --git a/drkonqi/data/debuggers/internal/kdbgwinrc b/drkonqi/data/debuggers/internal/kdbgwinrc deleted file mode 100644 index de6e1117f..000000000 --- a/drkonqi/data/debuggers/internal/kdbgwinrc +++ /dev/null @@ -1,73 +0,0 @@ -[General] -Name=kdbgwin -Name[bg]=kdbgwin -Name[bn]=kdbgwin -Name[bs]=kdbgwin -Name[ca]=kdbgwin -Name[ca@valencia]=kdbgwin -Name[cs]=kdbgwin -Name[da]=kdbgwin -Name[de]=kdbgwin -Name[el]=kdbgwin -Name[en_GB]=kdbgwin -Name[eo]=kdbgwin -Name[es]=kdbgwin -Name[et]=kdbgwin -Name[eu]=kdbgwin -Name[fa]=kdbgwin -Name[fi]=kdbgwin -Name[fr]=kdbgwin -Name[ga]=kdbgwin -Name[gl]=kdbgwin -Name[gu]=kdbgwin -Name[he]=kdbgwin -Name[hi]=kdbgwin -Name[hr]=kdbgwin -Name[hu]=kdbgwin -Name[ia]=kdbgwin -Name[id]=kdbgwin -Name[is]=kdbgwin -Name[it]=kdbgwin -Name[ja]=kdbgwin -Name[ka]=kdbgwin -Name[kk]=kdbgwin -Name[km]=kdbgwin -Name[kn]=kdbgwin -Name[ko]=kdbgwin -Name[lt]=kdbgwin -Name[lv]=kdbgwin -Name[mai]=kdbgwin -Name[mr]=kdbgwin -Name[nb]=kdbgwin -Name[nds]=KDbgWin -Name[nl]=kdbgwin -Name[nn]=kdbgwin -Name[pa]=kdbgwin -Name[pl]=kdbgwin -Name[pt]=kdbgwin -Name[pt_BR]=kdbgwin -Name[ro]=kdbgwin -Name[ru]=kdbgwin -Name[si]=kdbgwin -Name[sk]=kdbgwin -Name[sl]=kdbgwin -Name[sr]=Кдбг‑вин -Name[sr@ijekavian]=Кдбг‑вин -Name[sr@ijekavianlatin]=KDbgWin -Name[sr@latin]=KDbgWin -Name[sv]=kdbgwin -Name[tg]=kdbgwin -Name[th]=kdbgwin -Name[tr]=kdbgwin -Name[ug]=kdbgwin -Name[uk]=kdbgwin -Name[vi]=kdbgwin -Name[wa]=kdbgwin -Name[x-test]=xxkdbgwinxx -Name[zh_CN]=kdbgwin -Name[zh_TW]=kdbgwin -TryExec=kdbgwin -Backends=KCrash - -[KCrash] -Exec=kdbgwin %pid %thread diff --git a/drkonqi/data/mappings b/drkonqi/data/mappings deleted file mode 100644 index d1d6d3ebc..000000000 --- a/drkonqi/data/mappings +++ /dev/null @@ -1,281 +0,0 @@ -#--- -#Binary name -> Bugzilla product|component mapping -#--- - -[Mappings] - -#KDE Platform (kdelibs) -kdebugdialog=kdelibs|general -kdeinit4=kdelibs|general -kdepasswd=kdelibs|kpasswdserver -kdialog=kdelibs|general -keditfiletype=kdelibs|general -kfmclient=kdelibs|general -kglobalaccel=kdelibs|general -kiconfinder=kdelibs|general -kuiserver=kdelibs|general -kded4=kdelibs|kded -kcmshell4=systemsettings|general -systemsettings5=systemsettings|general -kwalletd=kdelibs|kwallet -kwrited=konsole|kwrited -kbuildsycoca4=kdelibs|ksycoca -knotify4=kdelibs|knotify -kcminit=kde|general - -#KDE Platform (KIO) -kioclient=kio|general -ktrash=kio|trash - -#KDE Platform (Baloo) -baloo_file=frameworks-baloo|Baloo File Daemon -baloo_file_extractor=frameworks-baloo|Baloo File Daemon - -#KDE Platform (Solid/Bluedevil) -solid-action-desktop-gen=solid|general -bluedevil-audio=Bluedevil|general -bluedevil-helper=Bluedevil|general -bluedevil-input=Bluedevil|general -bluedevil-monolithic=Bluedevil|general -bluedevil-network-dun=Bluedevil|general -bluedevil-network-panu=Bluedevil|general -bluedevil-sendfile=Bluedevil|general -bluedevil-wizard=Bluedevil/wizard - -#KPackage -kpackagetool5=kpackage|general - -#KDE Plasma Desktop (Plasma & KRunner) -plasma-desktop=plasma|general -plasma-mid=plasma|general -plasma-overlay=plasma|general -plasma2jolie=plasma|general -plasmagik=plasma|general -plasmapkg=plasma|general -knotificationareaitemtest=plasma|widget-systemtray -knotificationicontest=plasma|widget-systemtray -lancelot=plasma|widget-lancelot -plasma-netbook=plasma|plasma-netbook -kactivitymanagerd=kactivities|general -plasma-windowed=plasma|general -plasma-device=Active|General -plasmashell=plasmashell|general -plasma-discover=Discover|discover - -#KDE Plasma SDK (Plasmate) -plasmaengineexplorer=plasmate|general -plasmawallpaperviewer=plasmate|general -plasmoidviewer=plasmate|general - -#KDE Plasma Desktop (KWin) -kwin_x11=kwin|general -kwin_wayland=kwin|general -kwin_gles=kwin|general -kwinactive=kwin|general -kwinactive_gles=kwin|general - -#KDE Kontact (Akonadi) -akonadi_archivemail_agent=Akonadi|Archive Mail Agent -akonadi_benchmarker=Akonadi|general -akonadi_birthdays_resource=Akonadi|general -akonadi_contacts_resource=Akonadi|Contacts resource -akonadi_control=Akonadi|general -akonadi_davgroupware_resource=Akonadi|DAV Resource -akonadi_distlist_resource=Akonadi|general -akonadi_facebook_resource=Akonadi|Facebook Resource -akonadi_gcal_resource=Akonadi|Google Resource -akonadi_googledata_resource=Akonadi|GoogleData Resource -akonadi_googlecalendar_resource=Akonadi|Google Resource -akonadi_googlecontacts_resource=Akonadi|Google Resource -akonadi_ical_resource=Akonadi|ICal file resource -akonadi_imap_resource=Akonadi|IMAP resource -akonadi_kabc_resource=Akonadi|KResource compat Bridges -akonadi_kcal_resource=Akonadi|KResource compat Bridges -akonadi_knut_resource=Akonadi|Knut resource -akonadi_kolabproxy_resource=Akonadi|Kolab resource -akonadi_localbookmarks_resource=Akonadi|Local Bookmark Resource -akonadi_maildir_resource=Akonadi|Maildir Resource -akonadi_maildispatcher_agent=Akonadi|Mail Dispatcher Agent -akonadi_mailfilter_agent=Akonadi|Mail Filter Agent -akonadi_mailthreader_agent=Akonadi|general -akonadi_mixedmaildir_resource=Akonadi|Mixed Maildir resource -akonadi_nntp_resource=Akonadi|general -akonadi_pop3_resource=Akonadi|POP3 Resource -akonadi_strigi_feeder=Akonadi|general -akonadi_sendlater_agent=Akonadi|SendLaterAgent -akonadi_vcard_resource=Akonadi|VCard file resource -akonadi_vcarddir_resource=Akonadi|VCard dir resource -akonadiconsole=Akonadi|akonadiconsole -akonadictl=Akonadi|general -akonadiserver=Akonadi|server -akonaditest=Akonadi|general -akonaditray=Akonadi|general -accountwizard=Akonadi|Account Wizard -kres-migrator=Akonadi|Migration -akonadi_openxchange_resource=Akonadi|OpenXchange Resource -akonadi_newmailnotifier_agent=Akonadi|New Mail Notifier - -#KDE Kontact (PIM) -importwizard=kdepim|importwizard -kalarmautostart=kalarm|general -kpilotDaemon=kpilot|kpilotDaemon -korgac=korgac|general -kmail=kmail2|general -kmail-migrator=kmail2|general -kaddressbook-mobile=KDE PIM Mobile|general -backupmail=kdepim|backupmail - - -#KDE Konqueror -kjscmd=konqueror|kjs -nspluginscan=konqueror|nsplugins -nspluginviewer=konqueror|nspluginviewer - -# KDE Telepathy -ktp-contactlist=telepathy|contactlist -ktp-send-file=telepathy|send-file -ktp-text-ui=telepathy|text-ui -ktp-call-ui=telepathy|call-ui -ktp-filetransfer-handler=telepathy|filetransfer-handler -ktp-auth-handler=telepathy|auth-handler -ktp-log-viewer=telepathy|log-viewer - -# KDE Calligra Suite -braindump=braindump|application -kritagemini=krita|general -kritasketch=krita|krita sketch - - -# KDE Kipi-plugins -dngconverter=kipiplugins|DngConverter -expoblending=kipiplugins|ExpoBlending -panoramagui=kipiplugins|Panorama -photolayoutseditor=kipiplugins|PhotoLayoutsEditor -scangui=kipiplugins|AcquireImages - - -# Gluon -gluoncreator=gluon|gluoncreator -gluon_kdeplayer=gluon|gluonplayer -gluon_kdeextplayer=gluon|gluonplayer - -#Other KDE Applications and Technologies -kmixctrl=kmix|general -kwrite=kate|kwrite -dragon=dragonplayer|general -kaccess=systemsettings|kcm_accessibility -kfontinst=systemsettings|kcm_fontinst -kfontview=systemsettings|kcm_fontinst -polkit-kde-manager=policykit-kde|manager -polkit-kde-authentication-agent-1=policykit-kde|polkit-kde-authentication-agent-1 -kepastray=kepas|general -apper-sentinel=apper|general -muon=muon|muon -muon-discover=muon|discover -muon-installer=muon|installer -muon-updater=muon|updater -printer-applet-kde=printer-applet|general -kde-add-printer=print-manager|general -kde-print-queue=print-manager|general -partitionmanager-bin=partitionmanager|general -krandrtray=krandr|krandrtray -kmymoney=kmymoney4|general -kdevdesigner=kdevelop|Qt Designer Integration -kdevelop.bin=kdevelop|general -kscreenlocker=kscreensaver|locker -gwenview_importer=gwenview|importer -kdmgreet=kdm|general -kaffeine-xbu=kaffeine|general -networkmanagement_configshell=Network Management|general -krcdnotifieritem=kremotecontrol|tray -khipu=khipu|core -mangonel=Mangonel|mangonel -kde-nm-connection-editor=plasma-nm|editor -pairseditor=pairs|editor -kdeconnectd=kdeconnect|common - -kwatchgnupg=kleopatra|general -homerunviewer=homerun|general - -ksecretsync=ksecretservice|ksecretsync -cvsservice=cervisia|general - - -# applicaitons not using bugs.kde.org -aku=unknown|general -compiz=unknown|general -firefox=unknown|general -firefox-bin=unknown|general -iqfile=unknown|general -kanyremote=unknown|general -kde4-window-decorator=unknown|general -kdesudo=unknown|general -kdialogd4=unknown|general -kguitar=unknown|general -klog=unknown|general -klog-bin=unknown|general -kmozillahelper=unknown|general -konstructor=unknown|general -kraft=unknown|general -kuroo=unknown|general -kvirc=unknown|general -loopy=unknown|general -leechcraft=unknown|general -nateon=unknown|general -opera=unknown|general -pcSoftwareManager=unknown|general -qutim=unknown|general -semantik=unknown|general -squeeze=unknown|general -subtitlecomposer=unknown|general -synaptiks=unknown|general -shaman=unknown|general -tribe=unknown|general -xulrunner-stub=unknown|general - -#--- -#This section relates a product groupt to a product -#--- - -[ProductGroup] -kontact=kdepim-base|kdepim-apps -korganizer=kdepim-base -kaddressbook=kdepim-base -akregator=kdepim-base -kmail=kdepim-base -KMail 2=kdepim-base -Akonadi=kdepim-base -kword=koffice -koshell=koffice -kdevelop=kdevelop -kdevdesigner=kdevelop -plasma=kdebindings -amarok=multimedia -digikam=imaging -gwenview=imaging -kaffeine=multimedia -juk=multimedia -knetworkmanager=networkmanager -Skanlite=scanner -konqueror=filemanagement -kcells=koffice -kplato=calligraplan -kpresenter=calligrastage -kspread=calligratables - -#--- -#This section describes several bugzilla products groups. -#--- - -[BZGroups] -kdeplatform=kde|kdelibs|kio|kfile|Oxygen|solid|Phonon|Akonadi -kdepim-base=kontact|kdepimlibs|kdepim|kresources|konqueror -kdepim-apps=kontact|korganizer|kaddressbook|akregator|kmail -koffice=koffice|koshell|kspread|kword|krita|karbon|kchart|kplato|kpresenter -kdevelop=kdevelop|kdevplatform -kdebindings=bindings -multimedia=kdemultimedia|taglib -imaging=digikam|digikamimageplugins|kipiplugins -networkmanager=knetworkmanager|Network Management|solid -scanner=libksane -filemanagement=konqueror|dolphin diff --git a/drkonqi/debugger.cpp b/drkonqi/debugger.cpp deleted file mode 100644 index 04c00831e..000000000 --- a/drkonqi/debugger.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "debugger.h" - -#include -#include -#include -#include - -#include "crashedapplication.h" -#include "drkonqi.h" - -//static -QList Debugger::availableInternalDebuggers(const QString & backend) -{ - return availableDebuggers(QStringLiteral("debuggers/internal"), backend); -} - -//static -QList Debugger::availableExternalDebuggers(const QString & backend) -{ - return availableDebuggers(QStringLiteral("debuggers/external"), backend); -} - -bool Debugger::isValid() const -{ - return m_config; -} - -bool Debugger::isInstalled() const -{ - QString tryexec = tryExec(); - return !tryexec.isEmpty() && !QStandardPaths::findExecutable(tryexec).isEmpty(); -} - -QString Debugger::name() const -{ - return isValid() ? m_config->group("General").readEntry("Name") : QString(); -} - -QString Debugger::codeName() const -{ - //fall back to the "TryExec" string if "CodeName" is not specified. - //for most debuggers those strings should be the same - return isValid() ? m_config->group("General").readEntry("CodeName", tryExec()) : QString(); -} - -QString Debugger::tryExec() const -{ - return isValid() ? m_config->group("General").readEntry("TryExec") : QString(); -} - -QStringList Debugger::supportedBackends() const -{ - return isValid() ? m_config->group("General").readEntry("Backends") - .split('|', QString::SkipEmptyParts) : QStringList(); -} - -void Debugger::setUsedBackend(const QString & backendName) -{ - if (supportedBackends().contains(backendName)) { - m_backend = backendName; - } -} - -QString Debugger::command() const -{ - if (!isValid() || !m_config->hasGroup(m_backend)) { - return QString(); - } else { - return m_config->group(m_backend).readPathEntry("Exec", QString()); - } -} - -QString Debugger::backtraceBatchCommands() const -{ - if (!isValid() || !m_config->hasGroup(m_backend)) { - return QString(); - } else { - return m_config->group(m_backend).readEntry("BatchCommands"); - } -} - -bool Debugger::runInTerminal() const -{ - if (!isValid() || !m_config->hasGroup(m_backend)) { - return false; - } else { - return m_config->group(m_backend).readEntry("Terminal", false); - } -} - -//static -void Debugger::expandString(QString & str, ExpandStringUsage usage, const QString & tempFile) -{ - const CrashedApplication *appInfo = DrKonqi::crashedApplication(); - QHash map; - map[QLatin1String("progname")] = appInfo->name(); - map[QLatin1String("execname")] = appInfo->fakeExecutableBaseName(); - map[QLatin1String("execpath")] = appInfo->executable().absoluteFilePath(); - map[QLatin1String("signum")] = QString::number(appInfo->signalNumber()); - map[QLatin1String("signame")] = appInfo->signalName(); - map[QLatin1String("pid")] = QString::number(appInfo->pid()); - map[QLatin1String("tempfile")] = tempFile; - map[QLatin1String("thread")] = QString::number(appInfo->thread()); - - if (usage == ExpansionUsageShell) { - str = KMacroExpander::expandMacrosShellQuote(str, map); - } else { - str = KMacroExpander::expandMacros(str, map); - } -} - -//static -QList Debugger::availableDebuggers(const QString & path, const QString & backend) -{ - QString debuggerDir = QStandardPaths::locate(QStandardPaths::DataLocation, path, QStandardPaths::LocateDirectory); - QStringList debuggers = QDir(debuggerDir).entryList(QDir::Files); - - QList result; - foreach (const QString & debuggerFile, debuggers) { - Debugger debugger; - debugger.m_config = KSharedConfig::openConfig(debuggerDir +'/'+ debuggerFile); - if (debugger.supportedBackends().contains(backend)) { - debugger.setUsedBackend(backend); - result.append(debugger); - } - } - return result; -} diff --git a/drkonqi/debugger.h b/drkonqi/debugger.h deleted file mode 100644 index 69cf95863..000000000 --- a/drkonqi/debugger.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef DEBUGGER_H -#define DEBUGGER_H - -#include - -#include - -class Debugger -{ -public: - static QList availableInternalDebuggers(const QString & backend); - static QList availableExternalDebuggers(const QString & backend); - - /** Returns true if this Debugger instance is valid, or false otherwise. - * Debugger instances are valid only if they have been constructed from - * availableInternalDebuggers() or availableExternalDebuggers(). If they - * have been constructed directly using the Debugger constructor, they are invalid. - */ - bool isValid() const; - - /** Returns true if this debugger is installed. This is determined by - * looking for the executable that tryExec() returns. If it is in $PATH, - * this method returns true. - */ - bool isInstalled() const; - - /** Returns the translatable name of the debugger (eg. "GDB") */ - QString name() const; - - /** Returns the code name of the debugger (eg. "gdb"). */ - QString codeName() const; - - /** Returns the executable name that drkonqi should check if it exists - * to determine whether the debugger is installed - */ - QString tryExec() const; - - /** Returns a list with the drkonqi backends that this debugger supports */ - QStringList supportedBackends() const; - - /** Sets the backend to be used. This function must be called before using - * command(), backtraceBatchCommands() or runInTerminal(). - */ - void setUsedBackend(const QString & backendName); - - /** Returns the command that should be run to use the debugger */ - QString command() const; - - /** Returns the commands that should be given to the debugger when - * run in batch mode in order to generate a backtrace - */ - QString backtraceBatchCommands() const; - - /** If this is an external debugger, it returns whether it should be run in a terminal or not */ - bool runInTerminal() const; - - - enum ExpandStringUsage { - ExpansionUsagePlainText, - ExpansionUsageShell - }; - - static void expandString(QString & str, ExpandStringUsage usage = ExpansionUsagePlainText, - const QString & tempFile = QString()); - -private: - static QList availableDebuggers(const QString &path, const QString & backend); - KSharedConfig::Ptr m_config; - QString m_backend; -}; - -#endif diff --git a/drkonqi/debuggerlaunchers.cpp b/drkonqi/debuggerlaunchers.cpp deleted file mode 100644 index a0d7a33fb..000000000 --- a/drkonqi/debuggerlaunchers.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "debuggerlaunchers.h" - -#include - -#include -#include -#include - -#include "detachedprocessmonitor.h" -#include "drkonqi.h" -#include "crashedapplication.h" - -DefaultDebuggerLauncher::DefaultDebuggerLauncher(const Debugger & debugger, DebuggerManager *parent) - : AbstractDebuggerLauncher(parent), m_debugger(debugger) -{ - m_monitor = new DetachedProcessMonitor(this); - connect(m_monitor, &DetachedProcessMonitor::processFinished, this, &DefaultDebuggerLauncher::onProcessFinished); -} - -QString DefaultDebuggerLauncher::name() const -{ - return m_debugger.name(); -} - -void DefaultDebuggerLauncher::start() -{ - if ( qobject_cast(parent())->debuggerIsRunning() ) { - qWarning() << "Another debugger is already running"; - return; - } - - QString str = m_debugger.command(); - Debugger::expandString(str, Debugger::ExpansionUsageShell); - - emit starting(); - int pid = KProcess::startDetached(KShell::splitArgs(str)); - if ( pid > 0 ) { - m_monitor->startMonitoring(pid); - } else { - qWarning() << "Could not start debugger:" << name(); - emit finished(); - } -} - -void DefaultDebuggerLauncher::onProcessFinished() -{ - emit finished(); -} - -#if 0 -TerminalDebuggerLauncher::TerminalDebuggerLauncher(const Debugger & debugger, DebuggerManager *parent) - : DefaultDebuggerLauncher(debugger, parent) -{ -} - -void TerminalDebuggerLauncher::start() -{ - DefaultDebuggerLauncher::start(); //FIXME -} -#endif - - -DBusOldInterfaceLauncher::DBusOldInterfaceLauncher(DebuggerManager *parent) - : AbstractDebuggerLauncher(parent) -{ - m_adaptor = new DBusOldInterfaceAdaptor(this); - QDBusConnection::sessionBus().registerObject(QStringLiteral("/krashinfo"), this); -} - -QString DBusOldInterfaceLauncher::name() const -{ - return m_name; -} - -void DBusOldInterfaceLauncher::start() -{ - emit starting(); - emit m_adaptor->acceptDebuggingApplication(); -} - - -DBusOldInterfaceAdaptor::DBusOldInterfaceAdaptor(DBusOldInterfaceLauncher *parent) - : QDBusAbstractAdaptor(parent) -{ - Q_ASSERT(parent); -} - -int DBusOldInterfaceAdaptor::pid() -{ - return DrKonqi::crashedApplication()->pid(); -} - -void DBusOldInterfaceAdaptor::registerDebuggingApplication(const QString & name) -{ - if ( static_cast(parent())->m_name.isEmpty() && !name.isEmpty() ) { - static_cast(parent())->m_name = name; - emit static_cast(parent())->available(); - } -} - - diff --git a/drkonqi/debuggerlaunchers.h b/drkonqi/debuggerlaunchers.h deleted file mode 100644 index 5f086c92d..000000000 --- a/drkonqi/debuggerlaunchers.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef DEBUGGERLAUNCHERS_H -#define DEBUGGERLAUNCHERS_H - -#include - -#include "debugger.h" -#include "debuggermanager.h" - -class DetachedProcessMonitor; - -class AbstractDebuggerLauncher : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString name READ name) -public: - explicit AbstractDebuggerLauncher(DebuggerManager *parent = 0) : QObject(parent) {} - virtual QString name() const = 0; - -public Q_SLOTS: - virtual void start() = 0; - -Q_SIGNALS: - void starting(); - void finished(); - void invalidated(); -}; - -class DefaultDebuggerLauncher : public AbstractDebuggerLauncher -{ - Q_OBJECT -public: - explicit DefaultDebuggerLauncher(const Debugger & debugger, DebuggerManager *parent = 0); - QString name() const override; - -public Q_SLOTS: - void start() override; - -private Q_SLOTS: - void onProcessFinished(); - -private: - const Debugger m_debugger; - DetachedProcessMonitor *m_monitor; -}; - -#if 0 -class TerminalDebuggerLauncher : public DefaultDebuggerLauncher -{ - Q_OBJECT -public: - explicit TerminalDebuggerLauncher(const Debugger & debugger, DebuggerManager *parent = 0); - -public slots: - virtual void start(); -}; -#endif - -class DBusOldInterfaceAdaptor; - -/** This class handles the old drkonqi dbus interface used by kdevelop */ -class DBusOldInterfaceLauncher : public AbstractDebuggerLauncher -{ - Q_OBJECT - friend class DBusOldInterfaceAdaptor; -public: - explicit DBusOldInterfaceLauncher(DebuggerManager *parent = 0); - QString name() const override; - -public Q_SLOTS: - void start() override; - -Q_SIGNALS: - void available(); - -private: - QString m_name; - DBusOldInterfaceAdaptor *m_adaptor; -}; - -class DBusOldInterfaceAdaptor : public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "org.kde.Krash") - friend class DBusOldInterfaceLauncher; -public: - explicit DBusOldInterfaceAdaptor(DBusOldInterfaceLauncher *parent); - -public Q_SLOTS: - int pid(); - Q_NOREPLY void registerDebuggingApplication(const QString & name); - -Q_SIGNALS: - void acceptDebuggingApplication(); -}; - -#endif // DEBUGGERLAUNCHERS_H diff --git a/drkonqi/debuggermanager.cpp b/drkonqi/debuggermanager.cpp deleted file mode 100644 index 7c9305b61..000000000 --- a/drkonqi/debuggermanager.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "debuggermanager.h" - -#include - -#include "debugger.h" -#include "debuggerlaunchers.h" -#include "backtracegenerator.h" - -struct DebuggerManager::Private -{ - BacktraceGenerator *btGenerator; - bool debuggerRunning; - QList externalDebuggers; - DBusOldInterfaceLauncher *dbusOldInterfaceLauncher; -}; - -DebuggerManager::DebuggerManager(const Debugger & internalDebugger, - const QList & externalDebuggers, - QObject *parent) - : QObject(parent), d(new Private) -{ - d->debuggerRunning = false; - d->btGenerator = new BacktraceGenerator(internalDebugger, this); - connect(d->btGenerator, &BacktraceGenerator::starting, this, &DebuggerManager::onDebuggerStarting); - connect(d->btGenerator, &BacktraceGenerator::done, this, &DebuggerManager::onDebuggerFinished); - connect(d->btGenerator, &BacktraceGenerator::someError, this, &DebuggerManager::onDebuggerFinished); - connect(d->btGenerator, &BacktraceGenerator::failedToStart, this, &DebuggerManager::onDebuggerFinished); - - foreach(const Debugger & debugger, externalDebuggers) { - if (debugger.isInstalled()) { - AbstractDebuggerLauncher *l = new DefaultDebuggerLauncher(debugger, this); //FIXME - d->externalDebuggers.append(l); - connect(l, &AbstractDebuggerLauncher::starting, this, &DebuggerManager::onDebuggerStarting); - connect(l, &AbstractDebuggerLauncher::finished, this, &DebuggerManager::onDebuggerFinished); - connect(l, &AbstractDebuggerLauncher::invalidated, this, &DebuggerManager::onDebuggerInvalidated); - } - } - - //setup kdevelop compatibility - d->dbusOldInterfaceLauncher = new DBusOldInterfaceLauncher(this); - connect(d->dbusOldInterfaceLauncher, &DBusOldInterfaceLauncher::starting, this, &DebuggerManager::onDebuggerStarting); - connect(d->dbusOldInterfaceLauncher, &DBusOldInterfaceLauncher::available, this, &DebuggerManager::onDBusOldInterfaceDebuggerAvailable); -} - -DebuggerManager::~DebuggerManager() -{ - if (d->btGenerator->state() == BacktraceGenerator::Loading) { - //if the debugger is running, kill it and continue the process. - delete d->btGenerator; - onDebuggerFinished(); - } - - delete d; -} - -bool DebuggerManager::debuggerIsRunning() const -{ - return d->debuggerRunning; -} - -bool DebuggerManager::showExternalDebuggers() const -{ - KConfigGroup config(KSharedConfig::openConfig(), "DrKonqi"); - return config.readEntry("ShowDebugButton", false); -} - -QList DebuggerManager::availableExternalDebuggers() const -{ - return d->externalDebuggers; -} - -BacktraceGenerator* DebuggerManager::backtraceGenerator() const -{ - return d->btGenerator; -} - -void DebuggerManager::onDebuggerStarting() -{ - d->debuggerRunning = true; - emit debuggerStarting(); - emit debuggerRunning(true); -} - -void DebuggerManager::onDebuggerFinished() -{ - d->debuggerRunning = false; - emit debuggerFinished(); - emit debuggerRunning(false); -} - -void DebuggerManager::onDebuggerInvalidated() -{ - AbstractDebuggerLauncher *launcher = qobject_cast(sender()); - Q_ASSERT(launcher); - int index = d->externalDebuggers.indexOf(launcher); - Q_ASSERT(index >= 0); - d->externalDebuggers.removeAt(index); - emit externalDebuggerRemoved(launcher); -} - -void DebuggerManager::onDBusOldInterfaceDebuggerAvailable() -{ - d->externalDebuggers.append(d->dbusOldInterfaceLauncher); - emit externalDebuggerAdded(d->dbusOldInterfaceLauncher); -} - - diff --git a/drkonqi/debuggermanager.h b/drkonqi/debuggermanager.h deleted file mode 100644 index 5dd423ee8..000000000 --- a/drkonqi/debuggermanager.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef DEBUGGERMANAGER_H -#define DEBUGGERMANAGER_H - -#include - -class BacktraceGenerator; -class Debugger; -class AbstractDebuggerLauncher; - -class DebuggerManager : public QObject -{ - Q_OBJECT -public: - DebuggerManager(const Debugger & internalDebugger, - const QList & externalDebuggers, - QObject *parent = 0); - ~DebuggerManager() override; - - bool debuggerIsRunning() const; - bool showExternalDebuggers() const; - QList availableExternalDebuggers() const; - BacktraceGenerator *backtraceGenerator() const; - -Q_SIGNALS: - void debuggerStarting(); - void debuggerFinished(); - void debuggerRunning(bool running); - void externalDebuggerAdded(AbstractDebuggerLauncher *launcher); - void externalDebuggerRemoved(AbstractDebuggerLauncher *launcher); - -private Q_SLOTS: - void onDebuggerStarting(); - void onDebuggerFinished(); - void onDebuggerInvalidated(); - void onDBusOldInterfaceDebuggerAvailable(); - -private: - struct Private; - Private *const d; -}; - -#endif // DEBUGGERMANAGER_H diff --git a/drkonqi/debugpackageinstaller.cpp b/drkonqi/debugpackageinstaller.cpp deleted file mode 100644 index 92afa1124..000000000 --- a/drkonqi/debugpackageinstaller.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************* -* debugpackageinstaller.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include - -#include "debugpackageinstaller.h" - -#include -#include -#include -#include - -#include "drkonqi.h" -#include "crashedapplication.h" - -DebugPackageInstaller::DebugPackageInstaller(QObject *parent) - : QObject(parent), m_installerProcess(0), m_progressDialog(0) -{ - m_executablePath = QStandardPaths::findExecutable(DEBUG_PACKAGE_INSTALLER_NAME); //defined from CMakeLists.txt -} - -bool DebugPackageInstaller::canInstallDebugPackages() const -{ - return !m_executablePath.isEmpty(); -} - -void DebugPackageInstaller::setMissingLibraries(const QStringList & libraries) -{ - m_missingLibraries = libraries; -} - -void DebugPackageInstaller::installDebugPackages() -{ - Q_ASSERT(canInstallDebugPackages()); - - if (!m_installerProcess) { - //Run process - m_installerProcess = new KProcess(this); - connect(m_installerProcess, QOverload::of(&KProcess::finished), - this, &DebugPackageInstaller::processFinished); - - *m_installerProcess << m_executablePath - << DrKonqi::crashedApplication()->executable().absoluteFilePath() - << m_missingLibraries; - m_installerProcess->start(); - - //Show dialog - m_progressDialog = new QProgressDialog(i18nc("@info:progress", "Requesting installation of missing " "debug symbols packages..."), i18n("Cancel"), 0, 0, qobject_cast(parent())); - connect(m_progressDialog, &QProgressDialog::canceled, this, &DebugPackageInstaller::progressDialogCanceled); - m_progressDialog->setWindowTitle(i18nc("@title:window", "Missing debug symbols")); - m_progressDialog->show(); - } -} - -void DebugPackageInstaller::progressDialogCanceled() -{ - m_progressDialog->deleteLater(); - m_progressDialog = 0; - - if (m_installerProcess) { - if (m_installerProcess->state() == QProcess::Running) { - disconnect(m_installerProcess, QOverload::of(&KProcess::finished), - this, &DebugPackageInstaller::processFinished); - m_installerProcess->kill(); - disconnect(m_installerProcess, QOverload::of(&KProcess::finished), - m_installerProcess, &KProcess::deleteLater); - } - m_installerProcess = 0; - } - - emit canceled(); -} - -void DebugPackageInstaller::processFinished(int exitCode, QProcess::ExitStatus) -{ - switch(exitCode) { - case ResultInstalled: - { - emit packagesInstalled(); - break; - } - case ResultSymbolsNotFound: - { - emit error(i18nc("@info", "Could not find debug symbol packages for this application.")); - break; - } - case ResultCanceled: - { - emit canceled(); - break; - } - case ResultError: - default: - { - emit error(i18nc("@info", "An error was encountered during the installation " - "of the debug symbol packages.")); - break; - } - } - - m_progressDialog->reject(); - - delete m_progressDialog; - m_progressDialog = 0; - - delete m_installerProcess; - m_installerProcess = 0; -} diff --git a/drkonqi/debugpackageinstaller.h b/drkonqi/debugpackageinstaller.h deleted file mode 100644 index d8ca0d74a..000000000 --- a/drkonqi/debugpackageinstaller.h +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************* -* debugpackageinstaller.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ -#ifndef DEBUGPACKAGEINSTALLER__H -#define DEBUGPACKAGEINSTALLER__H - -#include -#include - -class KProcess; -class QProgressDialog; - -class DebugPackageInstaller: public QObject -{ - Q_OBJECT - - enum Results { ResultInstalled = 0, ResultError = 1, - ResultSymbolsNotFound = 2, ResultCanceled = 3 }; - - public: - explicit DebugPackageInstaller(QObject *parent = 0); - bool canInstallDebugPackages() const; - void setMissingLibraries(const QStringList &); - void installDebugPackages(); - - private Q_SLOTS: - void processFinished(int, QProcess::ExitStatus); - void progressDialogCanceled(); - - Q_SIGNALS: - void packagesInstalled(); - void error(const QString &); - void canceled(); - - private: - KProcess * m_installerProcess; - QProgressDialog * m_progressDialog; - QString m_executablePath; - QStringList m_missingLibraries; -}; - -#endif diff --git a/drkonqi/detachedprocessmonitor.cpp b/drkonqi/detachedprocessmonitor.cpp deleted file mode 100644 index 8c03f508b..000000000 --- a/drkonqi/detachedprocessmonitor.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "detachedprocessmonitor.h" - -#include -#include - -#include -#include - -DetachedProcessMonitor::DetachedProcessMonitor(QObject *parent) - : QObject(parent), m_pid(0) -{ -} - -void DetachedProcessMonitor::startMonitoring(int pid) -{ - m_pid = pid; - startTimer(10); -} - -void DetachedProcessMonitor::timerEvent(QTimerEvent *event) -{ - Q_ASSERT(m_pid != 0); - if (::kill(m_pid, 0) < 0) { - qDebug() << "Process" << m_pid << "finished. kill(2) returned errno:" << errno; - killTimer(event->timerId()); - m_pid = 0; - emit processFinished(); - } -} - - diff --git a/drkonqi/detachedprocessmonitor.h b/drkonqi/detachedprocessmonitor.h deleted file mode 100644 index 12ae2e892..000000000 --- a/drkonqi/detachedprocessmonitor.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef DETACHEDPROCESSMONITOR_H -#define DETACHEDPROCESSMONITOR_H - -#include - -class DetachedProcessMonitor : public QObject -{ - Q_OBJECT -public: - explicit DetachedProcessMonitor(QObject *parent = 0); - void startMonitoring(int pid); - -Q_SIGNALS: - void processFinished(); - -protected: - void timerEvent(QTimerEvent *) override; - -private: - int m_pid; -}; - -#endif diff --git a/drkonqi/doc/debug_package_installer.txt b/drkonqi/doc/debug_package_installer.txt deleted file mode 100644 index ce1178da3..000000000 --- a/drkonqi/doc/debug_package_installer.txt +++ /dev/null @@ -1,86 +0,0 @@ -This version of DrKonqi supports automatic installation of debug symbols packages -when it finds that debug symbols are missing. This document is to explain what is -needed from packagers to do in order to enable this functionality for their distribution. - -If your distribution does not ship packages with debug symbols you can safely ignore -the rest of this document. In this case, DrKonqi will not offer the ability to install -debug symbol packages. - -If your distribution does ship packages with debug symbols, then in order for DrKonqi -to offer the ability to install them automatically, you need to provide a script that -will do the work. This is because the packaging systems vary a lot among different -distributions and DrKonqi cannot implement distro-specific functionality in its main -code for all distributions. - -Please note that I chose to use the word "script" here having in mind a shell script, -but you may as well provide a python script, a perl script, or whatever else, even a -compiled binary written in any language you want. DrKonqi will use KProcess for -launching it, so as long as it is executable, it will work. - - -Name of the script -================== -By default DrKonqi looks for a shell script called "installdbgsymbols.sh". It expects -it to be in PATH, or somewhere that it is possible to be located by KStandardDirs::findExe(). -For example, the path where DrKonqi itself is installed (`kde4-config --path libexec`), -is a valid path to install this script, although it is not in PATH. - -If you wish to provide a script with a different name, you can change the name by setting -the cmake variable DEBUG_PACKAGE_INSTALLER_NAME to the name that you want. For example, -configuring kdebase-runtime with: - - cmake -DDEBUG_PACKAGE_INSTALLER_NAME="installdbgsymbols.py" - -will use "installdbgsymbols.py" as the script for installing debug packages. - - -Interface of the script -======================= - -1. Arguments ------------- -The script is called with arguments all the filenames of the binaries that are clearly -missing symbols. The first argument (argv[1]) is always supplied and is the path to -the executable that crashed itself. The rest of the arguments are optional and are filenames -of libraries that are missing symbols (for example, "/usr/lib/libkio.so.5"). All the -paths are absolute, but they will probably point to symlinks (at least for libraries). -The paths are taken from gdb. For each stack frame that is missing details, if gdb can -tell where is this symbol from, the path to the library that gdb specifies is passed -as is to the script. Note that for applications that were launched via kdeinit, argv[1] -is the path to kdeinit4, not the path to the executable that would be launched if there -was no kdeinit involved. - -2. Return values ----------------- -0 - Debug packages installed successfully -1 - Some kind of error was encountered -2 - Debug symbols not found -3 - User canceled the operation - - -Testing -======= -In order to test your script you can try the following: -1) Find a kde application and remove its debug symbols package. I will use konqueror - in this example. -2) Run the application and then kill it with a signal that drkonqi can catch. - For example, "killall -6 konqueror". -3) In drkonqi's main dialog, switch to the "Backtrace" tab and wait for it to - generate a backtrace. -4) After the backtrace has been generated, if drkonqi can find your script, a button - saying "Install debug symbols" will appear in the bottom left side of the backtrace tab. -5) Click on it and your script will be launched. - - -Examples -======== -I have written example scripts for Debian, OpenSuSE and Fedora, which are available -in the examples/ subdirectory of the drkonqi source code directory. These were -developed as a proof of concept, to test that this script model and interface will -work for most distributions. You may use them as is, or you may use them as references -to write your own scripts. Just note that I am not going to maintain those scripts -or fix bugs in them. - --- -George Kiagiadakis -Last updated: 25 Semptember 2009 diff --git a/drkonqi/doc/examples/installdbgsymbols_debian.sh b/drkonqi/doc/examples/installdbgsymbols_debian.sh deleted file mode 100644 index e1eaa552a..000000000 --- a/drkonqi/doc/examples/installdbgsymbols_debian.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2009 George Kiagiadakis -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# This function runs a command in a terminal -# The first argument ($1) must be the full command to run. -# It returns 0 if the command finished or 1 if the user closed -# the terminal without waiting for the command to finish. -# The return value of the command is saved in the $exit_status variable. -run_in_terminal() -{ - local fifo=/tmp/drkonqi-fifo-$$ - mkfifo $fifo - - # start terminal - x-terminal-emulator -e sh -c "echo \$\$ > $fifo; $1; exit_status=\$?; sleep 1; rm $fifo; echo \$exit_status > $fifo" & - - # wait for it to finish - local pid=`cat $fifo` - while [ "$?" = "0" ]; do - sleep 1 - kill -0 $pid 2>/dev/null - done - - # check if terminal has finished succesfully and return the command's exit status - local canceled=0 - if [ -p $fifo ]; then - # terminal was closed before finishing execution - canceled=1 - else - exit_status=`cat $fifo` - #echo "\"$1\" returned: $exit_status" - fi - rm $fifo - return $canceled -} - -# check for availability of kdialog -which kdialog >/dev/null -if [ "$?" != "0" ]; then - xmessage -center "Could not find kdialog (part of kdebase). Please install kdialog and try again." - exit 1 -fi - -# check misc script dependencies -check_dep() -{ - which $1 >/dev/null - if [ "$?" != "0" ]; then - kdialog --sorry "$1 was not found on your system. Please install $1 and try again." - exit 1 - fi -} - -check_dep apt-file -check_dep qdbus - -# update apt-file database -run_in_terminal "apt-file update" - -if [ "$?" = "1" ]; then - exit 3 -elif [ "$exit_status" != "0" ]; then - kdialog --sorry "apt-file failed to update package lists." - exit 1 -fi - -# start searching for packages -packages="" -progress_counter=0 -dbus_handle=`kdialog --progressbar "Searching for packages that contain the requested debug symbols..." $#` - -while [ "$1" != "" ]; -do - # dereference symlinks - cur_file=$1 - while [ -L "$cur_file" ]; do - cur_file="`dirname $cur_file`/`ls -l $cur_file | cut -d ' ' -f 10`" - done - - # look for the package - expr match "$cur_file" ".*libQt.*" >/dev/null - if [ "$?" = "0" ]; then - # HACK for Qt, which doesn't install debug symbols in /usr/lib/debug like everybody else - package="libqt4-dbg" - else - package=`apt-file search --non-interactive --package-only --fixed-string "/usr/lib/debug$cur_file"` - fi - packages="$packages $package" - - # update progress dialog - progress_counter=$(($progress_counter+1)) - qdbus $dbus_handle Set org.kde.kdialog.ProgressDialog value $progress_counter - - # check if dialog was closed - if [ "$?" != "0" ]; then - exit 3 - fi - - shift -done - -# filter out duplicates -packages=`echo "$packages" | tr " " "\n" | sort | uniq | tr "\n" " "` - -# close the progress dialog -qdbus $dbus_handle close - -# if there are no packages to install, exit -trimmed_packages=`echo $packages | tr -d "[:blank:]"` -if [ -z "$trimmed_packages" ]; then - exit 2 # note that we don't need to display an error message here. drkonqi will do it for us. -fi - -kdialog --yesno "You need to install the following packages: $packages -Would you like drkonqi to attempt to install them now?" - -if [ "$?" = "0" ]; then - # determine package manager - package_manager=aptitude - which $package_manager >/dev/null - if [ "$?" != "0" ]; then - package_manager=apt-get - fi - - run_in_terminal "su-to-root -c '$package_manager install $packages'" - - if [ "$?" = "1" ]; then - exit 3 - elif [ "$exit_status" = "0" ]; then - exit 0 - else - exit 1 - fi -else - exit 3 -fi diff --git a/drkonqi/doc/examples/installdbgsymbols_fedora.sh b/drkonqi/doc/examples/installdbgsymbols_fedora.sh deleted file mode 100644 index 4a1254ab0..000000000 --- a/drkonqi/doc/examples/installdbgsymbols_fedora.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2009 George Kiagiadakis -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# This function runs a command in a terminal -# The first argument ($1) must be the full command to run. -# It returns 0 if the command finished or 1 if the user closed -# the terminal without waiting for the command to finish. -# The return value of the command is saved in the $exit_status variable. -run_in_terminal() -{ - local fifo=/tmp/drkonqi-fifo-$$ - mkfifo $fifo - - # start terminal - konsole -e sh -c "echo \$\$ > $fifo; $1; exit_status=\$?; sleep 1; rm $fifo; echo \$exit_status > $fifo" & - - # wait for it to finish - local pid=`cat $fifo` - while [ "$?" = "0" ]; do - sleep 1 - kill -0 $pid 2>/dev/null - done - - # check if terminal has finished succesfully and return the command's exit status - local canceled=0 - if [ -p $fifo ]; then - # terminal was closed before finishing execution - canceled=1 - else - exit_status=`cat $fifo` - #echo "\"$1\" returned: $exit_status" - fi - rm $fifo - return $canceled -} - -# check misc script dependencies -check_dep() -{ - which $1 >/dev/null - if [ "$?" != "0" ]; then - # check for availability of kdialog - which kdialog >/dev/null - if [ "$?" != "0" ]; then - xmessage -center "$1 was not found on your system. Please install $1 and try again." - else - kdialog --sorry "$1 was not found on your system. Please install $1 and try again." - fi - exit 1 - fi -} - -check_dep debuginfo-install -check_dep konsole - -# start searching for packages -packages="" -while [ "$1" != "" ]; -do - package=`rpm -q --whatprovides "$1" --queryformat "%{NAME}"` - packages="$packages $package" - shift -done - -# filter out duplicates -packages=`echo "$packages" | tr " " "\n" | sort | uniq | tr "\n" " "` - -run_in_terminal "su -c \"debuginfo-install $packages\"" - -if [ "$?" = "1" ]; then - exit 3 -elif [ "$exit_status" = "0" ]; then - exit 0 -else - exit 1 -fi diff --git a/drkonqi/doc/examples/installdbgsymbols_suse.sh b/drkonqi/doc/examples/installdbgsymbols_suse.sh deleted file mode 100644 index dbc7468fc..000000000 --- a/drkonqi/doc/examples/installdbgsymbols_suse.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2009 George Kiagiadakis -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# This function runs a command in a terminal -# The first argument ($1) must be the full command to run. -# It returns 0 if the command finished or 1 if the user closed -# the terminal without waiting for the command to finish. -# The return value of the command is saved in the $exit_status variable. -run_in_terminal() -{ - local fifo=/tmp/drkonqi-fifo-$$ - mkfifo $fifo - - # start terminal - konsole -e sh -c "echo \$\$ > $fifo; $1; exit_status=\$?; sleep 1; rm $fifo; echo \$exit_status > $fifo" & - - # wait for it to finish - local pid=`cat $fifo` - while [ "$?" = "0" ]; do - sleep 1 - kill -0 $pid 2>/dev/null - done - - # check if terminal has finished succesfully and return the command's exit status - local canceled=0 - if [ -p $fifo ]; then - # terminal was closed before finishing execution - canceled=1 - else - exit_status=`cat $fifo` - #echo "\"$1\" returned: $exit_status" - fi - rm $fifo - return $canceled -} - -# check misc script dependencies -check_dep() -{ - which $1 >/dev/null - if [ "$?" != "0" ]; then - # check for availability of kdialog - which kdialog >/dev/null - if [ "$?" != "0" ]; then - xmessage -center "$1 was not found on your system. Please install $1 and try again." - else - kdialog --sorry "$1 was not found on your system. Please install $1 and try again." - fi - exit 1 - fi -} - -check_dep pbuildid -check_dep konsole - -# start searching for packages -packages="" -while [ "$1" != "" ]; -do - # look for the build id - file -L "$1" | grep ELF >/dev/null - if [ "$?" = "0" ]; then - buildid=`pbuildid "$1" | cut -d ' ' -f 2` - package="\"debuginfo(build-id)=$buildid\"" - packages="$packages $package" - fi - - shift -done - -run_in_terminal "sudo zypper install -C $packages" - -if [ "$?" = "1" ]; then - exit 3 -elif [ "$exit_status" = "0" ]; then - exit 0 -else - exit 1 -fi diff --git a/drkonqi/drkonqi.cpp b/drkonqi/drkonqi.cpp deleted file mode 100644 index 46aa15b79..000000000 --- a/drkonqi/drkonqi.cpp +++ /dev/null @@ -1,352 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - Parts of this code were originally under the following license: - - * Copyright (C) 2000-2003 Hans Petter Bieker - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include "drkonqi.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "systeminformation.h" -#include "crashedapplication.h" -#include "drkonqibackends.h" - -DrKonqi::DrKonqi() - : m_signal(0) - , m_pid(0) - , m_kdeinit(false) - , m_safer(false) - , m_restarted(false) - , m_keepRunning(false) - , m_thread(0) -{ - m_backend = new KCrashBackend(); - m_systemInformation = new SystemInformation(); -} - -DrKonqi::~DrKonqi() -{ - delete m_systemInformation; - delete m_backend; -} - -//static -DrKonqi *DrKonqi::instance() -{ - static DrKonqi *drKonqiInstance = NULL; - if (!drKonqiInstance) { - drKonqiInstance = new DrKonqi(); - } - return drKonqiInstance; -} - -//based on KCrashDelaySetHandler from kdeui/util/kcrash.cpp -class EnableCrashCatchingDelayed : public QObject -{ -public: - EnableCrashCatchingDelayed() { - startTimer(10000); // 10 s - } -protected: - void timerEvent(QTimerEvent *event) override { - qDebug() << "Enabling drkonqi crash catching"; - KCrash::setDrKonqiEnabled(true); - killTimer(event->timerId()); - this->deleteLater(); - } -}; - -bool DrKonqi::init() -{ - if (!instance()->m_backend->init()) { - cleanup(); - return false; - } else { //all ok, continue initialization - // Set drkonqi to handle its own crashes, but only if the crashed app - // is not drkonqi already. If it is drkonqi, delay enabling crash catching - // to prevent recursive crashes (in case it crashes at startup) - if (crashedApplication()->fakeExecutableBaseName() != QLatin1String("drkonqi")) { - qDebug() << "Enabling drkonqi crash catching"; - KCrash::setDrKonqiEnabled(true); - } else { - new EnableCrashCatchingDelayed; - } - return true; - } -} - -void DrKonqi::cleanup() -{ - delete instance(); -} - -//static -SystemInformation *DrKonqi::systemInformation() -{ - return instance()->m_systemInformation; -} - -//static -DebuggerManager* DrKonqi::debuggerManager() -{ - return instance()->m_backend->debuggerManager(); -} - -//static -CrashedApplication *DrKonqi::crashedApplication() -{ - return instance()->m_backend->crashedApplication(); -} - -//static -void DrKonqi::saveReport(const QString & reportText, QWidget *parent) -{ - if (isSafer()) { - QTemporaryFile tf; - tf.setFileTemplate(QStringLiteral("XXXXXX.kcrash.txt")); - tf.setAutoRemove(false); - - if (tf.open()) { - QTextStream textStream(&tf); - textStream << reportText; - textStream.flush(); - KMessageBox::information(parent, xi18nc("@info", - "Report saved to %1.", - tf.fileName())); - } else { - KMessageBox::sorry(parent, i18nc("@info","Could not create a file in which to save the report.")); - } - } else { - QString defname = getSuggestedKCrashFilename(crashedApplication()); - - QPointer dlg(new QFileDialog(parent, defname)); - dlg->selectFile(defname); - dlg->setWindowTitle(i18nc("@title:window","Select Filename")); - dlg->setAcceptMode(QFileDialog::AcceptSave); - dlg->setFileMode(QFileDialog::AnyFile); - dlg->setConfirmOverwrite(true); - if (dlg->exec() != QDialog::Accepted) { - return; - } - - if (!dlg) { - //Dialog is invalid, it was probably deleted (ex. via DBus call) - //return and do not crash - return; - } - - QUrl fileUrl; - if(!dlg->selectedUrls().isEmpty()) - fileUrl = dlg->selectedUrls().first(); - delete dlg; - - if (fileUrl.isValid()) { - QTemporaryFile tf; - if (tf.open()) { - QTextStream ts(&tf); - ts << reportText; - ts.flush(); - } else { - KMessageBox::sorry(parent, xi18nc("@info","Cannot open file %1 " - "for writing.", tf.fileName())); - return; - } - - KIO::FileCopyJob* job = KIO::file_copy(QUrl::fromLocalFile(tf.fileName()), fileUrl); - KJobWidgets::setWindow(job, parent); - if (!job->exec()) { - KMessageBox::sorry(parent, job->errorText()); - } - } - } -} - -void DrKonqi::setSignal(int signal) -{ - instance()->m_signal = signal; -} - -void DrKonqi::setAppName(const QString &appName) -{ - instance()->m_appName = appName; -} - -void DrKonqi::setAppPath(const QString &appPath) -{ - instance()->m_appPath = appPath; -} - -void DrKonqi::setAppVersion(const QString &appVersion) -{ - instance()->m_appVersion = appVersion; -} - -void DrKonqi::setBugAddress(const QString &bugAddress) -{ - instance()->m_bugAddress = bugAddress; -} - -void DrKonqi::setProgramName(const QString &programName) -{ - instance()->m_programName = programName; -} - -void DrKonqi::setPid(int pid) -{ - instance()->m_pid = pid; -} - -void DrKonqi::setKdeinit(bool kdeinit) -{ - instance()->m_kdeinit = kdeinit; -} - -void DrKonqi::setSafer(bool safer) -{ - instance()->m_safer = safer; -} - -void DrKonqi::setRestarted(bool restarted) -{ - instance()->m_restarted = restarted; -} - -void DrKonqi::setKeepRunning(bool keepRunning) -{ - instance()->m_keepRunning = keepRunning; -} - -void DrKonqi::setThread(int thread) -{ - instance()->m_thread = thread; -} - -int DrKonqi::signal() -{ - return instance()->m_signal; -} - -const QString &DrKonqi::appName() -{ - return instance()->m_appName; -} - -const QString &DrKonqi::appPath() -{ - return instance()->m_appPath; -} - -const QString &DrKonqi::appVersion() -{ - return instance()->m_appVersion; -} - -const QString &DrKonqi::bugAddress() -{ - return instance()->m_bugAddress; -} - -const QString &DrKonqi::programName() -{ - return instance()->m_programName; -} - -int DrKonqi::pid() -{ - return instance()->m_pid; -} - -bool DrKonqi::isKdeinit() -{ - return instance()->m_kdeinit; -} - -bool DrKonqi::isSafer() -{ - return instance()->m_safer; -} - -bool DrKonqi::isRestarted() -{ - return instance()->m_restarted; -} - -bool DrKonqi::isKeepRunning() -{ - return instance()->m_keepRunning; -} - -int DrKonqi::thread() -{ - return instance()->m_thread; -} - -bool DrKonqi::ignoreQuality() -{ - return qEnvironmentVariableIsSet("DRKONQI_IGNORE_QUALITY"); -} - -const QString &DrKonqi::kdeBugzillaURL() -{ - // NB: for practical reasons this cannot use the shared instance. Initing the instances requires - // knowing the URL already, so we'd have an init loop. Use a local static instead. - static QString url; - if (!url.isEmpty()) { - return url; - } - - url = QString::fromLocal8Bit(qgetenv("DRKONQI_KDE_BUGZILLA_URL")); - if (!url.isEmpty()) { - return url; - } - - url = QStringLiteral("https://bugs.kde.org/"); - return url; -} diff --git a/drkonqi/drkonqi.h b/drkonqi/drkonqi.h deleted file mode 100644 index 3cbae584a..000000000 --- a/drkonqi/drkonqi.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef DRKONQI_H -#define DRKONQI_H - -#include - -class QWidget; - -class SystemInformation; -class DebuggerManager; -class CrashedApplication; -class AbstractDrKonqiBackend; - -class DrKonqi -{ -public: - static bool init(); - static void cleanup(); - - static SystemInformation *systemInformation(); - static DebuggerManager *debuggerManager(); - static CrashedApplication *crashedApplication(); - - static void saveReport(const QString & reportText, QWidget *parent = 0); - - static void setSignal(int signal); - static void setAppName(const QString &appName); - static void setAppPath(const QString &appPath); - static void setAppVersion(const QString &appVersion); - static void setBugAddress(const QString &bugAddress); - static void setProgramName(const QString &programName); - static void setPid(int pid); - static void setKdeinit(bool kdeinit); - static void setSafer(bool safer); - static void setRestarted(bool restarted); - static void setKeepRunning(bool keepRunning); - static void setThread(int thread); - - static int signal(); - static const QString &appName(); - static const QString &appPath(); - static const QString &appVersion(); - static const QString &bugAddress(); - static const QString &programName(); - static int pid(); - static bool isKdeinit(); - static bool isSafer(); - static bool isRestarted(); - static bool isKeepRunning(); - static int thread(); - static bool ignoreQuality(); - static const QString &kdeBugzillaURL(); - -private: - DrKonqi(); - ~DrKonqi(); - static DrKonqi *instance(); - - SystemInformation *m_systemInformation; - AbstractDrKonqiBackend *m_backend; - - int m_signal; - QString m_appName; - QString m_appPath; - QString m_appVersion; - QString m_bugAddress; - QString m_programName; - int m_pid; - bool m_kdeinit; - bool m_safer; - bool m_restarted; - bool m_keepRunning; - int m_thread; -}; - -#endif diff --git a/drkonqi/drkonqi_globals.h b/drkonqi/drkonqi_globals.h deleted file mode 100644 index 960af21cb..000000000 --- a/drkonqi/drkonqi_globals.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef DRKONQI_GLOBALS_H -#define DRKONQI_GLOBALS_H - -#include -#include - -#include "drkonqi.h" - -/** This class provides a custom constructor to fill the "toolTip" - * and "whatsThis" texts of KGuiItem with the same text. - */ -class KGuiItem2 : public KGuiItem -{ -public: - inline KGuiItem2(const QString &text, const QIcon &icon, const QString &toolTip) - : KGuiItem(text, icon, toolTip, toolTip) {} -}; - -/* Urls are defined globally here, so that they can change easily */ -#define KDE_BUGZILLA_URL DrKonqi::kdeBugzillaURL() -#define KDE_BUGZILLA_CREATE_ACCOUNT_URL KDE_BUGZILLA_URL + QStringLiteral("createaccount.cgi") -#define KDE_BUGZILLA_SHORT_URL "bugs.kde.org" -#define TECHBASE_HOWTO_DOC "https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Preparing_your_KDE_packages" - -/* IDs for bugreport assistant pages -> help anchors */ -#define PAGE_INTRODUCTION_ID "IntroductionID" -#define PAGE_CRASHINFORMATION_ID "BacktraceID" -#define PAGE_AWARENESS_ID "AwarenessID" -#define PAGE_CONCLUSIONS_ID "ConclusionsID" -#define PAGE_BZLOGIN_ID "BugzillaLoginID" -#define PAGE_BZDUPLICATES_ID "BugzillaDuplicatesID" -#define PAGE_BZDETAILS_ID "BugzillaDetailsID" -#define PAGE_BZPREVIEW_ID "BugzillaPreviewID" -#define PAGE_BZSEND_ID "BugzillaSendID" - -#define PAGE_HELP_BEGIN_ID "Begin" - -#endif diff --git a/drkonqi/drkonqibackends.cpp b/drkonqi/drkonqibackends.cpp deleted file mode 100644 index d02d3e942..000000000 --- a/drkonqi/drkonqibackends.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "drkonqibackends.h" - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "crashedapplication.h" -#include "debugger.h" -#include "debuggermanager.h" -#include "backtracegenerator.h" -#include "drkonqi.h" - -AbstractDrKonqiBackend::~AbstractDrKonqiBackend() -{ -} - -bool AbstractDrKonqiBackend::init() -{ - m_crashedApplication = constructCrashedApplication(); - m_debuggerManager = constructDebuggerManager(); - return true; -} - - -KCrashBackend::KCrashBackend() - : QObject(), AbstractDrKonqiBackend(), m_state(ProcessRunning) -{ -} - -KCrashBackend::~KCrashBackend() -{ - continueAttachedProcess(); -} - -bool KCrashBackend::init() -{ - AbstractDrKonqiBackend::init(); - - //check whether the attached process exists and whether we have permissions to inspect it - if (crashedApplication()->pid() <= 0) { - qWarning() << "Invalid pid specified"; - return false; - } - -#if !defined(Q_OS_WIN32) - if (::kill(crashedApplication()->pid(), 0) < 0) { - switch (errno) { - case EPERM: - qWarning() << "DrKonqi doesn't have permissions to inspect the specified process"; - break; - case ESRCH: - qWarning() << "The specified process does not exist."; - break; - default: - break; - } - return false; - } - - //--keeprunning means: generate backtrace instantly and let the process continue execution - if(DrKonqi::isKeepRunning()) { - stopAttachedProcess(); - debuggerManager()->backtraceGenerator()->start(); - connect(debuggerManager(), &DebuggerManager::debuggerFinished, this, &KCrashBackend::continueAttachedProcess); - } else { - connect(debuggerManager(), &DebuggerManager::debuggerStarting, this, &KCrashBackend::onDebuggerStarting); - connect(debuggerManager(), &DebuggerManager::debuggerFinished, this, &KCrashBackend::onDebuggerFinished); - - //stop the process to avoid high cpu usage by other threads (bug 175362). - //if the process was started by kdeinit, we need to wait a bit for KCrash - //to reach the alarm(0); call in kdeui/util/kcrash.cpp line 406 or else - //if we stop it before this call, pending alarm signals will kill the - //process when we try to continue it. - QTimer::singleShot(2000, this, &KCrashBackend::stopAttachedProcess); - } -#endif - - //Handle drkonqi crashes - s_pid = crashedApplication()->pid(); //copy pid for use by the crash handler, so that it is safer - KCrash::setEmergencySaveFunction(emergencySaveFunction); - - return true; -} - -CrashedApplication *KCrashBackend::constructCrashedApplication() -{ - CrashedApplication *a = new CrashedApplication(this); - a->m_datetime = QDateTime::currentDateTime(); - a->m_name = DrKonqi::programName(); - a->m_version = DrKonqi::appVersion().toUtf8(); - a->m_reportAddress = BugReportAddress(DrKonqi::bugAddress().toUtf8()); - a->m_pid = DrKonqi::pid(); - a->m_signalNumber = DrKonqi::signal(); - a->m_restarted = DrKonqi::isRestarted(); - a->m_thread = DrKonqi::thread(); - - //try to determine the executable that crashed - if ( QFileInfo(QStringLiteral("/proc/%1/exe").arg(a->m_pid)).exists() ) { - //on linux, the fastest and most reliable way is to get the path from /proc - qDebug() << "Using /proc to determine executable path"; - a->m_executable.setFile(QFile::symLinkTarget(QStringLiteral("/proc/%1/exe").arg(a->m_pid))); - - if (DrKonqi::isKdeinit() || - a->m_executable.fileName().startsWith(QLatin1String("python")) ) { - - a->m_fakeBaseName = DrKonqi::appName(); - } - } else { - if ( DrKonqi::isKdeinit() ) { - a->m_executable = QFileInfo(QStandardPaths::findExecutable(QStringLiteral("kdeinit5"))); - a->m_fakeBaseName = DrKonqi::appName(); - } else { - QFileInfo execPath(DrKonqi::appName()); - if ( execPath.isAbsolute() ) { - a->m_executable = execPath; - } else if ( !DrKonqi::appPath().isEmpty() ) { - QDir execDir(DrKonqi::appPath()); - a->m_executable = execDir.absoluteFilePath(execPath.fileName()); - } else { - a->m_executable = QFileInfo(QStandardPaths::findExecutable(execPath.fileName())); - } - } - } - - qDebug() << "Executable is:" << a->m_executable.absoluteFilePath(); - qDebug() << "Executable exists:" << a->m_executable.exists(); - - return a; -} - -DebuggerManager *KCrashBackend::constructDebuggerManager() -{ - QList internalDebuggers = Debugger::availableInternalDebuggers(QStringLiteral("KCrash")); - KConfigGroup config(KSharedConfig::openConfig(), "DrKonqi"); -#ifndef Q_OS_WIN - QString defaultDebuggerName = config.readEntry("Debugger", QStringLiteral("gdb")); -#else - QString defaultDebuggerName = config.readEntry("Debugger", QString("kdbgwin")); -#endif - - Debugger firstKnownGoodDebugger, preferredDebugger; - foreach (const Debugger & debugger, internalDebuggers) { - if (!firstKnownGoodDebugger.isValid() && debugger.isInstalled()) { - firstKnownGoodDebugger = debugger; - } - if (debugger.codeName() == defaultDebuggerName) { - preferredDebugger = debugger; - } - if (firstKnownGoodDebugger.isValid() && preferredDebugger.isValid()) { - break; - } - } - - if (!preferredDebugger.isInstalled()) { - if (firstKnownGoodDebugger.isValid()) { - preferredDebugger = firstKnownGoodDebugger; - } else { - qWarning() << "Unable to find an internal debugger that can work with the KCrash backend"; - } - } - - return new DebuggerManager(preferredDebugger, Debugger::availableExternalDebuggers(QStringLiteral("KCrash")), this); -} - -void KCrashBackend::stopAttachedProcess() -{ - if (m_state == ProcessRunning) { - qDebug() << "Sending SIGSTOP to process"; - ::kill(crashedApplication()->pid(), SIGSTOP); - m_state = ProcessStopped; - } -} - -void KCrashBackend::continueAttachedProcess() -{ - if (m_state == ProcessStopped) { - qDebug() << "Sending SIGCONT to process"; - ::kill(crashedApplication()->pid(), SIGCONT); - m_state = ProcessRunning; - } -} - -void KCrashBackend::onDebuggerStarting() -{ - continueAttachedProcess(); - m_state = DebuggerRunning; -} - -void KCrashBackend::onDebuggerFinished() -{ - m_state = ProcessRunning; - stopAttachedProcess(); -} - -//static -qint64 KCrashBackend::s_pid = 0; - -//static -void KCrashBackend::emergencySaveFunction(int signal) -{ - // In case drkonqi itself crashes, we need to get rid of the process being debugged, - // so we kill it, no matter what its state was. - Q_UNUSED(signal); - ::kill(s_pid, SIGKILL); -} - - diff --git a/drkonqi/drkonqibackends.h b/drkonqi/drkonqibackends.h deleted file mode 100644 index 408636767..000000000 --- a/drkonqi/drkonqibackends.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef DRKONQIBACKENDS_H -#define DRKONQIBACKENDS_H - -#include - -class CrashedApplication; -class DebuggerManager; - -class AbstractDrKonqiBackend -{ -public: - virtual ~AbstractDrKonqiBackend(); - virtual bool init(); - - inline CrashedApplication *crashedApplication() const { - return m_crashedApplication; - } - - inline DebuggerManager *debuggerManager() const { - return m_debuggerManager; - } - -protected: - virtual CrashedApplication *constructCrashedApplication() = 0; - virtual DebuggerManager *constructDebuggerManager() = 0; - -private: - CrashedApplication *m_crashedApplication; - DebuggerManager *m_debuggerManager; -}; - -class KCrashBackend : public QObject, public AbstractDrKonqiBackend -{ - Q_OBJECT -public: - KCrashBackend(); - ~KCrashBackend() override; - bool init() override; - -protected: - CrashedApplication *constructCrashedApplication() override; - DebuggerManager *constructDebuggerManager() override; - -private Q_SLOTS: - void stopAttachedProcess(); - void continueAttachedProcess(); - void onDebuggerStarting(); - void onDebuggerFinished(); - -private: - static void emergencySaveFunction(int signal); - static qint64 s_pid; //for use by the emergencySaveFunction - - enum State { ProcessRunning, ProcessStopped, DebuggerRunning }; - State m_state; -}; - -#endif // DRKONQIBACKENDS_H diff --git a/drkonqi/drkonqidialog.cpp b/drkonqi/drkonqidialog.cpp deleted file mode 100644 index 46b404fc2..000000000 --- a/drkonqi/drkonqidialog.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************* -* drkonqidialog.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "drkonqidialog.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "drkonqi.h" -#include "backtracewidget.h" -#include "aboutbugreportingdialog.h" -#include "crashedapplication.h" -#include "debuggermanager.h" -#include "debuggerlaunchers.h" -#include "drkonqi_globals.h" -#include "config-drkonqi.h" -#if HAVE_XMLRPCCLIENT - #include "bugzillaintegration/reportassistantdialog.h" -#endif - -static const char ABOUT_BUG_REPORTING_URL[] = "#aboutbugreporting"; -static QString DRKONQI_REPORT_BUG_URL = KDE_BUGZILLA_URL + QStringLiteral("enter_bug.cgi?product=drkonqi&format=guided"); - -DrKonqiDialog::DrKonqiDialog(QWidget * parent) : - QDialog(parent), - m_aboutBugReportingDialog(0), - m_backtraceWidget(0) -{ - setAttribute(Qt::WA_DeleteOnClose, true); - - //Setting dialog title and icon - setWindowTitle(DrKonqi::crashedApplication()->name()); - setWindowIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"))); - - QVBoxLayout* l = new QVBoxLayout(this); - m_tabWidget = new QTabWidget(this); - l->addWidget(m_tabWidget); - m_buttonBox = new QDialogButtonBox(this); - connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accepted); - connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::rejected); - l->addWidget(m_buttonBox); - - connect(m_tabWidget, &QTabWidget::currentChanged, this, &DrKonqiDialog::tabIndexChanged); - - KConfigGroup config(KSharedConfig::openConfig(), "General"); - - if (!config.readEntry(QStringLiteral("ShowOnlyBacktrace"), false)) { - buildIntroWidget(); - m_tabWidget->addTab(m_introWidget, i18nc("@title:tab general information", "&General")); - } - - m_backtraceWidget = new BacktraceWidget(DrKonqi::debuggerManager()->backtraceGenerator(), this); - m_backtraceWidget->setMinimumSize(QSize(575, 240)); - m_tabWidget->addTab(m_backtraceWidget, i18nc("@title:tab", "&Developer Information")); - - m_tabWidget->tabBar()->setVisible(m_tabWidget->count() > 1); - - buildDialogButtons(); - - setMinimumSize(QSize(640,320)); - resize(minimumSize()); - - KWindowConfig::restoreWindowSize(windowHandle(), config); - setLayout(l); -} - -DrKonqiDialog::~DrKonqiDialog() -{ - KConfigGroup config(KSharedConfig::openConfig(), "General"); - KWindowConfig::saveWindowSize(windowHandle(), config); -} - -void DrKonqiDialog::tabIndexChanged(int index) -{ - if (index == m_tabWidget->indexOf(m_backtraceWidget)) { - m_backtraceWidget->generateBacktrace(); - } -} - -void DrKonqiDialog::buildIntroWidget() -{ - const CrashedApplication *crashedApp = DrKonqi::crashedApplication(); - - m_introWidget = new QWidget(this); - ui.setupUi(m_introWidget); - - ui.titleLabel->setText(xi18nc("@info", "We are sorry, %1 " - "closed unexpectedly.", crashedApp->name())); - - QString reportMessage; - if (!crashedApp->bugReportAddress().isEmpty()) { - if (crashedApp->fakeExecutableBaseName() == QLatin1String("drkonqi")) { //Handle own crashes - reportMessage = xi18nc("@info", "As the Crash Handler itself has failed, the " - "automatic reporting process is disabled to reduce the " - "risks of failing again." - "Please, manually report this error " - "to the KDE bug tracking system. Do not forget to include " - "the backtrace from the Developer Information " - "tab.", - DRKONQI_REPORT_BUG_URL); - } else if (DrKonqi::isSafer()) { - reportMessage = xi18nc("@info", "The reporting assistant is disabled because " - "the crash handler dialog was started in safe mode." - "You can manually report this bug to %1 " - "(including the backtrace from the " - "Developer Information " - "tab.)", crashedApp->bugReportAddress()); - } else { - reportMessage = xi18nc("@info", "You can help us improve KDE Software by reporting " - "this error.Learn " - "more about bug reporting.", - QLatin1String(ABOUT_BUG_REPORTING_URL)); - } - } else { - reportMessage = xi18nc("@info", "You cannot report this error, because " - "%1 does not provide a bug reporting " - "address.", - crashedApp->name() - ); - } - ui.infoLabel->setText(reportMessage); - connect(ui.infoLabel, &QLabel::linkActivated, this, &DrKonqiDialog::linkActivated); - - ui.detailsTitleLabel->setText(QStringLiteral("%1").arg(i18nc("@label","Details:"))); - - ui.detailsLabel->setText(xi18nc("@info Note the time information is divided into date and time parts", - "Executable: %1" - " PID: %2 Signal: %3 (%4) " - "Time: %5 %6", - crashedApp->fakeExecutableBaseName(), - crashedApp->pid(), - crashedApp->signalName(), - #if defined(Q_OS_UNIX) - crashedApp->signalNumber(), - #else - //windows uses weird big numbers for exception codes, - //so it doesn't make sense to display them in decimal - QString().sprintf("0x%8x", crashedApp->signalNumber()), - #endif - crashedApp->datetime().date().toString(Qt::DefaultLocaleShortDate), - - crashedApp->datetime().time().toString() - )); -} - -void DrKonqiDialog::buildDialogButtons() -{ - const CrashedApplication *crashedApp = DrKonqi::crashedApplication(); - - //Set dialog buttons - m_buttonBox->setStandardButtons(QDialogButtonBox::Close); - - //Report bug button: User1 - QPushButton* reportButton = new QPushButton(m_buttonBox); - KGuiItem2 reportItem(i18nc("@action:button", "Report &Bug"), - QIcon::fromTheme(QStringLiteral("tools-report-bug")), - i18nc("@info:tooltip", "Starts the bug report assistant.")); - KGuiItem::assign(reportButton, reportItem); - m_buttonBox->addButton(reportButton, QDialogButtonBox::ActionRole); - - bool enableReportAssistant = !crashedApp->bugReportAddress().isEmpty() && - crashedApp->fakeExecutableBaseName() != QLatin1String("drkonqi") && - !DrKonqi::isSafer() && - HAVE_XMLRPCCLIENT; - reportButton->setEnabled(enableReportAssistant); - connect(reportButton, &QPushButton::clicked, this, &DrKonqiDialog::startBugReportAssistant); - - //Default debugger button and menu (only for developer mode): User2 - DebuggerManager *debuggerManager = DrKonqi::debuggerManager(); - m_debugButton = new QPushButton(m_buttonBox); - KGuiItem2 debugItem(i18nc("@action:button this is the debug menu button label which contains the debugging applications", - "&Debug"), QIcon::fromTheme(QStringLiteral("applications-development")), - i18nc("@info:tooltip", "Starts a program to debug " - "the crashed application.")); - KGuiItem::assign(m_debugButton, debugItem); - m_debugButton->setVisible(debuggerManager->showExternalDebuggers()); - // Do not add the button unless it is visible, otherwise the Box will force - // it visible as it calls show() explicitly. - if (m_debugButton->isVisible()) { - m_buttonBox->addButton(m_debugButton, QDialogButtonBox::ActionRole); - } - - m_debugMenu = new QMenu(this); - m_debugButton->setMenu(m_debugMenu); - - QList debuggers = debuggerManager->availableExternalDebuggers(); - foreach(AbstractDebuggerLauncher *launcher, debuggers) { - addDebugger(launcher); - } - - connect(debuggerManager, &DebuggerManager::externalDebuggerAdded, this, &DrKonqiDialog::addDebugger); - connect(debuggerManager, &DebuggerManager::externalDebuggerRemoved, this, &DrKonqiDialog::removeDebugger); - connect(debuggerManager, &DebuggerManager::debuggerRunning, this, &DrKonqiDialog::enableDebugMenu); - - //Restart application button - KGuiItem2 restartItem(i18nc("@action:button", "&Restart Application"), - QIcon::fromTheme(QStringLiteral("system-reboot")), - i18nc("@info:tooltip", "Use this button to restart " - "the crashed application.")); - m_restartButton = new QPushButton(m_buttonBox); - KGuiItem::assign(m_restartButton, restartItem); - m_restartButton->setEnabled(!crashedApp->hasBeenRestarted() && - crashedApp->fakeExecutableBaseName() != QLatin1String("drkonqi")); - m_buttonBox->addButton(m_restartButton, QDialogButtonBox::ActionRole); - connect(m_restartButton, &QAbstractButton::clicked, crashedApp, &CrashedApplication::restart); - connect(crashedApp, &CrashedApplication::restarted, this, &DrKonqiDialog::applicationRestarted); - - //Close button - QString tooltipText = i18nc("@info:tooltip", - "Close this dialog (you will lose the crash information.)"); - m_buttonBox->button(QDialogButtonBox::Close)->setToolTip(tooltipText); - m_buttonBox->button(QDialogButtonBox::Close)->setWhatsThis(tooltipText); - m_buttonBox->button(QDialogButtonBox::Close)->setFocus(); -} - -void DrKonqiDialog::addDebugger(AbstractDebuggerLauncher *launcher) -{ - QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("applications-development")), - i18nc("@action:inmenu 1 is the debugger name", - "Debug in %1", - launcher->name()), m_debugMenu); - m_debugMenu->addAction(action); - connect(action, &QAction::triggered, launcher, &AbstractDebuggerLauncher::start); - m_debugMenuActions.insert(launcher, action); -} - -void DrKonqiDialog::removeDebugger(AbstractDebuggerLauncher *launcher) -{ - QAction *action = m_debugMenuActions.take(launcher); - if ( action ) { - m_debugMenu->removeAction(action); - action->deleteLater(); - } else { - qWarning() << "Invalid launcher"; - } -} - -void DrKonqiDialog::enableDebugMenu(bool debuggerRunning) -{ - m_debugButton->setEnabled(!debuggerRunning); -} - -void DrKonqiDialog::startBugReportAssistant() -{ -#if HAVE_XMLRPCCLIENT - ReportAssistantDialog * bugReportAssistant = new ReportAssistantDialog(); - bugReportAssistant->show(); - connect(bugReportAssistant, &QObject::destroyed, this, &DrKonqiDialog::reject); - - hide(); -#endif -} - -void DrKonqiDialog::linkActivated(const QString& link) -{ - if (link == QLatin1String(ABOUT_BUG_REPORTING_URL)) { - showAboutBugReporting(); - } else if (link == DRKONQI_REPORT_BUG_URL) { - QDesktopServices::openUrl(QUrl(link)); - } else if (link.startsWith(QLatin1String("http"))) { - qWarning() << "unexpected link"; - QDesktopServices::openUrl(QUrl(link)); - } -} - -void DrKonqiDialog::showAboutBugReporting() -{ - if (!m_aboutBugReportingDialog) { - m_aboutBugReportingDialog = new AboutBugReportingDialog(); - connect(this, &DrKonqiDialog::destroyed, m_aboutBugReportingDialog.data(), &AboutBugReportingDialog::close); - } - m_aboutBugReportingDialog->show(); - m_aboutBugReportingDialog->raise(); - m_aboutBugReportingDialog->activateWindow(); -} - -void DrKonqiDialog::applicationRestarted(bool success) -{ - m_restartButton->setEnabled(!success); -} diff --git a/drkonqi/drkonqidialog.h b/drkonqi/drkonqidialog.h deleted file mode 100644 index 34627c0b3..000000000 --- a/drkonqi/drkonqidialog.h +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************* -* drkonqidialog.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef DRKONQIDIALOG__H -#define DRKONQIDIALOG__H - -#include -#include - -#include - -#include "ui_maindialog.h" - -class BacktraceWidget; -class AboutBugReportingDialog; -class QTabWidget; -class AbstractDebuggerLauncher; -class QDialogButtonBox; - -class DrKonqiDialog: public QDialog -{ - Q_OBJECT - -public: - explicit DrKonqiDialog(QWidget * parent = 0); - ~DrKonqiDialog() override; - -private Q_SLOTS: - void linkActivated(const QString&); - void startBugReportAssistant(); - - void applicationRestarted(bool success); - - void addDebugger(AbstractDebuggerLauncher *launcher); - void removeDebugger(AbstractDebuggerLauncher *launcher); - void enableDebugMenu(bool); - - //GUI - void buildIntroWidget(); - void buildDialogButtons(); - - void tabIndexChanged(int); - -private: - void showAboutBugReporting(); - - QTabWidget * m_tabWidget; - - QPointer m_aboutBugReportingDialog; - - QWidget * m_introWidget; - Ui::MainWidget ui; - - BacktraceWidget * m_backtraceWidget; - - QMenu *m_debugMenu; - QHash m_debugMenuActions; - QDialogButtonBox* m_buttonBox; - QPushButton* m_debugButton; - QPushButton* m_restartButton; -}; - -#endif diff --git a/drkonqi/findconfigdatajob.cpp b/drkonqi/findconfigdatajob.cpp deleted file mode 100644 index 34bc93b01..000000000 --- a/drkonqi/findconfigdatajob.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************* -* findconfigdatajob.cpp -* Copyright 2011 Matthias Fuchs -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include "findconfigdatajob.h" - -#include -#include - -FindConfigDataJob::FindConfigDataJob(const QString &productName, const QUrl &bugtrackerBaseUrl, QObject *parent) - : KJob(parent), - m_job(0), - m_url(bugtrackerBaseUrl) -{ - m_url.addPath("config.cgi"); - m_url.addQueryItem("product", productName); -} - -FindConfigDataJob::~FindConfigDataJob() -{ - if (m_job) { - m_job->kill(); - } -} - -void FindConfigDataJob::start() -{ - m_job = KIO::storedGet(m_url, KIO::Reload, KIO::HideProgressInfo); - connect(m_job, &KIO::StoredTransferJob::result, this, &FindConfigDataJob::receivedData); - connect(m_job, &KIO::StoredTransferJob::infoMessage, this, &FindConfigDataJob::infoMessage); - connect(m_job, &KIO::StoredTransferJob::warning, this, &FindConfigDataJob::warning); - - m_job->start(); -} - -QString FindConfigDataJob::errorString() const -{ - return m_errorString; -} - -void FindConfigDataJob::receivedData(KJob *job) -{ - Q_UNUSED(job); - - if (m_job->error()) { - setError(m_job->error()); - m_errorString = i18n("Failed to retrieve the config data."); - } else { - m_data = m_job->data(); - } - m_job = 0; - emitResult(); -} - -QStringList FindConfigDataJob::data(InformationType type) -{ - QStringList result; - QString key; - - switch (type) { - case Version: - key = "version\\['[^\']+'\\]"; - break; - default: - Q_ASSERT(false); - break; - } - - QRegExp rx(key + " = \\[ (('[^\']+', )+) \\];"); - if (rx.indexIn(m_data) != -1) { - QString temp = rx.cap(1); - temp.remove('\''); - temp.remove(' '); - result = temp.split(',', QString::SkipEmptyParts); - } - - kDebug() << "Found data for " + key + ':' << result << result.count(); - return result; -} - - diff --git a/drkonqi/findconfigdatajob.h b/drkonqi/findconfigdatajob.h deleted file mode 100644 index 6169e3fc5..000000000 --- a/drkonqi/findconfigdatajob.h +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************* -* findconfigdatajob.h -* Copyright 2011 Matthias Fuchs -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef DRKONQI_FIND_VERSIONS_JOB_H -#define DRKONQI_FIND_VERSIONS_JOB_H - -#include - -#include -#include - -namespace KIO { - class StoredTransferJob; -} - -/** - * This job downloads config.cgi for a specified product, - * looking for the information you want to retrieve - */ -class FindConfigDataJob : public KJob -{ - Q_OBJECT - public: - /** - * @param productName e.g. "plasma" - * @param bugtrackerBaseUrl e.g. "https://bugs.kde.org" - */ - explicit FindConfigDataJob(const QString &productName, const QUrl &bugtrackerBaseUrl, QObject *parent = 0); - virtual ~FindConfigDataJob(); - - virtual void start(); - virtual QString errorString() const; - - enum InformationType { - Version - }; - - /** - * Call this after the job finished to retrieve the - * specified data - */ - QStringList data(InformationType type); - - private slots: - void receivedData(KJob *job); - - private: - KIO::StoredTransferJob *m_job; - QUrl m_url; - QString m_data; - QString m_errorString; -}; - -#endif diff --git a/drkonqi/gdbhighlighter.cpp b/drkonqi/gdbhighlighter.cpp deleted file mode 100644 index 4e27eb1e4..000000000 --- a/drkonqi/gdbhighlighter.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - Copyright (C) 2010 Milian Wolff - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "gdbhighlighter.h" - -#include - -#include - -GdbHighlighter::GdbHighlighter(QTextDocument* parent, const QList & gdbLines) - : QSyntaxHighlighter(parent) -{ - // setup line lookup - int l = 0; - foreach(const BacktraceLine& line, gdbLines) { - lines.insert(l, line); - l += line.toString().count('\n'); - } - - // setup formates - KColorScheme scheme(QPalette::Active); - - crashFormat.setForeground(scheme.foreground(KColorScheme::NegativeText)); - nullptrFormat.setForeground(scheme.foreground(KColorScheme::NegativeText)); - nullptrFormat.setFontWeight(QFont::Bold); - assertFormat = nullptrFormat; - threadFormat.setForeground(scheme.foreground(KColorScheme::NeutralText)); - urlFormat.setForeground(scheme.foreground(KColorScheme::LinkText)); - funcFormat.setForeground(scheme.foreground(KColorScheme::VisitedText)); - funcFormat.setFontWeight(QFont::Bold); - otheridFormat.setForeground(scheme.foreground(KColorScheme::PositiveText)); - crapFormat.setForeground(scheme.foreground(KColorScheme::InactiveText)); -} - -void GdbHighlighter::highlightBlock(const QString& text) -{ - int cur = 0; - int next; - int diff; - const QRegExp hexptrPattern(QStringLiteral("0x[0-9a-f]+"), Qt::CaseSensitive, QRegExp::RegExp2); - int lineNr = currentBlock().firstLineNumber(); - while ( cur < text.length() ) { - next = text.indexOf('\n', cur); - if (next == -1) { - next = text.length(); - } - if (lineNr == 0) { - // line that contains 'Application: ...' - ++lineNr; - cur = next; - continue; - } - - diff = next - cur; - - QString lineStr = text.mid(cur, diff).append('\n'); - // -1 since we skip the first line - QMap< int, BacktraceLine >::iterator it = lines.lowerBound(lineNr - 1); - Q_ASSERT(it != lines.end()); - // lowerbound would return the next higher item, even though we want the former one - if (it.key() > lineNr - 1) { - --it; - } - const BacktraceLine& line = it.value(); - - if (line.type() == BacktraceLine::KCrash) { - setFormat(cur, diff, crashFormat); - } else if (line.type() == BacktraceLine::ThreadStart || line.type() == BacktraceLine::ThreadIndicator) { - setFormat(cur, diff, threadFormat); - } else if (line.type() == BacktraceLine::Crap) { - setFormat(cur, diff, crapFormat); - } else if (line.type() == BacktraceLine::StackFrame) { - if (!line.fileName().isEmpty()) { - int colonPos = line.fileName().lastIndexOf(':'); - setFormat(lineStr.indexOf(line.fileName()), colonPos == -1 ? line.fileName().length() : colonPos, urlFormat); - } - if (!line.libraryName().isEmpty()) { - setFormat(lineStr.indexOf(line.libraryName()), line.libraryName().length(), urlFormat); - } - if (!line.functionName().isEmpty()) { - int idx = lineStr.indexOf(line.functionName()); - if (idx != -1) { - // highlight Id::Id::Id::Func - // Id should have otheridFormat, :: no format and Func funcFormat - int i = idx; - int from = idx; - while (i < idx + line.functionName().length()) { - if (lineStr.at(i) == ':') { - setFormat(from, i - from, otheridFormat); - // skip :: - i += 2; - from = i; - continue; - } else if (lineStr.at(i) == '<' || lineStr.at(i) == '>') { - setFormat(from, i - from, otheridFormat); - ++i; - from = i; - continue; - } - ++i; - } - if (line.functionName() == QLatin1String("qFatal") || line.functionName() == QLatin1String("abort") || line.functionName() == QLatin1String("__assert_fail") - || line.functionName() == QLatin1String("*__GI___assert_fail") || line.functionName() == QLatin1String("*__GI_abort")) { - setFormat(from, i - from, assertFormat); - } else { - setFormat(from, i - from, funcFormat); - } - } - } - // highlight hexadecimal ptrs - int idx = 0; - while ((idx = hexptrPattern.indexIn(lineStr, idx)) != -1) { - if (hexptrPattern.cap() == QLatin1String("0x0")) { - setFormat(idx, hexptrPattern.matchedLength(), nullptrFormat); - } - idx += hexptrPattern.matchedLength(); - } - } - - cur = next; - ++lineNr; - } -} diff --git a/drkonqi/gdbhighlighter.h b/drkonqi/gdbhighlighter.h deleted file mode 100644 index 736ae7fe0..000000000 --- a/drkonqi/gdbhighlighter.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2010 Milian Wolff - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef GDBHIGHLIGHTER_H -#define GDBHIGHLIGHTER_H - -#include - -#include "parser/backtraceline.h" - -class GdbHighlighter : public QSyntaxHighlighter -{ -public: - GdbHighlighter(QTextDocument* parent, const QList & gdbLines); - -protected: - void highlightBlock(const QString& text) override; - -private: - QMap lines; - QTextCharFormat crashFormat; - QTextCharFormat nullptrFormat; - QTextCharFormat assertFormat; - QTextCharFormat threadFormat; - QTextCharFormat urlFormat; - QTextCharFormat funcFormat; - QTextCharFormat otheridFormat; - QTextCharFormat crapFormat; -}; - -#endif // GDBHIGHLIGHTER_H diff --git a/drkonqi/kdbgwin/CMakeLists.txt b/drkonqi/kdbgwin/CMakeLists.txt deleted file mode 100644 index 821963501..000000000 --- a/drkonqi/kdbgwin/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -set(kdbgwin_SRCS - common.h - main.cpp - process.h - process.cpp - abstract_generator.h - abstract_generator.cpp - callbacks.h - callbacks.cpp - outputters.h - outputters.cpp -) - -set(COMMON_LIBS dbghelp psapi shlwapi) - -if ( MINGW ) - # FIXME this should be handled in a higher level cmake with proper find - # scripts and configuration - add_executable(kdbgwin ${kdbgwin_SRCS} mingw_generator.h mingw_generator.cpp) - target_link_libraries(kdbgwin ${COMMON_LIBS} bfd iberty intl z) -endif () -if ( MSVC OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) - add_executable(kdbgwin ${kdbgwin_SRCS} msvc_generator.h msvc_generator.cpp) - target_link_libraries(kdbgwin ${COMMON_LIBS}) -endif () - -install(TARGETS kdbgwin DESTINATION ${KDE_INSTALL_LIBEXECDIR}) diff --git a/drkonqi/kdbgwin/Doxyfile b/drkonqi/kdbgwin/Doxyfile deleted file mode 100644 index d583734b5..000000000 --- a/drkonqi/kdbgwin/Doxyfile +++ /dev/null @@ -1,286 +0,0 @@ - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = kdbgwin -PROJECT_NUMBER = -OUTPUT_DIRECTORY = n:\kde\svn\trunk\KDE\kdebase\runtime\drkonqi\kdbgwin\doc -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = YES -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -QT_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = NO -OPTIMIZE_OUTPUT_VHDL = NO -EXTENSION_MAPPING = -BUILTIN_STL_SUPPORT = NO -CPP_CLI_SUPPORT = NO -SIP_SUPPORT = NO -IDL_PROPERTY_SUPPORT = YES -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -TYPEDEF_HIDES_STRUCT = NO -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = YES -EXTRACT_ANON_NSPACES = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = NO -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -FORCE_LOCAL_INCLUDES = NO -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_MEMBERS_CTORS_1ST = NO -SORT_GROUP_NAMES = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -SHOW_FILES = YES -SHOW_NAMESPACES = YES -FILE_VERSION_FILTER = -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = n:\kde\svn\trunk\KDE\kdebase\runtime\drkonqi\kdbgwin -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.h -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_TIMESTAMP = NO -HTML_ALIGN_MEMBERS = YES -HTML_DYNAMIC_SECTIONS = NO -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_BUNDLE_ID = org.doxygen.Project -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -CHM_INDEX_ENCODING = -BINARY_TOC = NO -TOC_EXPAND = NO -GENERATE_QHP = NO -QCH_FILE = -QHP_NAMESPACE = org.doxygen.Project -QHP_VIRTUAL_FOLDER = doc -QHP_CUST_FILTER_NAME = -QHP_CUST_FILTER_ATTRS = -QHP_SECT_FILTER_ATTRS = -QHG_LOCATION = -GENERATE_ECLIPSEHELP = NO -ECLIPSE_DOC_ID = org.doxygen.Project -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -USE_INLINE_TREES = NO -TREEVIEW_WIDTH = 250 -FORMULA_FONTSIZE = 10 -SEARCHENGINE = YES -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = NO -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -MSCGEN_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -DOT_FONTNAME = FreeSans -DOT_FONTSIZE = 10 -DOT_FONTPATH = -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -DOT_GRAPH_MAX_NODES = 50 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES diff --git a/drkonqi/kdbgwin/abstract_generator.cpp b/drkonqi/kdbgwin/abstract_generator.cpp deleted file mode 100644 index 1fa937beb..000000000 --- a/drkonqi/kdbgwin/abstract_generator.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#include "abstract_generator.h" -#include "callbacks.h" - -#include - -AbstractBTGenerator::AbstractBTGenerator(const Process& process) - : m_process(process) -{ - assert(process.IsValid()); -} - -AbstractBTGenerator::~AbstractBTGenerator() -{ -} - -QString AbstractBTGenerator::GetModuleName() -{ - IMAGEHLP_MODULE64 module; - ZeroMemory(&module, sizeof(module)); - module.SizeOfStruct = sizeof(IMAGEHLP_MODULE64); - - if (!SymGetModuleInfo64(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &module)) - { - kError() << "SymGetModuleInfo64 failed: " << GetLastError(); - return QLatin1String(DEFAULT_MODULE); - } - - QStringList list = QString(module.ImageName).split("\\"); - return list[list.size() - 1]; -} - -QString AbstractBTGenerator::GetModulePath() -{ - IMAGEHLP_MODULE64 module; - ZeroMemory(&module, sizeof(module)); - module.SizeOfStruct = sizeof(IMAGEHLP_MODULE64); - - if (!SymGetModuleInfo64(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &module)) - { - kError() << "SymGetModuleInfo64 failed: " << GetLastError(); - return QLatin1String(DEFAULT_MODULE); - } - - return QString(module.ImageName); -} - -void AbstractBTGenerator::Run(HANDLE hThread, bool bFaultingThread) -{ - assert(m_process.IsValid()); - assert(hThread); - - if (!Init()) - { - assert(false); - return; - } - - //HANDLE hFile = CreateFile(L"C:\\test\\test.dmp", FILE_ALL_ACCESS, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL); - //if (!MiniDumpWriteDump(m_process.GetHandle(), m_process.GetId(), hFile, - // MiniDumpNormal, NULL, NULL, NULL)) - //{ - // HRESULT hres = (HRESULT) GetLastError(); - // printf("%08X\n\n", hres); - //} - //SafeCloseHandle(hFile); - - DWORD dw = SuspendThread(hThread); - assert(dw != DWORD(-1)); - if (dw == DWORD(-1)) - { - kError() << "SuspendThread() failed: " << GetLastError(); - return; - } - - CONTEXT context; - ZeroMemory(&context, sizeof(context)); - if (!bFaultingThread) - { - // if it's not the faulting thread, get its context - context.ContextFlags = CONTEXT_FULL; - if (!GetThreadContext(hThread, &context)) - { - ResumeThread(hThread); - assert(false); - kError() << "GetThreadContext() failed: " << GetLastError(); - return; - } - } - else - { - // if it is, get it from KCrash - HANDLE hMapFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, L"Local\\KCrashShared"); - if (hMapFile == NULL) - { - kError() << "OpenFileMapping() failed: " << GetLastError(); - return; - } - CONTEXT *othercontext = (CONTEXT*) MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(CONTEXT)); - if (othercontext == NULL) - { - kError() << "MapViewOfFile() failed: " << GetLastError(); - SafeCloseHandle(hMapFile); - return; - } - CopyMemory(&context, othercontext, sizeof(CONTEXT)); - UnmapViewOfFile(othercontext); // continue even if it fails - SafeCloseHandle(hMapFile); - } - - // some of this stuff is taken from StackWalker - ZeroMemory(&m_currentFrame, sizeof(m_currentFrame)); - DWORD machineType = IMAGE_FILE_MACHINE_UNKNOWN; -#if defined(_M_IX86) - machineType = IMAGE_FILE_MACHINE_I386; - m_currentFrame.AddrPC.Offset = context.Eip; - m_currentFrame.AddrFrame.Offset = context.Ebp; - m_currentFrame.AddrStack.Offset = context.Esp; -#elif defined(_M_X64) - machineType = IMAGE_FILE_MACHINE_AMD64; - m_currentFrame.AddrPC.Offset = context.Rip; - m_currentFrame.AddrFrame.Offset = context.Rbp; - m_currentFrame.AddrStack.Offset = context.Rsp; -#else -# error This architecture is not supported. -#endif - m_currentFrame.AddrPC.Mode = AddrModeFlat; - m_currentFrame.AddrFrame.Mode = AddrModeFlat; - m_currentFrame.AddrStack.Mode = AddrModeFlat; - - SymSetOptions(SymGetOptions() | SYMOPT_UNDNAME | SYMOPT_LOAD_LINES); - SymInitialize(m_process.GetHandle(), NULL, FALSE); - - LoadSymbols(); - - for (int i = 0; /*nothing*/; i++) - { - SetLastError(0); - - if (!StackWalk64( - machineType, - m_process.GetHandle(), - hThread, - &m_currentFrame, - &context, - &Callbacks::ReadProcessMemory, - &Callbacks::SymFunctionTableAccess64, - &Callbacks::SymGetModuleBase64, - NULL)) - { - emit Finished(); - kDebug() << "Stackwalk finished; GetLastError=" << GetLastError(); - break; - } - - FrameChanged(); - - QString modulename = GetModuleName(); - QString functionname = GetFunctionName(); - QString file = GetFile(); - int line = GetLine(); - QString address = QString::number(m_currentFrame.AddrPC.Offset, 16); - - QString debugLine = QString::fromLatin1(BACKTRACE_FORMAT). - arg(modulename).arg(functionname).arg(file).arg(line).arg(address); - - emit DebugLine(debugLine); - } - - // Resume the target thread now, or else the crashing process will not - // be terminated - ResumeThread(hThread); - - SymCleanup(m_process.GetHandle()); -} - -bool AbstractBTGenerator::IsSymbolLoaded(const QString& module) -{ - if (m_symbolsMap.contains(module)) - { - return m_symbolsMap[module]; - } - return false; -} - -void AbstractBTGenerator::LoadSymbols() -{ - TModulesMap modules = m_process.GetModules(); - for (TModulesMap::iterator i = modules.begin(); i != modules.end(); i++) - { - MODULEINFO modInfo; - ZeroMemory(&modInfo, sizeof(modInfo)); - - QString strModule = i.key(); - - GetModuleInformation(m_process.GetHandle(), i.value(), &modInfo, sizeof(modInfo)); - SymLoadModuleEx( - m_process.GetHandle(), - NULL, - (CHAR*) i.key().toLatin1().constData(), - (CHAR*) i.key().toLatin1().constData(), - (DWORD64) modInfo.lpBaseOfDll, - modInfo.SizeOfImage, - NULL, - 0); - - LoadSymbol(strModule, (DWORD64) modInfo.lpBaseOfDll); - - if (!IsSymbolLoaded(strModule)) - { - emit MissingSymbol(strModule); - } - } - emit DebugLine(QString()); - emit DebugLine(QString()); -} diff --git a/drkonqi/kdbgwin/abstract_generator.h b/drkonqi/kdbgwin/abstract_generator.h deleted file mode 100644 index 271b6e0df..000000000 --- a/drkonqi/kdbgwin/abstract_generator.h +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#pragma once - -#include "common.h" -#include "process.h" - -const static char* BACKTRACE_FORMAT = "%1!%2() [%3 @ %4] at 0x%5"; -// module.dll!KClass::function() [c:\file.cpp @ 10] at 0x0001000 - -const static char* DEFAULT_MODULE = "[unknown]"; -const static char* DEFAULT_FUNC = "[unknown]"; -const static char* DEFAULT_FILE = "[unknown]"; -const static int DEFAULT_LINE = -1; - -/** - * \brief Base generator class - * - * This class gives the definition of a backtrace generator. There are 2 subclasses: one for - * MSVC and one for MinGW. The reason why implementation differs is the fact that executables - * use different debugging formats: PDBs (for MSVC) and Dwarf-2/Stabs and possibly more I don't - * know too much about for MinGW, which are embedded in the executable itself. - */ -class AbstractBTGenerator : public QObject -{ - Q_OBJECT -protected: - /// A Process instance, corresponding to the process for which we generate the backtrace - Process m_process; - - /// The current stack frame. It is kept as a member - STACKFRAME64 m_currentFrame; - - /// The definition of a map of symbols - typedef QMap TSymbolsMap; - /// A map of symbols (the full path to the module, and a bool which specifies if - /// symbols were loaded for it) - TSymbolsMap m_symbolsMap; - -public: - /// Constructor - AbstractBTGenerator(const Process& process); - virtual ~AbstractBTGenerator(); - - /// Abstract virtual: Initialize this generator - virtual bool Init() = 0; - - /// Abstract virtual: Uninitialize this generator - virtual void UnInit() = 0; - - /// Start generating the backtrace - virtual void Run(HANDLE hTread, bool bFaultingThread); - - /// This method acts like a callback and will be called when the stack frame changed - virtual void FrameChanged() = 0; - - /// Abstract virtual: get current module name - /// @return the name of the current module (eg: kdecore.dll) - virtual QString GetModuleName(); - - /// Abstract virtual: get current module path - /// @return the full path to the current module (eg: N:\\kde\\bin\\kdecore.dll) - virtual QString GetModulePath(); - - /// Abstract virtual: get current function/method name. The name is undecorated internally by this method. - /// @return the current function or method (eg: KCmdLineArgs::args) - virtual QString GetFunctionName() = 0; - - /// Abstract virtual: get the full path to the current file - /// @return the path to the file (eg: N:\\kde\\svn\\KDE\\trunk\\kdelibs\\kcmdlineargs\\kcmdlineargs.cpp) - virtual QString GetFile() = 0; - - /// Abstract virtual: get current line - /// @return the current line in the file - virtual int GetLine() = 0; - - /// Checks if symbols are loaded for the specified module - /// @return true if symbols are loaded - virtual bool IsSymbolLoaded(const QString& module); - - /// Tries to load symbols for all loaded modules - virtual void LoadSymbols(); - - /// Tries to load a symbol file for a module loaded at dwBaseAddr - virtual void LoadSymbol(const QString& module, DWORD64 dwBaseAddr) = 0; -signals: - /// This will be emitted whenever the generator wishes to output information. It can either be - /// module information (in the form: "Loaded C:\path\to.dll (symbols loaded)", a stack frame line, - /// or newlines - void DebugLine(const QString&); - - /// This signal is emitted when a module is loaded, and its symbols are missing. This is - /// caught by the PackageSuggester - void MissingSymbol(const QString&); - - /// Will be emitted when the generation finishes - void Finished(); -}; diff --git a/drkonqi/kdbgwin/callbacks.cpp b/drkonqi/kdbgwin/callbacks.cpp deleted file mode 100644 index 2d5a18651..000000000 --- a/drkonqi/kdbgwin/callbacks.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#include "callbacks.h" - -BOOL Callbacks::ReadProcessMemory(HANDLE hProcess, DWORD64 qwBaseAddr, PVOID lpBuf, DWORD nSize, LPDWORD lpBytesRead) -{ - SIZE_T st; - BOOL bRet = ::ReadProcessMemory(hProcess, (LPVOID) qwBaseAddr, (LPVOID) lpBuf, nSize, &st); - *lpBytesRead = (DWORD) st; - //kDebug() << "bytes read=" << st << "; bRet=" << bRet << "; LastError: " << GetLastError(); - return bRet; -} - -PVOID Callbacks::SymFunctionTableAccess64(HANDLE hProcess, DWORD64 qwAddr) -{ - PVOID ret = ::SymFunctionTableAccess64(hProcess, qwAddr); - //kDebug() << "ret=" << ret << "; LastError: " << GetLastError(); - return ret; -} - -DWORD64 Callbacks::SymGetModuleBase64(HANDLE hProcess, DWORD64 qwAddr) -{ - DWORD64 ret = ::SymGetModuleBase64(hProcess, qwAddr); - //kDebug() << "ret=" << ret << "; LastError: " << GetLastError(); - return ret; -} diff --git a/drkonqi/kdbgwin/callbacks.h b/drkonqi/kdbgwin/callbacks.h deleted file mode 100644 index 77b712189..000000000 --- a/drkonqi/kdbgwin/callbacks.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#pragma once - -#include "common.h" - -#define KDBGWIN_CALL_TYPE __stdcall - -/** - * \brief StackWalk64 callbacks. - * - * This class encapsulates 3 callbacks used by StackWalk64. ReadProcessMemory is the only - * one really needed here, but I kept all three for debugging purposes. - */ -class Callbacks -{ -public: - static BOOL KDBGWIN_CALL_TYPE ReadProcessMemory(HANDLE, DWORD64, PVOID, DWORD, LPDWORD); - static PVOID KDBGWIN_CALL_TYPE SymFunctionTableAccess64(HANDLE, DWORD64); - static DWORD64 KDBGWIN_CALL_TYPE SymGetModuleBase64(HANDLE, DWORD64); -}; diff --git a/drkonqi/kdbgwin/common.h b/drkonqi/kdbgwin/common.h deleted file mode 100644 index 6c5a5cb03..000000000 --- a/drkonqi/kdbgwin/common.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#pragma once - -// the compiler only provides UNICODE. tchar.h checks for the _UNICODE macro -#if defined(UNICODE) -#define _UNICODE -#endif - -// first: windows & compiler includes -#include -#include -#include -#include -#include -#include -#include - - -// second: Qt includes -#include -#include - - -// third: KDE includes - - -// common defines -#define SafeCloseHandle(h) \ - CloseHandle(h); \ - h = NULL; - -#define ArrayCount(x) (sizeof(x) / sizeof(x[0])) - - - - -// Documentation -/** -\mainpage KDbgWin - -KDbgWin (KDE Debugger for Windows) is a helper application for DrKonqi. Because KDE-Windows supports -2 compilers (MSVC and MinGW), and there is no debugger that supports them both, a simple debugger was needed -to make DrKonqi able to generate backtraces - Windows only. - -MSVC generates .pdb files for its binaries, and GNU GCC embeds debugging information in executables. However, -with MinGW, debugging information can be stripped into external files and then loaded on demand. So the only -difference between the two is how symbols are handled. DbgHelp and LibBfd were used for manipulating and getting -the required information from each debugging format. -*/ diff --git a/drkonqi/kdbgwin/main.cpp b/drkonqi/kdbgwin/main.cpp deleted file mode 100644 index fb7461c6d..000000000 --- a/drkonqi/kdbgwin/main.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#include "msvc_generator.h" -#include "mingw_generator.h" -#include "outputters.h" -#include "process.h" -#include - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - QCoreApplication::setApplicationName("kdbgwin"); - - if (argc != 3) - { - kFatal() << "Parameters are incorrect"; - return -1; - } - - if (!Process::EnableDebugPrivilege()) - { - kFatal() << "Cannot enable debug privilege, exiting"; - return -1; - } - - // ok, argv[1] is the pid of the failing process, - // and argv[2] the current thread id - let's get the info we need - Process proc; - if (!proc.GetInfo(argv[1], argv[2])) - { - kFatal() << "Cannot attach to process, exiting"; - return -1; - } - -#if defined(Q_CC_MSVC) - MsvcGenerator generator(proc); -#elif defined(Q_CC_GNU) - MingwGenerator generator(proc); -#endif - - Outputter outputter; - - QObject::connect(&generator, &MingwGenerator::DebugLine, &outputter, &Outputter::OnDebugLine); - - TThreadsMap::const_iterator it; - for (it = proc.GetThreads().constBegin(); it != proc.GetThreads().constEnd(); it++) - { - generator.Run(it.value(), (it.key() == proc.GetThreadId())? true : false); - } -} diff --git a/drkonqi/kdbgwin/mingw_generator.cpp b/drkonqi/kdbgwin/mingw_generator.cpp deleted file mode 100644 index 347522689..000000000 --- a/drkonqi/kdbgwin/mingw_generator.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#include "mingw_generator.h" -#include -#include - -MingwGenerator::MingwGenerator(const Process& process) - : AbstractBTGenerator(process), file(NULL), func(NULL), line(0) -{} - -struct MyBFD -{ - QString module; - bfd* abfd; - asymbol** syms; - MyBFD() : abfd(0), syms(0) - {} - MyBFD(const QString& module, bfd* abfd, asymbol** syms) - { this->module = module; this->abfd = abfd; this->syms = syms; } - bool operator==(const MyBFD& other) - { return module == other.module; } -}; - -typedef QList TBFDList; -TBFDList bfds; - -asection* text = NULL; - -bool MingwGenerator::Init() -{ - bfd_init(); - return true; -} - -void MingwGenerator::UnInit() -{ -} - -void MingwGenerator::FrameChanged() -{ - QString modPath = GetModulePath(); - bool existsSymbol = false; - TSymbolsMap::const_iterator i = m_symbolsMap.find(modPath); - if (i == m_symbolsMap.end()) - { - return; - } - MyBFD dummy(modPath, NULL, NULL); - int pos = bfds.indexOf(dummy); - if (pos == -1) - { - return; - } - MyBFD bfd = bfds[pos]; - text = bfd_get_section_by_name(bfd.abfd, ".text"); - long offset = m_currentFrame.AddrPC.Offset - text->vma; - file = DEFAULT_FILE; - func = DEFAULT_FUNC; - line = DEFAULT_LINE; - if (offset > 0) - { - bfd_find_nearest_line(bfd.abfd, text, bfd.syms, offset, &file, &func, (unsigned int*) &line); - } -} - -QString MingwGenerator::GetFunctionName() -{ - if (func != NULL) - { - char* realname = abi::__cxa_demangle(func, NULL, NULL, NULL); - if (realname != NULL) - { - QString strReturn = QString::fromLatin1(realname); - free(realname); - return strReturn; - } - else - { - return QString::fromLatin1(func); - } - } - return QString::fromLatin1(DEFAULT_FUNC); -} - -QString MingwGenerator::GetFile() -{ - if (file != NULL) - { - return QString::fromLatin1(file); - } - return QString::fromLatin1(DEFAULT_FILE); -} - -int MingwGenerator::GetLine() -{ - if (line > 0) - { - return line; - } - return -1; -} - -void MingwGenerator::LoadSymbol(const QString& module, DWORD64 dwBaseAddr) -{ - QString symbolFile = module; - symbolFile.truncate(symbolFile.length() - 4); - symbolFile.append(".sym"); - - m_symbolsMap[module] = false; // default - QString symbolType; - do - { - bfd* abfd = bfd_openr(symbolFile.toLatin1(), NULL); - if (abfd == NULL) - { - symbolType = QString::fromLatin1("no symbols loaded"); - break; - } - bfd_check_format(abfd, bfd_object); - unsigned storage_needed = bfd_get_symtab_upper_bound(abfd); - assert(storage_needed > 4); - if (storage_needed <= 4) - { - // i don't know why the minimum value for this var is 4... - symbolType = QString::fromLatin1("no symbols loaded"); - break; - } - asymbol** syms = (asymbol **) malloc(storage_needed); - assert(syms); - if (syms == NULL) - { - symbolType = QString::fromLatin1("no symbols loaded"); - break; - } - symbolType = QString::fromLatin1("symbols loaded"); - m_symbolsMap[module] = true; - - bfds.push_back(MyBFD(module, abfd, syms)); - } - while (0); - - QString strOutput = QString::fromLatin1("Loaded %1 (%2)") - .arg(module).arg(symbolType); - emit DebugLine(strOutput); -} diff --git a/drkonqi/kdbgwin/mingw_generator.h b/drkonqi/kdbgwin/mingw_generator.h deleted file mode 100644 index a232b6720..000000000 --- a/drkonqi/kdbgwin/mingw_generator.h +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#pragma once - -#include "abstract_generator.h" - -/** - * \brief Generator for MinGW. - * - * This class allows generating backtraces for executables created with the MinGW compiler. - * It assumes that symbols are stored in .sym files in the same directory as the corresponding - * binary (eg. N:\\kde\\bin\\libkdecore.dll and N:\\kde\\bin\\libkdecore.sym). It uses libbfd to - * find and extract the information it needs from the symbols it loads. - */ -class MingwGenerator : public AbstractBTGenerator -{ - Q_OBJECT -protected: - /// The current file - const char* file; - /// The current function - const char* func; - /// The current line - int line; -public: - /// Constructor - MingwGenerator(const Process& process); - - virtual bool Init(); - virtual void UnInit(); - - virtual void FrameChanged(); - - virtual QString GetFunctionName(); - virtual QString GetFile(); - virtual int GetLine(); - - virtual void LoadSymbol(const QString& module, DWORD64 dwBaseAddr); -}; diff --git a/drkonqi/kdbgwin/msvc_generator.cpp b/drkonqi/kdbgwin/msvc_generator.cpp deleted file mode 100644 index 7d72c12ee..000000000 --- a/drkonqi/kdbgwin/msvc_generator.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#include "msvc_generator.h" - -MsvcGenerator::MsvcGenerator(const Process& process) - : AbstractBTGenerator(process) -{} - -bool MsvcGenerator::Init() -{ - return true; -} - -void MsvcGenerator::UnInit() -{ -} - -QString MsvcGenerator::GetFunctionName() -{ - PSYMBOL_INFO symbol = - (PSYMBOL_INFO) malloc(sizeof(SYMBOL_INFO) + MAX_SYMBOL_NAME); - ZeroMemory(symbol, sizeof(symbol) + MAX_SYMBOL_NAME); - symbol->SizeOfStruct = sizeof(SYMBOL_INFO); - symbol->MaxNameLen = MAX_SYMBOL_NAME; - - DWORD64 dwDisplacement = 0; - - if (!SymFromAddr(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &dwDisplacement, symbol)) - { - kError() << "SymFromAddr() failed: " << GetLastError(); - return QString::fromLatin1(DEFAULT_FUNC); - } - - char undecoratedName[MAX_PATH] = {0}; - if (!UnDecorateSymbolName(symbol->Name, undecoratedName, MAX_PATH, UNDNAME_COMPLETE)) - { - // if this fails, show the decorated name anyway, don't fail - kError() << "UnDecorateSymbolName() failed: " << GetLastError(); - return QString::fromLatin1(symbol->Name); - } - - return QString::fromLatin1(undecoratedName); -} - -QString MsvcGenerator::GetFile() -{ - IMAGEHLP_LINE64 line; - ZeroMemory(&line, sizeof(line)); - line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); - DWORD dwDisplacement = 0; - - if (!SymGetLineFromAddr64(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &dwDisplacement, &line)) - { - kError() << "SymGetLineFromAddr64 failed: " << GetLastError(); - return QString::fromLatin1(DEFAULT_FILE); - } - - return QString(line.FileName); -} - -int MsvcGenerator::GetLine() -{ - IMAGEHLP_LINE64 line; - ZeroMemory(&line, sizeof(line)); - line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); - DWORD dwDisplacement = 0; - - if (!SymGetLineFromAddr64(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &dwDisplacement, &line)) - { - //kError() << "SymGetLineFromAddr64 failed: " << GetLastError(); - return DEFAULT_LINE; - } - - return (int) line.LineNumber; -} - -void MsvcGenerator::LoadSymbol(const QString& module, DWORD64 dwBaseAddr) -{ - QString strOutput; - - IMAGEHLP_MODULE64 moduleInfo; - ZeroMemory(&moduleInfo, sizeof(moduleInfo)); - moduleInfo.SizeOfStruct = sizeof(moduleInfo); - SymGetModuleInfo64(m_process.GetHandle(), dwBaseAddr, &moduleInfo); - - m_symbolsMap[module] = false; // default - QString symbolType; - switch (moduleInfo.SymType) - { - case SymNone: - symbolType = QString::fromLatin1("no symbols loaded"); - break; - case SymCoff: - case SymCv: - case SymPdb: - case SymSym: - case SymDia: - symbolType = QString::fromLatin1("symbols loaded"); - m_symbolsMap[module] = true; - break; - case SymExport: - symbolType = QString::fromLatin1("export table only"); - break; - case SymDeferred: - symbolType = QString::fromLatin1("deferred (not loaded currently)"); - break; - case SymVirtual: - symbolType = QString::fromLatin1("virtual"); - break; - } - - strOutput = QString::fromLatin1("Loaded %1 (%2)") - .arg(module).arg(symbolType); - - emit DebugLine(strOutput); -} diff --git a/drkonqi/kdbgwin/msvc_generator.h b/drkonqi/kdbgwin/msvc_generator.h deleted file mode 100644 index acdefc352..000000000 --- a/drkonqi/kdbgwin/msvc_generator.h +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#pragma once - -#include "abstract_generator.h" - -const static DWORD MAX_SYMBOL_NAME = 256 * sizeof(TCHAR); - -/** - * \brief Generator for MSVC. - * - * This class implements a backtrace generator for executables created with Microsoft's - * Visual C++. The fundamental difference of executables created with MSVC and MinGW is - * the debugging format. MSVC uses a proprietary debugging format called PDB (Program - * Database), which can be manipulated with DbgHelp API. - * - */ -class MsvcGenerator : public AbstractBTGenerator -{ - Q_OBJECT -public: - /// Constructor - MsvcGenerator(const Process& process); - - virtual bool Init(); - virtual void UnInit(); - - virtual void FrameChanged() {}; - - virtual QString GetFunctionName(); - virtual QString GetFile(); - virtual int GetLine(); - - virtual void LoadSymbol(const QString& module, DWORD64 dwBaseAddr); -}; diff --git a/drkonqi/kdbgwin/outputters.cpp b/drkonqi/kdbgwin/outputters.cpp deleted file mode 100644 index bff788f0b..000000000 --- a/drkonqi/kdbgwin/outputters.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#include "outputters.h" - -Outputter::Outputter() : stream(stdout) -{ -} - -void Outputter::OnDebugLine(const QString& line) -{ - stream << line << '\n'; -} diff --git a/drkonqi/kdbgwin/outputters.h b/drkonqi/kdbgwin/outputters.h deleted file mode 100644 index 02fc37c54..000000000 --- a/drkonqi/kdbgwin/outputters.h +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#pragma once - -#include "common.h" -#include - -/** - * \brief Basic outputter. - * - * This class will output the information from a backtrace generator. - */ -class Outputter : public QObject -{ - Q_OBJECT - -protected: - QTextStream stream; - -public: - Outputter(); - -public slots: - /// The slot that will be called for each line emitted by the generator. This method - /// sends the string to stdout and kDebug() - void OnDebugLine(const QString&); -}; diff --git a/drkonqi/kdbgwin/process.cpp b/drkonqi/kdbgwin/process.cpp deleted file mode 100644 index ad6bfd2df..000000000 --- a/drkonqi/kdbgwin/process.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#include "common.h" -#include "process.h" - -Process::Process() - : m_bValid(FALSE) -{ -} - -// we need debug privileges to open the proces with PROCESS_ALL_ACCESS, and -// to successfully use ReadProcessMemory() -BOOL Process::EnableDebugPrivilege() -{ - kDebug() << "Enabling debug privilege"; - HANDLE hToken = NULL; - - if (!OpenThreadToken(GetCurrentThread(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, FALSE, &hToken)) - { - if (GetLastError() == ERROR_NO_TOKEN) - { - if (!ImpersonateSelf(SecurityImpersonation)) - { - kError() << "ImpersonateSelf() failed: " << GetLastError(); - return FALSE; - } - if (!OpenThreadToken(GetCurrentThread(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, FALSE, &hToken)) - { - kError() << "OpenThreadToken() #2 failed: " << GetLastError(); - return FALSE; - } - } - else - { - kError() << "OpenThreadToken() #1 failed: " << GetLastError(); - return FALSE; - } - } - - LUID luid; - if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luid)) - { - assert(false); - kError() << "Cannot lookup privilege: " << GetLastError(); - SafeCloseHandle(hToken); - return FALSE; - } - - TOKEN_PRIVILEGES tp; - tp.PrivilegeCount = 1; - tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - tp.Privileges[0].Luid = luid; - - if (!AdjustTokenPrivileges(hToken, FALSE, &tp, NULL, (PTOKEN_PRIVILEGES) NULL, (PDWORD) NULL)) - { - assert(false); - kError() << "Cannot adjust privilege: " << GetLastError(); - SafeCloseHandle(hToken); - return FALSE; - } - - SafeCloseHandle(hToken); - return TRUE; -} - -BOOL Process::GetInfo(const char* pid, const char* threadId) -{ - kDebug() << "Trying to get info about pid=" << pid; - - DWORD dwPid = DWORD(atoi(pid)); - DWORD dwThread = DWORD(atoi(threadId)); - - // get handle to the process - HANDLE hProcess = NULL; - hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPid); - assert(hProcess); - if (hProcess == NULL) - { - kError() << "Cannot open process " << dwPid << ": " << GetLastError(); - return m_bValid; - } - m_dwPid = dwPid; - m_hProcess = hProcess; - m_dwThread = dwThread; - - TCHAR procPath[MAX_PATH * 2 + 1] = {0}; - GetModuleFileNameEx(hProcess, NULL, procPath, MAX_PATH*2 + 1); - m_path = QString::fromWCharArray(procPath); - - // we can't get the threads for a single process, so get all system's - // threads, and enumerate through them - HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, NULL); - if (hSnapshot == INVALID_HANDLE_VALUE) - { - kError() << "CreateToolhelp32Snapshot() failed: " << GetLastError(); - assert(false); - return m_bValid; - } - - // get process threads - THREADENTRY32 te; - ZeroMemory(&te, sizeof(te)); - te.dwSize = sizeof(te); - if (Thread32First(hSnapshot, &te)) - { - do - { - if (te.th32OwnerProcessID == dwPid) - { - kDebug() << "Found thread " << te.th32ThreadID << ", adding to list"; - - HANDLE hThread = NULL; - hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, te.th32ThreadID); - assert(hThread); - if (hThread == NULL) - { - kError() << "Cannot open thread " << te.th32ThreadID << ": " << GetLastError(); - continue; - } - - m_threads[te.th32ThreadID] = hThread; - // we have at least 1 thread, make this valid - m_bValid = TRUE; - } - } - while (Thread32Next(hSnapshot, &te)); - } - SafeCloseHandle(hSnapshot); - - assert(m_threads.size() > 0); - - // get process modules - HMODULE hMods[1024]; - DWORD cbNeeded = 0; - if (!EnumProcessModules(hProcess, hMods, ArrayCount(hMods), &cbNeeded)) - { - kError() << "Cannot enumerate modules: " << GetLastError(); - return m_bValid; - } - for (size_t i = 0; i < (cbNeeded / sizeof(hMods[0])); i++) - { - /* - * In Windows, a wchar_t has 2 bytes; GCC defines wchar_t as int, - * which is 4 bytes; so i can't use TCHAR here; better off using ushort - * and casting when necessary - */ - ushort szModName[MAX_PATH]; - if (GetModuleFileNameEx(hProcess, hMods[i], (LPTSTR) szModName, MAX_PATH)) - { - //QString str = QString::fromUtf16(szModName); - //kDebug() << "Got module: " << str; - //m_modules.push_back(QString::fromUtf16(szModName)); - m_modules[QString::fromUtf16(szModName)] = hMods[i]; - } - } - - return m_bValid; -} diff --git a/drkonqi/kdbgwin/process.h b/drkonqi/kdbgwin/process.h deleted file mode 100644 index ff5d1572e..000000000 --- a/drkonqi/kdbgwin/process.h +++ /dev/null @@ -1,107 +0,0 @@ -/****************************************************************** - * - * kdbgwin - Helper application for DrKonqi - * - * This file is part of the KDE project - * - * Copyright (C) 2010 Ilie Halip - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see - *****************************************************************/ - -#pragma once - -#include "common.h" - -typedef QMap TThreadsMap; -typedef QMap TModulesMap; - -/** - * \brief Describes a process. - * - * This is a helper class when dealing with another process. When kdbgwin starts, - * it attaches to the crashing process and tries to retrieve useful information: - * pid, threads, modules, image path. These will be used later. - */ -class Process -{ -private: - /// Flag to check if the information about this process is valid and can be used - BOOL m_bValid; - - /// Process ID - DWORD m_dwPid; - - /// Failing thread ID - I need this because for the crashing thread, I need to get - /// the CONTEXT from a piece of shared memory in KCrash - DWORD m_dwThread; - - /// A handle to the process - HANDLE m_hProcess; - - /// A QMap which associates thread IDs with opened handles for each - /// of them - TThreadsMap m_threads; - - /// The full path to the executable file which started this process - QString m_path; - - /// A QMap which contains the paths to the loaded modules and - /// handles to each of them - TModulesMap m_modules; - -public: - Process(); - -public: - /// kdbgwin needs to enable the debug privilege in order to read from - /// another process's memory. - static BOOL EnableDebugPrivilege(); - -public: - /// Attaches to the process and gets all required information - /// @return TRUE if operation succeeds - BOOL GetInfo(const char* pid, const char* threadId); - - /// Checks if the information is valid - BOOL IsValid() const - { assert(m_bValid); return m_bValid; } - - /// Get the process ID - DWORD GetId() const - { assert(m_dwPid); return m_dwPid; } - - /// Returns an open handle to the process (opened with PROCESS_ALL_ACCESS) - HANDLE GetHandle() const - { assert(m_hProcess); return m_hProcess; } - - /// Returns the thread ID of the thread that caused the exception - DWORD GetThreadId() const - { assert(m_dwThread); return m_dwThread; } - - /// Returns the threads map - const TThreadsMap& GetThreads() const - { return m_threads; } - - /// Returns the full path to the executable on the disk - const QString& GetPath() const - { return m_path; } - - /// Returns a map of all the loaded modules - const TModulesMap& GetModules() const - { return m_modules; } -}; diff --git a/drkonqi/main.cpp b/drkonqi/main.cpp deleted file mode 100644 index e88a0646f..000000000 --- a/drkonqi/main.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/***************************************************************** - * drkonqi - The KDE Crash Handler - * - * Copyright (C) 2000-2003 Hans Petter Bieker - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************/ - -#include -#include - -#include -#include -#include - -#include -#if HAVE_X11 -#include -#endif - -#include "drkonqi.h" -#include "drkonqidialog.h" -#include "statusnotifier.h" - -static const char version[] = PROJECT_VERSION; -static const char description[] = I18N_NOOP("The KDE Crash Handler gives the user feedback " - "if a program has crashed."); - -int main(int argc, char* argv[]) -{ -#ifndef Q_OS_WIN //krazy:exclude=cpp -// Drop privs. - setgid(getgid()); - if (setuid(getuid()) < 0 && geteuid() != getuid()) { - exit(255); - } -#endif - - KLocalizedString::setApplicationDomain("drkonqi5"); - - QApplication qa(argc, argv); - qa.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - QCoreApplication::setApplicationName(QStringLiteral("drkonqi")); - QCoreApplication::setApplicationVersion(version); - - // Prevent KApplication from setting the crash handler. We will set it later... - setenv("KDE_DEBUG", "true", 1); - // Session management is not needed, do not even connect in order to survive longer than ksmserver. - unsetenv("SESSION_MANAGER"); - - KAboutData aboutData(QStringLiteral("drkonqi"), i18n("The KDE Crash Handler"), - version, i18n(description), - KAboutLicense::GPL, - i18n("(C) 2000-2009, The DrKonqi Authors")); - aboutData.addAuthor(i18nc("@info:credit","Hans Petter Bieker"), QString(), - QStringLiteral("bieker@kde.org")); - aboutData.addAuthor(i18nc("@info:credit","Dario Andres Rodriguez"), QString(), - QStringLiteral("andresbajotierra@gmail.com")); - aboutData.addAuthor(i18nc("@info:credit","George Kiagiadakis"), QString(), - QStringLiteral("gkiagia@users.sourceforge.net")); - aboutData.addAuthor(i18nc("@info:credit","A. L. Spehr"), QString(), - QStringLiteral("spehr@kde.org")); - qa.setWindowIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"))); - - QCommandLineParser parser; - parser.setApplicationDescription(description); - parser.addHelpOption(); - parser.addVersionOption(); - - QCommandLineOption signalOption(QStringLiteral("signal"), i18nc("@info:shell","The signal that was caught"), QStringLiteral("number")); - QCommandLineOption appNameOption(QStringLiteral("appname"), i18nc("@info:shell"," of the program"), QStringLiteral("name")); - QCommandLineOption appPathOption(QStringLiteral("apppath"), i18nc("@info:shell"," to the executable"), QStringLiteral("path")); - QCommandLineOption appVersionOption(QStringLiteral("appversion"), i18nc("@info:shell","The of the program"), QStringLiteral("version")); - QCommandLineOption bugAddressOption(QStringLiteral("bugaddress"), i18nc("@info:shell","The bug
to use"), QStringLiteral("address")); - QCommandLineOption programNameOption(QStringLiteral("programname"), i18nc("@info:shell","Translated of the program"), QStringLiteral("name")); - QCommandLineOption pidOption(QStringLiteral("pid"), i18nc("@info:shell","The of the program"), QStringLiteral("pid")); - QCommandLineOption startupIdOption(QStringLiteral("startupid"), i18nc("@info:shell","Startup of the program"), QStringLiteral("id")); - QCommandLineOption kdeinitOption(QStringLiteral("kdeinit"), i18nc("@info:shell","The program was started by kdeinit")); - QCommandLineOption saferOption(QStringLiteral("safer"), i18nc("@info:shell","Disable arbitrary disk access")); - QCommandLineOption restartedOption(QStringLiteral("restarted"), i18nc("@info:shell","The program has already been restarted")); - QCommandLineOption keepRunningOption(QStringLiteral("keeprunning"), i18nc("@info:shell","Keep the program running and generate " - "the backtrace at startup")); - QCommandLineOption threadOption(QStringLiteral("thread"), i18nc("@info:shell","The of the failing thread"), QStringLiteral("threadid")); - QCommandLineOption dialogOption(QStringLiteral("dialog"), i18nc("@info:shell","Do not show a notification but launch the debug dialog directly")); - - parser.addOption(signalOption); - parser.addOption(appNameOption); - parser.addOption(appPathOption); - parser.addOption(appVersionOption); - parser.addOption(bugAddressOption); - parser.addOption(programNameOption); - parser.addOption(pidOption); - parser.addOption(startupIdOption); - parser.addOption(kdeinitOption); - parser.addOption(saferOption); - parser.addOption(restartedOption); - parser.addOption(keepRunningOption); - parser.addOption(threadOption); - parser.addOption(dialogOption); - - aboutData.setupCommandLine(&parser); - parser.process(qa); - aboutData.processCommandLine(&parser); - - DrKonqi::setSignal(parser.value(signalOption).toInt()); - DrKonqi::setAppName(parser.value(appNameOption)); - DrKonqi::setAppPath(parser.value(appPathOption)); - DrKonqi::setAppVersion(parser.value(appVersionOption)); - DrKonqi::setBugAddress(parser.value(bugAddressOption)); - DrKonqi::setProgramName(parser.value(programNameOption)); - DrKonqi::setPid(parser.value(pidOption).toInt()); - DrKonqi::setKdeinit(parser.isSet(kdeinitOption)); - DrKonqi::setSafer(parser.isSet(saferOption)); - DrKonqi::setRestarted(parser.isSet(restartedOption)); - DrKonqi::setKeepRunning(parser.isSet(keepRunningOption)); - DrKonqi::setThread(parser.value(threadOption).toInt()); - auto forceDialog = parser.isSet(dialogOption); - -#if HAVE_X11 - const QString startupId = parser.value(startupIdOption); - if (!startupId.isEmpty()) { - QX11Info::setNextStartupId(startupId.toUtf8()); - } -#endif - - if (!DrKonqi::init()) { - return 1; - } - - qa.setQuitOnLastWindowClosed(false); - - auto openDrKonqiDialog = [&qa]{ - DrKonqiDialog *w = new DrKonqiDialog(); - QObject::connect(w, &DrKonqiDialog::rejected, &qa, &QApplication::quit); - w->show(); - }; - - bool restarted = parser.isSet(restartedOption); - - // if no notification service is running (eg. shell crashed, or other desktop environment) - // and we didn't auto-restart the app, open DrKonqi dialog instead of showing an SNI - // and emitting a desktop notification - if (forceDialog || (!restarted && !StatusNotifier::notificationServiceRegistered())) { - openDrKonqiDialog(); - } else { - StatusNotifier *statusNotifier = new StatusNotifier(); - if (!restarted) { - statusNotifier->notify(); - } - QObject::connect(statusNotifier, &StatusNotifier::expired, &qa, &QApplication::quit); - QObject::connect(statusNotifier, &StatusNotifier::activated, openDrKonqiDialog); - } - - int ret = qa.exec(); - - DrKonqi::cleanup(); - return ret; -} diff --git a/drkonqi/parser/CMakeLists.txt b/drkonqi/parser/CMakeLists.txt deleted file mode 100644 index 0c16e559d..000000000 --- a/drkonqi/parser/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(BACKTRACEPARSER_SRCS - backtraceparser.cpp - backtraceparsergdb.cpp - backtraceparserkdbgwin.cpp - backtraceparsernull.cpp -) - -add_library(drkonqi_backtrace_parser STATIC ${BACKTRACEPARSER_SRCS}) -target_link_libraries(drkonqi_backtrace_parser - PUBLIC - Qt5::Core -) diff --git a/drkonqi/parser/backtraceline.h b/drkonqi/parser/backtraceline.h deleted file mode 100644 index 672faeed3..000000000 --- a/drkonqi/parser/backtraceline.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef BACKTRACELINE_H -#define BACKTRACELINE_H - -#include -#include - -class BacktraceLine -{ -public: - enum LineType { - Unknown, //unknown type. the default - EmptyLine, //line is empty - Crap, //line is gdb's crap (like "(no debugging symbols found)", - //"[New Thread 0x4275c950 (LWP 11931)]", etc...) - KCrash, //line is "[KCrash Handler]" - ThreadIndicator, //line indicates the current thread, - //ex. "[Current thread is 0 (process 11313)]" - ThreadStart, //line indicates the start of a thread's stack. - SignalHandlerStart, //line indicates the signal handler start - //(contains "") - StackFrame //line is a normal stack frame - }; - - enum LineRating { - /* RATING -- EXAMPLE */ - MissingEverything = 0, // #0 0x0000dead in ?? () - MissingFunction = 1, // #0 0x0000dead in ?? () from /usr/lib/libfoobar.so.4 - MissingLibrary = 2, // #0 0x0000dead in foobar() - MissingSourceFile = 3, // #0 0x0000dead in FooBar::FooBar () from /usr/lib/libfoobar.so.4 - Good = 4, // #0 0x0000dead in FooBar::crash (this=0x0) at /home/user/foobar.cpp:204 - InvalidRating = -1 // (dummy invalid value) - }; - - static const LineRating BestRating = Good; - - BacktraceLine() : d(new Data) {} - - QString toString() const { - return d->m_line; - } - LineType type() const { - return d->m_type; - } - LineRating rating() const { - return d->m_rating; - } - - int frameNumber() const { - return d->m_stackFrameNumber; - } - QString functionName() const { - return d->m_functionName; - } - QString fileName() const { - return d->m_file; - } - QString libraryName() const { - return d->m_library; - } - -protected: - class Data : public QSharedData - { - public: - Data() : m_type(Unknown), m_rating(InvalidRating), - m_stackFrameNumber(-1) {} - - QString m_line; - LineType m_type; - LineRating m_rating; - int m_stackFrameNumber; - QString m_functionName; - QString m_file; - QString m_library; - }; - QExplicitlySharedDataPointer d; -}; - -#endif // BACKTRACELINE_H diff --git a/drkonqi/parser/backtraceparser.cpp b/drkonqi/parser/backtraceparser.cpp deleted file mode 100644 index 23d27410a..000000000 --- a/drkonqi/parser/backtraceparser.cpp +++ /dev/null @@ -1,394 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "backtraceparser_p.h" -#include "backtraceparsergdb.h" -#include "backtraceparserkdbgwin.h" -#include "backtraceparsernull.h" -#include -#include -#include - -//factory -BacktraceParser *BacktraceParser::newParser(const QString & debuggerName, QObject *parent) -{ - if (debuggerName == QLatin1String("gdb")) { - return new BacktraceParserGdb(parent); - } else if (debuggerName == QLatin1String("kdbgwin")) { - return new BacktraceParserKdbgwin(parent); - } else { - return new BacktraceParserNull(parent); - } -} - -BacktraceParser::BacktraceParser(QObject *parent) : QObject(parent), d_ptr(NULL) {} -BacktraceParser::~BacktraceParser() { delete d_ptr; } - -void BacktraceParser::connectToGenerator(QObject *generator) -{ - connect(generator, SIGNAL(starting()), this, SLOT(resetState())); - connect(generator, SIGNAL(newLine(QString)), this, SLOT(newLine(QString))); -} - -QString BacktraceParser::parsedBacktrace() const -{ - Q_D(const BacktraceParser); - - QString result; - if (d) { - QList::const_iterator i; - for (i = d->m_linesList.constBegin(); i != d->m_linesList.constEnd(); ++i) { - result += i->toString(); - } - } - return result; -} - -QList BacktraceParser::parsedBacktraceLines() const -{ - Q_D(const BacktraceParser); - return d ? d->m_linesList : QList(); -} - -QString BacktraceParser::simplifiedBacktrace() const -{ - Q_D(const BacktraceParser); - - //if there is no cached usefulness, the data calculation function has not run yet. - if (d && d->m_usefulness == InvalidUsefulness) { - const_cast(this)->calculateRatingData(); - } - - //if there is no d, the debugger has not run yet, so we have no backtrace. - return d ? d->m_simplifiedBacktrace : QString(); -} - -BacktraceParser::Usefulness BacktraceParser::backtraceUsefulness() const -{ - Q_D(const BacktraceParser); - - //if there is no cached usefulness, the data calculation function has not run yet. - if (d && d->m_usefulness == InvalidUsefulness) { - const_cast(this)->calculateRatingData(); - } - - //if there is no d, the debugger has not run yet, - //so we can say that the (inexistent) backtrace is Useless. - return d ? d->m_usefulness : Useless; -} - -QStringList BacktraceParser::firstValidFunctions() const -{ - Q_D(const BacktraceParser); - - //if there is no cached usefulness, the data calculation function has not run yet. - if (d && d->m_usefulness == InvalidUsefulness) { - const_cast(this)->calculateRatingData(); - } - - //if there is no d, the debugger has not run yet, so we have no functions to return. - return d ? d->m_firstUsefulFunctions : QStringList(); -} - - -QSet BacktraceParser::librariesWithMissingDebugSymbols() const -{ - Q_D(const BacktraceParser); - - //if there is no cached usefulness, the data calculation function has not run yet. - if (d && d->m_usefulness == InvalidUsefulness) { - const_cast(this)->calculateRatingData(); - } - - //if there is no d, the debugger has not run yet, so we have no libraries. - return d ? d->m_librariesWithMissingDebugSymbols : QSet(); -} - -void BacktraceParser::resetState() -{ - //reset the state of the parser by getting a new instance of Private - delete d_ptr; - d_ptr = constructPrivate(); -} - -BacktraceParserPrivate *BacktraceParser::constructPrivate() const -{ - return new BacktraceParserPrivate; -} - - -/* This function returns true if the given stack frame line is the base of the backtrace - and thus the parser should not rate any frames below that one. */ -static bool lineIsStackBase(const BacktraceLine & line) -{ - //optimization. if there is no function name, do not bother to check it - if ( line.rating() == BacktraceLine::MissingEverything - || line.rating() == BacktraceLine::MissingFunction ) - return false; - - //this is the base frame for all threads except the main thread - //FIXME that probably works only on linux - if ( line.functionName() == QLatin1String("start_thread") ) - return true; - - QRegExp regExp; - regExp.setPattern(QStringLiteral("(kde)?main")); //main() or kdemain() is the base for the main thread - if ( regExp.exactMatch(line.functionName()) ) - return true; - - //HACK for better rating. we ignore all stack frames below any function that matches - //the following regular expression. The functions that match this expression are usually - //"QApplicationPrivate::notify_helper", "QApplication::notify" and similar, which - //are used to send any kind of event to the Qt application. All stack frames below this, - //with or without debug symbols, are useless to KDE developers, so we ignore them. - regExp.setPattern(QStringLiteral("(Q|K)(Core)?Application(Private)?::notify.*")); - if ( regExp.exactMatch(line.functionName()) ) - return true; - - //attempt to recognize crashes that happen after main has returned (bug 200993) - if ( line.functionName() == QLatin1String("~KCleanUpGlobalStatic") || - line.functionName() == QLatin1String("~QGlobalStatic") || - line.functionName() == QLatin1String("exit") || - line.functionName() == QLatin1String("*__GI_exit") ) - return true; - - return false; -} - -/* This function returns true if the given stack frame line is the top of the bactrace - and thus the parser should not rate any frames above that one. This is used to avoid - rating the stack frames of abort(), assert(), Q_ASSERT() and qFatal() */ -static bool lineIsStackTop(const BacktraceLine & line) -{ - //optimization. if there is no function name, do not bother to check it - if ( line.rating() == BacktraceLine::MissingEverything - || line.rating() == BacktraceLine::MissingFunction ) - return false; - - if ( line.functionName().startsWith(QLatin1String("qt_assert")) //qt_assert and qt_assert_x - || line.functionName() == QLatin1String("qFatal") - || line.functionName() == QLatin1String("abort") - || line.functionName() == QLatin1String("*__GI_abort") - || line.functionName() == QLatin1String("*__GI___assert_fail") ) - return true; - - return false; -} - -/* This function returns true if the given stack frame line should be ignored from rating - for some reason. Currently it ignores all libc/libstdc++/libpthread functions. */ -static bool lineShouldBeIgnored(const BacktraceLine & line) -{ - if ( line.libraryName().contains(QStringLiteral("libc.so")) - || line.libraryName().contains(QStringLiteral("libstdc++.so")) - || line.functionName().startsWith(QLatin1String("*__GI_")) //glibc2.9 uses *__GI_ as prefix - || line.libraryName().contains(QStringLiteral("libpthread.so")) - || line.libraryName().contains(QStringLiteral("libglib-2.0.so")) - || line.libraryName().contains(QStringLiteral("ntdll.dll")) - || line.libraryName().contains(QStringLiteral("kernel32.dll")) - || line.functionName().contains(QStringLiteral("_tmain")) - || line.functionName() == QLatin1String("WinMain") ) - return true; - - return false; -} - -static bool isFunctionUseful(const BacktraceLine & line) -{ - //We need the function name - if ( line.rating() == BacktraceLine::MissingEverything - || line.rating() == BacktraceLine::MissingFunction ) { - return false; - } - - //Misc ignores - if ( line.functionName() == QLatin1String("__kernel_vsyscall") - || line.functionName() == QLatin1String("raise") - || line.functionName() == QLatin1String("abort") - || line.functionName() == QLatin1String("__libc_message") - || line.functionName() == QLatin1String("thr_kill") /* *BSD */) { - return false; - } - - //Ignore core Qt functions - //(QObject can be useful in some cases) - if ( line.functionName().startsWith(QLatin1String("QBasicAtomicInt::")) - || line.functionName().startsWith(QLatin1String("QBasicAtomicPointer::")) - || line.functionName().startsWith(QLatin1String("QAtomicInt::")) - || line.functionName().startsWith(QLatin1String("QAtomicPointer::")) - || line.functionName().startsWith(QLatin1String("QMetaObject::")) - || line.functionName().startsWith(QLatin1String("QPointer::")) - || line.functionName().startsWith(QLatin1String("QWeakPointer::")) - || line.functionName().startsWith(QLatin1String("QSharedPointer::")) - || line.functionName().startsWith(QLatin1String("QScopedPointer::")) - || line.functionName().startsWith(QLatin1String("QMetaCallEvent::")) ) { - return false; - } - - //Ignore core Qt containers misc functions - if ( line.functionName().endsWith(QLatin1String("detach")) - || line.functionName().endsWith(QLatin1String("detach_helper")) - || line.functionName().endsWith(QLatin1String("node_create")) - || line.functionName().endsWith(QLatin1String("deref")) - || line.functionName().endsWith(QLatin1String("ref")) - || line.functionName().endsWith(QLatin1String("node_copy")) - || line.functionName().endsWith(QLatin1String("d_func")) ) { - return false; - } - - //Misc Qt stuff - if ( line.functionName() == QLatin1String("qt_message_output") - || line.functionName() == QLatin1String("qt_message") - || line.functionName() == QLatin1String("qFatal") - || line.functionName().startsWith(QLatin1String("qGetPtrHelper")) - || line.functionName().startsWith(QLatin1String("qt_meta_")) ) { - return false; - } - - return true; -} - -static bool isFunctionUsefulForSearch(const BacktraceLine & line) -{ - //Ignore Qt containers (and iterators Q*Iterator) - if ( line.functionName().startsWith(QLatin1String("QList")) - || line.functionName().startsWith(QLatin1String("QLinkedList")) - || line.functionName().startsWith(QLatin1String("QVector")) - || line.functionName().startsWith(QLatin1String("QStack")) - || line.functionName().startsWith(QLatin1String("QQueue")) - || line.functionName().startsWith(QLatin1String("QSet")) - || line.functionName().startsWith(QLatin1String("QMap")) - || line.functionName().startsWith(QLatin1String("QMultiMap")) - || line.functionName().startsWith(QLatin1String("QMapData")) - || line.functionName().startsWith(QLatin1String("QHash")) - || line.functionName().startsWith(QLatin1String("QMultiHash")) - || line.functionName().startsWith(QLatin1String("QHashData")) ) { - return false; - } - - return true; -} - -void BacktraceParser::calculateRatingData() -{ - Q_D(BacktraceParser); - - uint rating = 0, bestPossibleRating = 0, counter = 0; - bool haveSeenStackBase = false; - - QListIterator i(d->m_linesToRate); - i.toBack(); //start from the end of the list - - while( i.hasPrevious() ) { - const BacktraceLine & line = i.previous(); - - if ( !i.hasPrevious() && line.rating() == BacktraceLine::MissingEverything ) { - //Under some circumstances, the very first stack frame is invalid (ex, calling a function - //at an invalid address could result in a stack frame like "0x00000000 in ?? ()"), - //which however does not necessarily mean that the backtrace has a missing symbol on - //the first line. Here we make sure to ignore this line from rating. (bug 190882) - break; //there are no more items anyway, just break the loop - } - - if ( lineIsStackBase(line) ) { - rating = bestPossibleRating = counter = 0; //restart rating ignoring any previous frames - haveSeenStackBase = true; - } else if ( lineIsStackTop(line) ) { - break; //we have reached the top, no need to inspect any more frames - } - - if ( lineShouldBeIgnored(line) ) { - continue; - } - - if ( line.rating() == BacktraceLine::MissingFunction - || line.rating() == BacktraceLine::MissingSourceFile) { - d->m_librariesWithMissingDebugSymbols.insert(line.libraryName().trimmed()); - } - - uint multiplier = ++counter; //give weight to the first lines - rating += static_cast(line.rating()) * multiplier; - bestPossibleRating += static_cast(BacktraceLine::BestRating) * multiplier; - - qDebug() << line.rating() << line.toString(); - } - - //Generate a simplified backtrace - //- Starts from the first useful function - //- Max of 5 lines - //- Replaces garbage with [...] - //At the same time, grab the first three useful functions for search queries - - i.toFront(); //Reuse the list iterator - int functionIndex = 0; - int usefulFunctionsCount = 0; - bool firstUsefulFound = false; - while( i.hasNext() && functionIndex < 5 ) { - const BacktraceLine & line = i.next(); - if ( !lineShouldBeIgnored(line) && isFunctionUseful(line) ) { //Line is not garbage to use - if (!firstUsefulFound) { - firstUsefulFound = true; - } - //Save simplified backtrace line - d->m_simplifiedBacktrace += line.toString(); - - //Fetch three useful functions (only functionName) for search queries - if (usefulFunctionsCount < 3 && isFunctionUsefulForSearch(line) && - !d->m_firstUsefulFunctions.contains(line.functionName())) { - d->m_firstUsefulFunctions.append(line.functionName()); - usefulFunctionsCount++; - } - - functionIndex++; - } else if (firstUsefulFound) { - //Add "[...]" if there are invalid functions in the middle - if (!d->m_simplifiedBacktrace.endsWith(QLatin1String("[...]\n"))) { - d->m_simplifiedBacktrace += QLatin1String("[...]\n"); - } - } - } - - //calculate rating - d->m_usefulness = Useless; - if (rating >= (bestPossibleRating*0.90)) { - d->m_usefulness = ReallyUseful; - } else if (rating >= (bestPossibleRating*0.70)) { - d->m_usefulness = MayBeUseful; - } else if (rating >= (bestPossibleRating*0.40)) { - d->m_usefulness = ProbablyUseless; - } - - //if there is no stack base, the executable is probably stripped, - //so we need to be more strict with rating - if ( !haveSeenStackBase ) { - //less than 4 stack frames is useless - if ( counter < 4 ) { - d->m_usefulness = Useless; - //more than 4 stack frames might have some value, so let's not be so strict, just lower the rating - } else if ( d->m_usefulness > Useless ) { - d->m_usefulness = (Usefulness) (d->m_usefulness - 1); - } - } - - qDebug() << "Rating:" << rating << "out of" << bestPossibleRating << "Usefulness:" - << staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("Usefulness")).valueToKey(d->m_usefulness); - qDebug() << "90%:" << (bestPossibleRating*0.90) << "70%:" << (bestPossibleRating*0.70) - << "40%:" << (bestPossibleRating*0.40); - qDebug() << "Have seen stack base:" << haveSeenStackBase << "Lines counted:" << counter; -} - - diff --git a/drkonqi/parser/backtraceparser.h b/drkonqi/parser/backtraceparser.h deleted file mode 100644 index 5e127cdee..000000000 --- a/drkonqi/parser/backtraceparser.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef BACKTRACEPARSER_H -#define BACKTRACEPARSER_H - -#include "backtraceline.h" -#include -#include -#include -#include -class BacktraceParserPrivate; - -class BacktraceParser : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(BacktraceParser) -public: - enum Usefulness { InvalidUsefulness, Useless, ProbablyUseless, MayBeUseful, ReallyUseful }; - Q_ENUM(Usefulness) - - static BacktraceParser *newParser(const QString & debuggerName, QObject *parent = 0); - ~BacktraceParser() override; - - /*! Connects the parser to the backtrace generator. - * Any QObject that defines the starting() and newLine(QString) signals will do. - */ - void connectToGenerator(QObject *generator); - - /*! Returns the parsed backtrace. Any garbage that should not be shown to the user is removed. */ - virtual QString parsedBacktrace() const; - - /*! Same as parsedBacktrace(), but the backtrace here is returned as a list of - * BacktraceLine objects, which provide extra information on each line. - */ - virtual QList parsedBacktraceLines() const; - - /*! Returns a simplified version of the backtrace. This backtrace: - * \li Starts from the first useful function - * \li Has maximum 5 lines - * \li Replaces garbage with [...] - */ - virtual QString simplifiedBacktrace() const; - - /*! Returns a value that indicates how much useful is the backtrace that we got */ - virtual Usefulness backtraceUsefulness() const; - - /*! Returns a short list of the first good functions that appear in the backtrace - * (in the crashing thread). This is used for quering for duplicate reports. - */ - virtual QStringList firstValidFunctions() const; - - /*! Returns a list of libraries/executables that are missing debug symbols. */ - virtual QSet librariesWithMissingDebugSymbols() const; - -private Q_SLOTS: - void resetState(); - -protected Q_SLOTS: - /*! Called every time there is a new line from the generator. Subclasses should parse - * the line here and insert it in the m_linesList field of BacktraceParserPrivate. - * If the line is useful for rating as well, it should also be inserted in the m_linesToRate - * field, so that calculateRatingData() can use it. - */ - virtual void newLine(const QString & lineStr) = 0; - -protected: - explicit BacktraceParser(QObject *parent = 0); - - /*! Subclasses should override to provide their own BacktraceParserPrivate instance */ - virtual BacktraceParserPrivate *constructPrivate() const; - - /*! This method should fill the m_usefulness, m_simplifiedBacktrace, m_firstValidFunctions - * and m_librariesWithMissingDebugSymbols members of the BacktraceParserPrivate instance. - * The default implementation uses the lines inserted in m_linesToRate and applies a - * generic algorithm that should work for many debuggers. - */ - virtual void calculateRatingData(); - - BacktraceParserPrivate *d_ptr; -}; - -Q_DECLARE_METATYPE(BacktraceParser::Usefulness) - -#endif // BACKTRACEPARSER_H diff --git a/drkonqi/parser/backtraceparser_p.h b/drkonqi/parser/backtraceparser_p.h deleted file mode 100644 index 735efe762..000000000 --- a/drkonqi/parser/backtraceparser_p.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef BACKTRACEPARSER_P_H -#define BACKTRACEPARSER_P_H - -#include "backtraceparser.h" - -class BacktraceParserPrivate -{ -public: - BacktraceParserPrivate() : m_usefulness(BacktraceParser::InvalidUsefulness) {} - virtual ~BacktraceParserPrivate() {} - - QList m_linesList; - QList m_linesToRate; - QStringList m_firstUsefulFunctions; - QString m_simplifiedBacktrace; - QSet m_librariesWithMissingDebugSymbols; - BacktraceParser::Usefulness m_usefulness; -}; - -#endif //BACKTRACEPARSER_P_H diff --git a/drkonqi/parser/backtraceparsergdb.cpp b/drkonqi/parser/backtraceparsergdb.cpp deleted file mode 100644 index 5fdbb090a..000000000 --- a/drkonqi/parser/backtraceparsergdb.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "backtraceparsergdb.h" -#include "backtraceparser_p.h" -#include -#include - -//BEGIN BacktraceLineGdb - -class BacktraceLineGdb : public BacktraceLine -{ -public: - BacktraceLineGdb(const QString & line); - -private: - void parse(); - void rate(); -}; - -BacktraceLineGdb::BacktraceLineGdb(const QString & lineStr) - : BacktraceLine() -{ - d->m_line = lineStr; - d->m_functionName = QLatin1String("??"); - parse(); - if (d->m_type == StackFrame) { - rate(); - } -} - -void BacktraceLineGdb::parse() -{ - QRegExp regExp; - - if (d->m_line == QLatin1String("\n")) { - d->m_type = EmptyLine; - return; - } else if (d->m_line == QLatin1String("[KCrash Handler]\n")) { - d->m_type = KCrash; - return; - } else if (d->m_line.contains(QStringLiteral(""))) { - d->m_type = SignalHandlerStart; - return; - } - - regExp.setPattern(QStringLiteral("^#([0-9]+)" //matches the stack frame number, ex. "#0" - "[\\s]+(0x[0-9a-f]+[\\s]+in[\\s]+)?" // matches " 0x0000dead in " (optionally) - "((\\(anonymous namespace\\)::)?[^\\(]+)" //matches the function name - //(anything except left parenthesis, which is the start of the arguments section) - //and optionally the prefix "(anonymous namespace)::" - "(\\(.*\\))?" //matches the function arguments - //(when the app doesn't have debugging symbols) - "[\\s]+(const[\\s]+)?" //matches a traling const, if it exists - "\\(.*\\)" //matches the arguments of the function with their values - //(when the app has debugging symbols) - "([\\s]+" //beginning of optional file information - "(from|at)[\\s]+" //matches "from " or "at " - "(.+)" //matches the filename (source file or shared library file) - ")?\n$")); //matches trailing newline. - //the )? at the end closes the parenthesis before [\\s]+(from|at) and - //notes that the whole expression from there is optional. - - if (regExp.exactMatch(d->m_line)) { - d->m_type = StackFrame; - d->m_stackFrameNumber = regExp.cap(1).toInt(); - d->m_functionName = regExp.cap(3).trimmed(); - - if (!regExp.cap(7).isEmpty()) { //we have file information (stuff after from|at) - if (regExp.cap(8) == QLatin1String("at")) { //'at' means we have a source file - d->m_file = regExp.cap(9); - } else { //'from' means we have a library - d->m_library = regExp.cap(9); - } - } - - qDebug() << d->m_stackFrameNumber << d->m_functionName << d->m_file << d->m_library; - return; - } - - regExp.setPattern(QStringLiteral(".*\\(no debugging symbols found\\).*|" - ".*\\[Thread debugging using libthread_db enabled\\].*|" - ".*\\[New .*|" - "0x[0-9a-f]+.*|" - "Current language:.*")); - if (regExp.exactMatch(d->m_line)) { - qDebug() << "garbage detected:" << d->m_line; - d->m_type = Crap; - return; - } - - regExp.setPattern(QStringLiteral("Thread [0-9]+\\s+\\(Thread [0-9a-fx]+\\s+\\(.*\\)\\):\n")); - if (regExp.exactMatch(d->m_line)) { - qDebug() << "thread start detected:" << d->m_line; - d->m_type = ThreadStart; - return; - } - - regExp.setPattern(QStringLiteral("\\[Current thread is [0-9]+ \\(.*\\)\\]\n")); - if (regExp.exactMatch(d->m_line)) { - qDebug() << "thread indicator detected:" << d->m_line; - d->m_type = ThreadIndicator; - return; - } - - qDebug() << "line" << d->m_line << "did not match"; -} - -void BacktraceLineGdb::rate() -{ - LineRating r; - - //for explanations, see the LineRating enum definition - if (!fileName().isEmpty()) { - r = Good; - } else if (!libraryName().isEmpty()) { - if (functionName() == QLatin1String("??")) { - r = MissingFunction; - } else { - r = MissingSourceFile; - } - } else { - if (functionName() == QLatin1String("??")) { - r = MissingEverything; - } else { - r = MissingLibrary; - } - } - - d->m_rating = r; -} - -//END BacktraceLineGdb - -//BEGIN BacktraceParserGdb - -class BacktraceParserGdbPrivate : public BacktraceParserPrivate -{ -public: - BacktraceParserGdbPrivate() - : BacktraceParserPrivate(), - m_possibleKCrashStart(0), m_threadsCount(0), - m_isBelowSignalHandler(false), m_frameZeroAppeared(false) {} - - QString m_lineInputBuffer; - int m_possibleKCrashStart; - int m_threadsCount; - bool m_isBelowSignalHandler; - bool m_frameZeroAppeared; -}; - -BacktraceParserGdb::BacktraceParserGdb(QObject *parent) - : BacktraceParser(parent) -{ -} - -BacktraceParserPrivate* BacktraceParserGdb::constructPrivate() const -{ - return new BacktraceParserGdbPrivate; -} - -void BacktraceParserGdb::newLine(const QString & lineStr) -{ - Q_D(BacktraceParserGdb); - - //when the line is too long, gdb splits it into two lines. - //This breaks parsing and results in two Unknown lines instead of a StackFrame one. - //Here we workaround this by joining the two lines when such a scenario is detected. - if (d->m_lineInputBuffer.isEmpty()) { - d->m_lineInputBuffer = lineStr; - } else if (lineStr.startsWith(QLatin1Char(' ')) || lineStr.startsWith(QLatin1Char('\t'))) { - //gdb always adds some whitespace at the beginning of the second line - d->m_lineInputBuffer.append(lineStr); - } else { - parseLine(d->m_lineInputBuffer); - d->m_lineInputBuffer = lineStr; - } -} - -void BacktraceParserGdb::parseLine(const QString & lineStr) -{ - Q_D(BacktraceParserGdb); - - BacktraceLineGdb line(lineStr); - switch (line.type()) { - case BacktraceLine::Crap: - break; //we don't want crap in the backtrace ;) - case BacktraceLine::ThreadStart: - d->m_linesList.append(line); - d->m_possibleKCrashStart = d->m_linesList.size(); - d->m_threadsCount++; - //reset the state of the flags that need to be per-thread - d->m_isBelowSignalHandler = false; - d->m_frameZeroAppeared = false; // gdb bug workaround flag, see below - break; - case BacktraceLine::SignalHandlerStart: - if (!d->m_isBelowSignalHandler) { - //replace the stack frames of KCrash with a nice message - d->m_linesList.erase(d->m_linesList.begin() + d->m_possibleKCrashStart, d->m_linesList.end()); - d->m_linesList.insert(d->m_possibleKCrashStart, BacktraceLineGdb(QStringLiteral("[KCrash Handler]\n"))); - d->m_isBelowSignalHandler = true; //next line is the first below the signal handler - } else { - //this is not the first time we see a crash handler frame on the same thread, - //so we just add it to the list - d->m_linesList.append(line); - } - break; - case BacktraceLine::StackFrame: - // gdb workaround - (v6.8 at least) - 'thread apply all bt' writes - // the #0 stack frame again at the end. - // Here we ignore this frame by using a flag that tells us whether - // this is the first or the second time that the #0 frame appears in this thread. - // The flag is cleared on each thread start. - if (line.frameNumber() == 0) { - if (d->m_frameZeroAppeared) { - break; //break from the switch so that the frame is not added to the list. - } else { - d->m_frameZeroAppeared = true; - } - } - - //rate the stack frame if we are below the signal handler - if (d->m_isBelowSignalHandler) { - d->m_linesToRate.append(line); - } - - //fall through and append the line to the list - default: - d->m_linesList.append(line); - break; - } -} - -QString BacktraceParserGdb::parsedBacktrace() const -{ - Q_D(const BacktraceParserGdb); - - QString result; - if (d) { - QList::const_iterator i; - for (i = d->m_linesList.constBegin(); i != d->m_linesList.constEnd(); ++i) { - //if there is only one thread, we can omit the thread indicator, - //the thread header and all the empty lines. - if (d->m_threadsCount == 1 && ((*i).type() == BacktraceLine::ThreadIndicator - || (*i).type() == BacktraceLine::ThreadStart - || (*i).type() == BacktraceLine::EmptyLine)) - { - continue; - } - result += i->toString(); - } - } - return result; -} - -QList BacktraceParserGdb::parsedBacktraceLines() const -{ - Q_D(const BacktraceParserGdb); - - QList result; - if (d) { - QList::const_iterator i; - for (i = d->m_linesList.constBegin(); i != d->m_linesList.constEnd(); ++i) { - //if there is only one thread, we can omit the thread indicator, - //the thread header and all the empty lines. - if (d->m_threadsCount == 1 && ((*i).type() == BacktraceLine::ThreadIndicator - || (*i).type() == BacktraceLine::ThreadStart - || (*i).type() == BacktraceLine::EmptyLine)) - { - continue; - } - result.append(*i); - } - } - return result; -} - -//END BacktraceParserGdb - - diff --git a/drkonqi/parser/backtraceparsergdb.h b/drkonqi/parser/backtraceparsergdb.h deleted file mode 100644 index 9c76ce3e9..000000000 --- a/drkonqi/parser/backtraceparsergdb.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef BACKTRACEPARSERGDB_H -#define BACKTRACEPARSERGDB_H - -#include "backtraceparser.h" -class BacktraceParserGdbPrivate; - -class BacktraceParserGdb : public BacktraceParser -{ - Q_OBJECT - Q_DECLARE_PRIVATE(BacktraceParserGdb) -public: - explicit BacktraceParserGdb(QObject *parent = 0); - - QString parsedBacktrace() const override; - QList parsedBacktraceLines() const override; - -protected: - BacktraceParserPrivate *constructPrivate() const override; - -protected Q_SLOTS: - void newLine(const QString & lineStr) override; - -private: - void parseLine(const QString & lineStr); -}; - -#endif // BACKTRACEPARSERGDB_H diff --git a/drkonqi/parser/backtraceparserkdbgwin.cpp b/drkonqi/parser/backtraceparserkdbgwin.cpp deleted file mode 100644 index 082c19771..000000000 --- a/drkonqi/parser/backtraceparserkdbgwin.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) 2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "backtraceparserkdbgwin.h" -#include "backtraceparser_p.h" -#include - -//BEGIN BacktraceLineKdbgwin - -class BacktraceLineKdbgwin : public BacktraceLine -{ -public: - BacktraceLineKdbgwin(const QString & line); - -private: - void parse(); - void rate(); -}; - -BacktraceLineKdbgwin::BacktraceLineKdbgwin(const QString & line) - : BacktraceLine() -{ - d->m_line = line; - parse(); - if (d->m_type == StackFrame) { - rate(); - } -} - -void BacktraceLineKdbgwin::parse() -{ - if (d->m_line == QLatin1String("\n")) { - d->m_type = EmptyLine; - return; - } else if (d->m_line == QLatin1String("[KCrash Handler]\n")) { - d->m_type = KCrash; - return; - } else if (d->m_line.startsWith(QLatin1String("Loaded"))) { - d->m_type = Crap; //FIXME that's not exactly crap - return; - } - - QRegExp regExp; - regExp.setPattern(QStringLiteral("([^!]+)!" //match the module name, followed by ! - "([^\\(]+)\\(\\) " //match the function name, followed by () - "\\[([^@]+)@ [\\-\\d]+\\] " // [filename @ line] - "at 0x.*")); //at 0xdeadbeef - - if (regExp.exactMatch(d->m_line)) { - d->m_type = StackFrame; - d->m_library = regExp.cap(1); - d->m_functionName = regExp.cap(2); - d->m_file = regExp.cap(3).trimmed(); - - qDebug() << d->m_functionName << d->m_file << d->m_library; - return; - } - - qDebug() << "line" << d->m_line << "did not match"; -} - -void BacktraceLineKdbgwin::rate() -{ - LineRating r; - - //for explanations, see the LineRating enum definition - if (fileName() != QLatin1String("[unknown]")) { - r = Good; - } else if (libraryName() != QLatin1String("[unknown]")) { - if (functionName() == QLatin1String("[unknown]")) { - r = MissingFunction; - } else { - r = MissingSourceFile; - } - } else { - if (functionName() == QLatin1String("[unknown]")) { - r = MissingEverything; - } else { - r = MissingLibrary; - } - } - - d->m_rating = r; -} - -//END BacktraceLineKdbgwin - -//BEGIN BacktraceParserKdbgwin - -BacktraceParserKdbgwin::BacktraceParserKdbgwin(QObject *parent) - : BacktraceParser(parent) -{ -} - -void BacktraceParserKdbgwin::newLine(const QString & lineStr) -{ - Q_D(BacktraceParser); - - BacktraceLineKdbgwin line(lineStr); - switch(line.type()) { - case BacktraceLine::Crap: - break; //we don't want crap in the backtrace ;) - case BacktraceLine::StackFrame: - d->m_linesToRate.append(line); - default: - d->m_linesList.append(line); - } -} - -//END BacktraceParserKdbgwin - - diff --git a/drkonqi/parser/backtraceparserkdbgwin.h b/drkonqi/parser/backtraceparserkdbgwin.h deleted file mode 100644 index bc6823344..000000000 --- a/drkonqi/parser/backtraceparserkdbgwin.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef BACKTRACEPARSERKDBGWIN_H -#define BACKTRACEPARSERKDBGWIN_H - -#include "backtraceparser.h" - -class BacktraceParserKdbgwin : public BacktraceParser -{ - Q_OBJECT - Q_DECLARE_PRIVATE(BacktraceParser) -public: - explicit BacktraceParserKdbgwin(QObject *parent = 0); - -protected Q_SLOTS: - void newLine(const QString & lineStr) override; -}; - -#endif // BACKTRACEPARSERKDBGWIN_H diff --git a/drkonqi/parser/backtraceparsernull.cpp b/drkonqi/parser/backtraceparsernull.cpp deleted file mode 100644 index b44b18fe1..000000000 --- a/drkonqi/parser/backtraceparsernull.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "backtraceparsernull.h" -#include "backtraceparser_p.h" - -//BEGIN BacktraceLineNull - -class BacktraceLineNull : public BacktraceLine -{ -public: - BacktraceLineNull(const QString & line); -}; - -BacktraceLineNull::BacktraceLineNull(const QString & line) - : BacktraceLine() -{ - d->m_line = line; - d->m_rating = MissingEverything; -} - -//END BacktraceLineNull - -//BEGIN BacktraceParserNull - -BacktraceParserNull::BacktraceParserNull(QObject *parent) : BacktraceParser(parent) {} - -BacktraceParserPrivate *BacktraceParserNull::constructPrivate() const -{ - BacktraceParserPrivate *d = BacktraceParser::constructPrivate(); - d->m_usefulness = MayBeUseful; - return d; -} - -void BacktraceParserNull::newLine(const QString & lineStr) -{ - d_ptr->m_linesList.append(BacktraceLineNull(lineStr)); -} - - -//END BacktraceParserNull - - diff --git a/drkonqi/parser/backtraceparsernull.h b/drkonqi/parser/backtraceparsernull.h deleted file mode 100644 index 9fbc6be41..000000000 --- a/drkonqi/parser/backtraceparsernull.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2009-2010 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef BACKTRACEPARSERNULL_H -#define BACKTRACEPARSERNULL_H - -#include "backtraceparser.h" - -class BacktraceParserNull : public BacktraceParser -{ - Q_OBJECT -public: - explicit BacktraceParserNull(QObject *parent = 0); - -protected Q_SLOTS: - void newLine(const QString & lineStr) override; - -protected: - BacktraceParserPrivate *constructPrivate() const override; -}; - -#endif // BACKTRACEPARSERNULL_H diff --git a/drkonqi/statusnotifier.cpp b/drkonqi/statusnotifier.cpp deleted file mode 100644 index c17805d8c..000000000 --- a/drkonqi/statusnotifier.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - Copyright (C) 2016 Kai Uwe Broulik - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "statusnotifier.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "drkonqi.h" -#include "crashedapplication.h" - -StatusNotifier::StatusNotifier(QObject *parent) - : QObject(parent) - , m_autoCloseTimer(new QTimer(this)) - , m_sni(new KStatusNotifierItem(this)) -{ - CrashedApplication *crashedApp = DrKonqi::crashedApplication(); - - // this is used for both the SNI tooltip as well as the notification - m_title = i18nc("Placeholder is an application name; it crashed", "%1 Closed Unexpectedly", crashedApp->name()); - - // if nobody bothered to look at the crash after 1 minute, just close - m_autoCloseTimer->setSingleShot(true); - m_autoCloseTimer->setInterval(60000); - m_autoCloseTimer->start(); - connect(m_autoCloseTimer, &QTimer::timeout, this, &StatusNotifier::expired); - connect(this, &StatusNotifier::activated, this, [this] { - deleteLater(); - }); - - KService::Ptr service = KService::serviceByStorageId(crashedApp->fakeExecutableBaseName()); - if (service) { - m_iconName = service->icon(); - } - - m_sni->setTitle(m_title); - m_sni->setIconByName(QStringLiteral("tools-report-bug")); - m_sni->setStatus(KStatusNotifierItem::Active); - m_sni->setCategory(KStatusNotifierItem::SystemServices); - m_sni->setToolTip(!m_iconName.isEmpty() ? m_iconName : m_sni->iconName(), m_sni->title(), i18n("Please report this error to help improve this software.")); - connect(m_sni, &KStatusNotifierItem::activateRequested, this, &StatusNotifier::activated); - - // you cannot turn off that "Do you really want to quit?" message, so we'll add our own below - m_sni->setStandardActionsEnabled(false); - - QMenu *sniMenu = new QMenu(); - QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("tools-report-bug")), - i18n("Report &Bug"), nullptr); - connect(action, &QAction::triggered, this, &StatusNotifier::activated); - sniMenu->addAction(action); - sniMenu->setDefaultAction(action); - - if (canBeRestarted(crashedApp)) { - action = new QAction(QIcon::fromTheme(QStringLiteral("system-reboot")), - i18n("&Restart Application"), nullptr); - connect(action, &QAction::triggered, this, [crashedApp] { - crashedApp->restart(); - }); - // once restarted successfully, disable restart option - connect(crashedApp, &CrashedApplication::restarted, action, [action](bool success) { - action->setEnabled(!success); - }); - sniMenu->addAction(action); - } - - sniMenu->addSeparator(); - - action = new QAction(QIcon::fromTheme(QStringLiteral("application-exit")), - i18nc("Allows the user to hide this notifier item", "Hide"), nullptr); - connect(action, &QAction::triggered, this, &StatusNotifier::expired); - sniMenu->addAction(action); - - m_sni->setContextMenu(sniMenu); - - // make sure the user doesn't miss the SNI by stopping the auto hide timer when the session becomes idle - int idleId = KIdleTime::instance()->addIdleTimeout(30000); - connect(KIdleTime::instance(), static_cast(&KIdleTime::timeoutReached), this, [this, idleId](int id) { - if (idleId == id) { - m_autoCloseTimer->stop(); - } - // this is apparently needed or else resumingFromIdle is never called - KIdleTime::instance()->catchNextResumeEvent(); - }); - connect(KIdleTime::instance(), &KIdleTime::resumingFromIdle, this, [this] { - if (!m_autoCloseTimer->isActive()) { - m_autoCloseTimer->start(); - } - }); -} - -StatusNotifier::~StatusNotifier() = default; - -void StatusNotifier::notify() -{ - CrashedApplication *crashedApp = DrKonqi::crashedApplication(); - - KNotification *notification = KNotification::event(QStringLiteral("applicationcrash"), - m_title, - i18n("Please report this error to help improve this software."), - !m_iconName.isEmpty() ? m_iconName : QStringLiteral("tools-report-bug"), - nullptr, - KNotification::DefaultEvent | KNotification::SkipGrouping); - - QStringList actions = {i18nc("Notification action button, keep short", "Report Bug")}; - - bool restartEnabled = canBeRestarted(crashedApp); - - if (restartEnabled) { - actions << i18nc("Notification action button, keep short", "Restart App"); - } - - notification->setActions(actions); - - connect(notification, static_cast(&KNotification::activated), - this, [this, crashedApp](int actionIndex) { - // 0 = default action (NOTE this is not implemented by Plasma, clicking notification popup just closes it) - // 1 = "Report Bug" button - // 2 = "Restart App" button - if (actionIndex == 0 || actionIndex == 1) { - emit activated(); - } else if (actionIndex == 2) { - crashedApp->restart(); - // keep status notifier there to allow reporting a bug when user chose to restart app - } - }); - - // when the SNI disappears you won't be able to interact with the notification anymore anyway, so close it - connect(this, &StatusNotifier::activated, notification, &KNotification::close); - connect(this, &StatusNotifier::expired, notification, &KNotification::close); -} - -bool StatusNotifier::notificationServiceRegistered() -{ - return QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.Notifications")); -} - -bool StatusNotifier::canBeRestarted(CrashedApplication *app) -{ - return !app->hasBeenRestarted() && app->fakeExecutableBaseName() != QLatin1String("drkonqi"); -} diff --git a/drkonqi/statusnotifier.h b/drkonqi/statusnotifier.h deleted file mode 100644 index b5fa7a503..000000000 --- a/drkonqi/statusnotifier.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2016 Kai Uwe Broulik - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef DRKONQI_STATUSNOTIFIER_H -#define DRKONQI_STATUSNOTIFIER_H - -#include - -class QTimer; - -class KStatusNotifierItem; - -class CrashedApplication; - -class StatusNotifier : public QObject -{ - Q_OBJECT - -public: - explicit StatusNotifier(QObject *parent = nullptr); - ~StatusNotifier() override; - - void notify(); - - static bool notificationServiceRegistered(); - -signals: - void expired(); - void activated(); - -private: - static bool canBeRestarted(CrashedApplication *app); - - QTimer *m_autoCloseTimer = nullptr; - KStatusNotifierItem *m_sni = nullptr; - - QString m_title; - QString m_iconName; - -}; - -#endif // DRKONQI_STATUSNOTIFIER_H diff --git a/drkonqi/statuswidget.cpp b/drkonqi/statuswidget.cpp deleted file mode 100644 index 36134da53..000000000 --- a/drkonqi/statuswidget.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************* -* statuswidget.cpp -* Copyright 2009,2010 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ -#include "statuswidget.h" - -#include -#include -#include - -#include -#include - -StatusWidget::StatusWidget(QWidget * parent) : - QStackedWidget(parent), - m_cursorStackCount(0), - m_busy(false) -{ - setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed)); - - //Main layout - m_statusPage = new QWidget(this); - m_busyPage = new QWidget(this); - - addWidget(m_statusPage); - addWidget(m_busyPage); - - //Status widget - m_statusLabel = new WrapLabel(); - m_statusLabel->setOpenExternalLinks(true); - m_statusLabel->setTextFormat(Qt::RichText); - //m_statusLabel->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum)); - - QHBoxLayout * statusLayout = new QHBoxLayout(); - statusLayout->setContentsMargins(0,0,0,0); - m_statusPage->setLayout(statusLayout); - - statusLayout->addWidget(m_statusLabel); - - //Busy widget - m_throbberWidget = new KPixmapSequenceWidget(); - m_throbberWidget->setSequence(KPixmapSequence(QStringLiteral("process-working"), 22)); - m_throbberWidget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); - - m_busyLabel = new WrapLabel(); - //m_busyLabel->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum)); - - QHBoxLayout * busyLayout = new QHBoxLayout(); - busyLayout->setContentsMargins(0,0,0,0); - m_busyPage->setLayout(busyLayout); - - busyLayout->addWidget(m_busyLabel); - busyLayout->addWidget(m_throbberWidget); - busyLayout->setAlignment(m_throbberWidget,Qt::AlignVCenter); -} - -void StatusWidget::setBusy(const QString& busyMessage) -{ - m_statusLabel->clear(); - m_busyLabel->setText(busyMessage); - setCurrentWidget(m_busyPage); - setBusyCursor(); - m_busy = true; -} - -void StatusWidget::setIdle(const QString& idleMessage) -{ - m_busyLabel->clear(); - m_statusLabel->setText(idleMessage); - setCurrentWidget(m_statusPage); - setIdleCursor(); - m_busy = false; -} - -void StatusWidget::addCustomStatusWidget(QWidget * widget) -{ - QHBoxLayout * statusLayout = static_cast(m_statusPage->layout()); - - statusLayout->addWidget(widget); - statusLayout->setAlignment(widget,Qt::AlignVCenter); - widget->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed)); -} - -void StatusWidget::setBusyCursor() -{ - QApplication::setOverrideCursor(Qt::WaitCursor); - m_cursorStackCount++; -} - -void StatusWidget::setIdleCursor() -{ - while (m_cursorStackCount!=0) { - QApplication::restoreOverrideCursor(); - m_cursorStackCount--; - } -} - -void StatusWidget::hideEvent(QHideEvent *) -{ - if (m_busy) { - setIdleCursor(); - } -} - -void StatusWidget::showEvent(QShowEvent *) -{ - if (m_busy) { - setBusyCursor(); - } -} diff --git a/drkonqi/statuswidget.h b/drkonqi/statuswidget.h deleted file mode 100644 index ee2688b73..000000000 --- a/drkonqi/statuswidget.h +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************* -* statuswidget.h -* Copyright 2009,2010 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ -#ifndef STATUSWIDGET__H -#define STATUSWIDGET__H - -#include -#include -#include -#include - -class WrapLabel; -class KPixmapSequenceWidget; -class QHideEvent; - -class StatusWidget: public QStackedWidget -{ - Q_OBJECT -public: - explicit StatusWidget(QWidget * parent = 0); - - void setBusy(const QString&); - void setIdle(const QString&); - - void addCustomStatusWidget(QWidget *); - -private: - void showEvent(QShowEvent *) override; - void hideEvent(QHideEvent *) override; - - void setBusyCursor(); - void setIdleCursor(); - - WrapLabel * m_statusLabel; - - KPixmapSequenceWidget * m_throbberWidget; - WrapLabel * m_busyLabel; - - QWidget * m_statusPage; - QWidget * m_busyPage; - - int m_cursorStackCount; - bool m_busy; -}; - -//Dummy class to avoid a QLabel+wordWrap height bug -class WrapLabel: public QLabel -{ - Q_OBJECT -public: - explicit WrapLabel(QWidget * parent = 0) : QLabel(parent){ - setWordWrap(true); - } - - void setText(const QString & text) { - QLabel::setText(text); - adjustHeight(); - } - - bool event(QEvent * e) override { - if (e->type() == QEvent::ApplicationFontChange || e->type() == QEvent::Resize) { - adjustHeight(); - } - return QLabel::event(e); - } - -private: - void adjustHeight() { - QTextDocument document(text()); - document.setTextWidth(width()); - setMaximumHeight(document.size().height()); - } - -}; - -#endif diff --git a/drkonqi/systeminformation.cpp b/drkonqi/systeminformation.cpp deleted file mode 100644 index 04eb280dc..000000000 --- a/drkonqi/systeminformation.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************* -* systeminformation.cpp -* Copyright 2009 Dario Andres Rodriguez -* Copyright 2009 George Kiagiadakis -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#include - -#include "systeminformation.h" - -#ifdef HAVE_UNAME -# include -# include -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -static const QString OS_UNSPECIFIED = QStringLiteral("unspecified"); -static const QString PLATFORM_UNSPECIFIED = QStringLiteral("unspecified"); - -SystemInformation::SystemInformation(QObject * parent) - : QObject(parent) - , m_bugzillaOperatingSystem(OS_UNSPECIFIED) - , m_bugzillaPlatform(PLATFORM_UNSPECIFIED) -{ - // NOTE: the relative order is important here - m_bugzillaOperatingSystem = fetchOSBasicInformation(); - m_operatingSystem = fetchOSDetailInformation(); - - tryToSetBugzillaPlatform(); - - KConfigGroup config(KSharedConfig::openConfig(), "SystemInformation"); - m_compiledSources = config.readEntry("CompiledSources", false); -} - -SystemInformation::~SystemInformation() -{ - KConfigGroup config(KSharedConfig::openConfig(), "SystemInformation"); - config.writeEntry("CompiledSources", m_compiledSources); - config.sync(); -} - -void SystemInformation::tryToSetBugzillaPlatform() -{ - QString platform = PLATFORM_UNSPECIFIED; - // first, try to guess bugzilla platfrom from the internal OS information - // this should work for BSDs, solaris and windows. - platform = guessBugzillaPlatform(m_bugzillaOperatingSystem); - - // if the internal information is not enough, refer to external information - if (platform == PLATFORM_UNSPECIFIED) { - tryToSetBugzillaPlatformFromExternalInfo(); - } else { - setBugzillaPlatform(platform); - } -} - -void SystemInformation::tryToSetBugzillaPlatformFromExternalInfo() -{ - //Run lsb_release async - QString lsb_release = QStandardPaths::findExecutable(QLatin1String("lsb_release")); - if ( !lsb_release.isEmpty() ) { - qDebug() << "found lsb_release"; - KProcess *process = new KProcess(); - process->setOutputChannelMode(KProcess::OnlyStdoutChannel); - process->setEnv(QStringLiteral("LC_ALL"), QStringLiteral("C")); - *process << lsb_release << QStringLiteral("-sd"); - connect(process, static_cast(&KProcess::finished), this, &SystemInformation::lsbReleaseFinished); - process->start(); - } else { - // when lsb_release is unavailable, turn to /etc/os-release - const QString& osReleaseInfo = fetchOSReleaseInformation(); - const QString& platform = guessBugzillaPlatform(osReleaseInfo); - setBugzillaPlatform(platform); - } -} - -void SystemInformation::lsbReleaseFinished() -{ - KProcess *process = qobject_cast(sender()); - Q_ASSERT(process); - m_lsbRelease = QString::fromLocal8Bit(process->readAllStandardOutput().trimmed()); - process->deleteLater(); - - //Guess distro string - QString platform = guessBugzillaPlatform(m_lsbRelease); - - // if lsb_release doesn't work well, turn to the /etc/os-release file - if (platform == PLATFORM_UNSPECIFIED) { - const QString& osReleaseInfo = fetchOSReleaseInformation(); - platform = guessBugzillaPlatform(osReleaseInfo); - } - - setBugzillaPlatform(platform); -} - -//this function maps the distribution information to an "Hardware Platform" . -//value that is accepted by bugs.kde.org. If the values change on the server . -//side, they need to be updated here as well . -QString SystemInformation::guessBugzillaPlatform(const QString& distroInfo) const -{ - if ( distroInfo.contains(QStringLiteral("suse"),Qt::CaseInsensitive) ) { - return (QLatin1String("openSUSE RPMs")); - } else if ( distroInfo.contains(QStringLiteral("mint"),Qt::CaseInsensitive) ) { - return (QLatin1String("Mint (Ubuntu Based)")); - } else if ( distroInfo.contains(QStringLiteral("lmde"),Qt::CaseInsensitive) ) { - return (QLatin1String("Mint (Debian Based)")); - } else if ( distroInfo.contains(QStringLiteral("ubuntu"),Qt::CaseInsensitive) ) { - return (QLatin1String("Ubuntu Packages")); - } else if ( distroInfo.contains(QStringLiteral("fedora"),Qt::CaseInsensitive) ) { - return (QLatin1String("Fedora RPMs")); - } else if ( distroInfo.contains(QStringLiteral("redhat"),Qt::CaseInsensitive) ) { - return (QLatin1String("RedHat RPMs")); - } else if ( distroInfo.contains(QStringLiteral("gentoo"),Qt::CaseInsensitive) ) { - return (QLatin1String("Gentoo Packages")); - } else if ( distroInfo.contains(QStringLiteral("mandriva"),Qt::CaseInsensitive) ) { - return (QLatin1String("Mandriva RPMs")); - } else if ( distroInfo.contains(QStringLiteral("mageia"),Qt::CaseInsensitive) ) { - return (QLatin1String("Mageia RPMs")); - } else if ( distroInfo.contains(QStringLiteral("slack"),Qt::CaseInsensitive) ) { - return (QLatin1String("Slackware Packages")); - } else if ( distroInfo.contains(QStringLiteral("pclinuxos"),Qt::CaseInsensitive) ) { - return (QLatin1String("PCLinuxOS")); - } else if ( distroInfo.contains(QStringLiteral("pardus"),Qt::CaseInsensitive) ) { - return (QLatin1String("Pardus Packages")); - } else if ( distroInfo.contains(QStringLiteral("freebsd"),Qt::CaseInsensitive) ) { - return (QLatin1String("FreeBSD Ports")); - } else if ( distroInfo.contains(QStringLiteral("netbsd"),Qt::CaseInsensitive) ) { - return (QLatin1String("NetBSD pkgsrc")); - } else if ( distroInfo.contains(QStringLiteral("openbsd"),Qt::CaseInsensitive) ) { - return (QLatin1String("OpenBSD Packages")); - } else if ( distroInfo.contains(QStringLiteral("solaris"),Qt::CaseInsensitive) ) { - return (QLatin1String("Solaris Packages")); - } else if ( distroInfo.contains(QStringLiteral("chakra"),Qt::CaseInsensitive) ) { - return (QLatin1String("Chakra")); - } else if ( distroInfo.contains(QStringLiteral("ms windows"),Qt::CaseInsensitive) ) { - return (QLatin1String("MS Windows")); - } else if ( distroInfo.contains(QStringLiteral("arch"),Qt::CaseInsensitive) ) { - return (QLatin1String("Archlinux Packages")); - } else if ( distroInfo.contains(QStringLiteral("debian"),Qt::CaseInsensitive) ) { - if ( distroInfo.contains(QStringLiteral("unstable"),Qt::CaseInsensitive) ) { - return (QLatin1String("Debian unstable")); - } else if ( distroInfo.contains(QStringLiteral("testing"),Qt::CaseInsensitive) ) { - return (QLatin1String("Debian testing")); - } else { - return (QLatin1String("Debian stable")); - } - } else { - return PLATFORM_UNSPECIFIED; - } -} - -//this function maps the operating system to an OS value that is accepted by bugs.kde.org. -//if the values change on the server side, they need to be updated here as well. -QString SystemInformation::fetchOSBasicInformation() const -{ - //krazy:excludeall=cpp - //Get the base OS string (bugzillaOS) -#if defined(Q_OS_LINUX) - return QLatin1String("Linux"); -#elif defined(Q_OS_FREEBSD) - return QLatin1String("FreeBSD"); -#elif defined(Q_OS_NETBSD) - return QLatin1String("NetBSD"); -#elif defined(Q_OS_OPENBSD) - return QLatin1String("OpenBSD"); -#elif defined(Q_OS_AIX) - return QLatin1String("AIX"); -#elif defined(Q_OS_HPUX) - return QLatin1String("HP-UX"); -#elif defined(Q_OS_IRIX) - return QLatin1String("IRIX"); -#elif defined(Q_OS_OSF) - return QLatin1String("Tru64"); -#elif defined(Q_OS_SOLARIS) - return QLatin1String("Solaris"); -#elif defined(Q_OS_CYGWIN) - return QLatin1String("Cygwin"); -#elif defined(Q_OS_DARWIN) - return QLatin1String("OS X"); -#elif defined(Q_OS_WIN32) - return QLatin1String("MS Windows"); -#else - return OS_UNSPECIFIED; -#endif - -} - -QString SystemInformation::fetchOSDetailInformation() const -{ - //Get complete OS string (and fallback to base string) - QString operatingSystem = m_bugzillaOperatingSystem; - -#ifdef HAVE_UNAME - struct utsname buf; - if (uname(&buf) == -1) { - qDebug() << "call to uname failed" << errno; - } else { - operatingSystem = QString::fromLocal8Bit(buf.sysname) + ' ' - + QString::fromLocal8Bit(buf.release) + ' ' - + QString::fromLocal8Bit(buf.machine); - } -#endif - - return operatingSystem; -} - -QString SystemInformation::fetchOSReleaseInformation() const -{ - QFile data(QStringLiteral("/etc/os-release")); - if (!data.open(QIODevice::ReadOnly | QIODevice::Text)) { - return QString(); - } - - QMap distroInfos; - - QTextStream in(&data); - while (!in.atEnd()) { - const QString line = in.readLine(); - - // its format is one simple NAME=VALUE per line - // don't use QString.split() here since its value might contain '='' - const int index = line.indexOf('='); - if ( index != -1 ) { - const QString key = line.left(index); - const QString value = line.mid(index+1); - distroInfos.insert(key, value); - } - } - - // the PRETTY_NAME entry should be the most appropriate one, - // but I could be wrong. - const QString prettyName = distroInfos.value(QStringLiteral("PRETTY_NAME"), QStringLiteral("Linux")); - return prettyName; -} - -QString SystemInformation::operatingSystem() const -{ - return m_operatingSystem; -} - -QString SystemInformation::bugzillaOperatingSystem() const -{ - return m_bugzillaOperatingSystem; -} - -QString SystemInformation::bugzillaPlatform() const -{ - return m_bugzillaPlatform; -} - -void SystemInformation::setBugzillaPlatform(const QString & platform) -{ - m_bugzillaPlatform = platform; -} - -QString SystemInformation::lsbRelease() const -{ - return m_lsbRelease; -} - -bool SystemInformation::compiledSources() const -{ - return m_compiledSources; -} - -void SystemInformation::setCompiledSources(bool compiled) -{ - m_compiledSources = compiled; -} - -QString SystemInformation::qtVersion() const -{ - return qVersion(); -} - -QString SystemInformation::frameworksVersion() const -{ - return KCoreAddons::versionString(); -} diff --git a/drkonqi/systeminformation.h b/drkonqi/systeminformation.h deleted file mode 100644 index ef23cc0d5..000000000 --- a/drkonqi/systeminformation.h +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************* -* systeminformation.h -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ - -#ifndef SYSTEMINFORMATION__H -#define SYSTEMINFORMATION__H - -#include - -class SystemInformation: public QObject -{ - Q_OBJECT - public: - explicit SystemInformation(QObject * parent = 0); - ~SystemInformation() override; - - QString bugzillaPlatform() const; - void setBugzillaPlatform(const QString &); - - QString operatingSystem() const; - QString bugzillaOperatingSystem() const; - - QString lsbRelease() const; - - bool compiledSources() const; - void setCompiledSources(bool); - - QString qtVersion() const; - QString frameworksVersion() const; - - private Q_SLOTS: - void lsbReleaseFinished(); - - private: - QString fetchOSBasicInformation() const; - QString fetchOSDetailInformation() const; - QString fetchOSReleaseInformation() const; - - QString guessBugzillaPlatform(const QString&) const; - - void tryToSetBugzillaPlatform(); - void tryToSetBugzillaPlatformFromExternalInfo(); - - QString m_operatingSystem; - QString m_bugzillaOperatingSystem; - QString m_bugzillaPlatform; - - QString m_lsbRelease; - - bool m_compiledSources; -}; - -#endif diff --git a/drkonqi/tests/CMakeLists.txt b/drkonqi/tests/CMakeLists.txt deleted file mode 100644 index 670c1de47..000000000 --- a/drkonqi/tests/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -add_subdirectory(crashtest) -add_subdirectory(backtraceparsertest) -if(KF5XmlRpcClient_FOUND) - add_subdirectory(bugzillalibtest) -endif() - -if(NOT RUBY_EXECTUABLE) - find_program(RUBY_EXECUTABLE ruby) -endif() -if(RUBY_EXECUTABLE) - execute_process(COMMAND ${RUBY_EXECUTABLE} -e "require 'atspi'" - RESULT_VARIABLE RUBY_ATSPI) - execute_process(COMMAND ${RUBY_EXECUTABLE} -e "require 'xmlrpc/server'" - RESULT_VARIABLE RUBY_XMLRPC) -endif() -if(NOT GDB_EXECUTABLE) - # Needed so drkonqi can actually trace something. - find_program(GDB_EXECUTABLE gdb) -endif() -if(NOT XVFB_RUN_EXECTUABLE) - find_program(XVFB_RUN_EXECTUABLE xvfb-run) -endif() - -set(ATSPI_PATHS - /usr/lib/at-spi2-core/ # debians - /usr/lib/at-spi2/ # suses -) -if(NOT ATSPI_BUS_LAUNCHER_EXECUTABLE) - find_program(ATSPI_BUS_LAUNCHER_EXECUTABLE - NAMES at-spi-bus-launcher - PATHS ${ATSPI_PATHS} - DOC "AT-SPI accessibility dbus launcher") -endif() -if(NOT ATSPI_REGISTRYD_EXECUTABLE) - find_program(ATSPI_REGISTRYD_EXECUTABLE - NAMES at-spi2-registryd - PATHS ${ATSPI_PATHS} - DOC "AT-SPI accessibility registry daemon") -endif() - -if(RUBY_EXECUTABLE AND XVFB_RUN_EXECTUABLE AND ATSPI_BUS_LAUNCHER_EXECUTABLE - AND ATSPI_REGISTRYD_EXECUTABLE AND GDB_EXECUTABLE - AND RUBY_ATSPI EQUAL 0 AND RUBY_XMLRPC EQUAL 0) - set(WITH_DRKONI_INTEGRATION_TESTING TRUE) -endif() -add_feature_info(DrKonqiIntegrationTesting WITH_DRKONI_INTEGRATION_TESTING - "Needs Ruby, functional atspi and xmlrpc gems, gdb, as well as xvfb-run.") -add_subdirectory(integration) diff --git a/drkonqi/tests/backtraceparsertest/CMakeLists.txt b/drkonqi/tests/backtraceparsertest/CMakeLists.txt deleted file mode 100644 index fcf9693f1..000000000 --- a/drkonqi/tests/backtraceparsertest/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_executable( backtraceparsertest fakebacktracegenerator.cpp backtraceparsertest.cpp) -target_link_libraries( backtraceparsertest Qt5::Test Qt5::Core KF5::KIOWidgets drkonqi_backtrace_parser) -ecm_mark_as_test(backtraceparsertest) -add_test(backtraceparsertest backtraceparsertest) - -add_executable(backtraceparsertest_manual fakebacktracegenerator.cpp backtraceparsertest_manual.cpp) -target_link_libraries(backtraceparsertest_manual Qt5::Core KF5::I18n KF5::KIOWidgets drkonqi_backtrace_parser) -ecm_mark_as_test(backtraceparsertest_manual) - -# create a link so that the data directory can be accessed from the build directory, where the test runs -if( NOT WIN32 ) - if ( NOT ${CMAKE_CURRENT_BINARY_DIR} EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ) - add_custom_command(TARGET backtraceparsertest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_CURRENT_SOURCE_DIR}/backtraceparsertest_data backtraceparsertest_data - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - endif () -endif() diff --git a/drkonqi/tests/backtraceparsertest/README b/drkonqi/tests/backtraceparsertest/README deleted file mode 100644 index 2f29e423d..000000000 --- a/drkonqi/tests/backtraceparsertest/README +++ /dev/null @@ -1,25 +0,0 @@ -This is a unit test for the BacktraceInfo class, which is used in drkonqi -to rate the usefulness of a backtrace. - -This test dynamically loads test data from the "backtraceinfotest_data" directory. -To add new data, simply create a file starting with the "test_" prefix and paste -a backtrace in it. Then, in the "usefulness_map" file, add a line with the following format: - - test_file: UsefulnessValue - -where "test_file" is the exact filename of the file containing the backtrace and -UsefulnessValue is the usefulness value that you expect the backtrace to get. -Whitespaces do not matter, they are ignored. Valid usefulness values can be seen -in backtraceinfotest.h, in the enum BacktraceInfoTest::Usefulness. - -The UsefulnessValue has to be the enum's text representation of the -value and not an integer. For example, having the enum like this: - - enum Usefulness { ReallyUseful = 0, MayBeUseful=1, ProbablyUseless=2, Useless = 3 }; - -"ReallyUseful" is a valid value, but "0" isn't. - - -All files in the "backtraceinfotest_data" directory that do not start with the -"test_" prefix are ignored (except the "usefulness_map" file, which has a special -purpose, as described above) diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest.cpp b/drkonqi/tests/backtraceparsertest/backtraceparsertest.cpp deleted file mode 100644 index ad0663f98..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "backtraceparsertest.h" -#include -#include -#include -#include -#include -#include - -#define DATA_DIR "backtraceparsertest_data" -#define SETTINGS_FILE "data.ini" - -BacktraceParserTest::BacktraceParserTest(QObject *parent) - : QObject(parent), - m_settings(DATA_DIR "/" SETTINGS_FILE, QSettings::IniFormat), - m_generator(new FakeBacktraceGenerator(this)) -{ -} - -void BacktraceParserTest::fetchData(const QString & group) -{ - QTest::addColumn("filename"); - QTest::addColumn("result"); - QTest::addColumn("debugger"); - - m_settings.beginGroup(group); - QStringList keys = m_settings.allKeys(); - m_settings.endGroup(); - - foreach(const QString & key, keys) { - QTest::newRow(key.toLocal8Bit()) - << QString(DATA_DIR"/" + key) - << m_settings.value(group + "/" + key).toString() - << m_settings.value("debugger/" + key).toString(); - } -} - -void BacktraceParserTest::btParserUsefulnessTest_data() -{ - fetchData(QStringLiteral("usefulness")); -} - -void BacktraceParserTest::btParserUsefulnessTest() -{ - QFETCH(QString, filename); - QFETCH(QString, result); - QFETCH(QString, debugger); - - //parse - QSharedPointer parser(BacktraceParser::newParser(debugger)); - parser->connectToGenerator(m_generator); - m_generator->sendData(filename); - - //convert usefulness to string - QMetaEnum metaUsefulness = BacktraceParser::staticMetaObject.enumerator( - BacktraceParser::staticMetaObject.indexOfEnumerator("Usefulness")); - QString btUsefulness = metaUsefulness.valueToKey(parser->backtraceUsefulness()); - - //compare - QEXPECT_FAIL("test_e", "Working on it", Continue); - QCOMPARE(btUsefulness, result); -} - -void BacktraceParserTest::btParserFunctionsTest_data() -{ - fetchData(QStringLiteral("firstValidFunctions")); -} - -void BacktraceParserTest::btParserFunctionsTest() -{ - QFETCH(QString, filename); - QFETCH(QString, result); - QFETCH(QString, debugger); - - //parse - QSharedPointer parser(BacktraceParser::newParser(debugger)); - parser->connectToGenerator(m_generator); - m_generator->sendData(filename); - - //compare - QString functions = parser->firstValidFunctions().join(QStringLiteral("|")); - QCOMPARE(functions, result); -} - -void BacktraceParserTest::btParserBenchmark_data() -{ - QTest::addColumn("filename"); - QTest::addColumn("debugger"); - - m_settings.beginGroup(QStringLiteral("debugger")); - QStringList keys = m_settings.allKeys(); - foreach(const QString & key, keys) { - QTest::newRow(key.toLocal8Bit()) - << QString(DATA_DIR"/" + key) - << m_settings.value(key).toString(); - } - m_settings.endGroup(); -} - -void BacktraceParserTest::btParserBenchmark() -{ - QFETCH(QString, filename); - QFETCH(QString, debugger); - - QSharedPointer parser(BacktraceParser::newParser(debugger)); - parser->connectToGenerator(m_generator); - - QBENCHMARK { - m_generator->sendData(filename); - } -} - -QTEST_MAIN(BacktraceParserTest) - diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest.h b/drkonqi/tests/backtraceparsertest/backtraceparsertest.h deleted file mode 100644 index 6977ac320..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifndef BACKTRACEPARSERTEST_H -#define BACKTRACEPARSERTEST_H - -#include -#include "fakebacktracegenerator.h" -#include "../../parser/backtraceparser.h" - -class BacktraceParserTest : public QObject -{ - Q_OBJECT -public: - BacktraceParserTest(QObject *parent = 0); - -private Q_SLOTS: - void btParserUsefulnessTest_data(); - void btParserUsefulnessTest(); - void btParserFunctionsTest_data(); - void btParserFunctionsTest(); - void btParserBenchmark_data(); - void btParserBenchmark(); - -private: - void fetchData(const QString & group); - - QSettings m_settings; - FakeBacktraceGenerator *m_generator; -}; - -#endif diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/data.ini b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/data.ini deleted file mode 100644 index 9b56ab7ae..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/data.ini +++ /dev/null @@ -1,46 +0,0 @@ -[usefulness] -test_a=Useless -test_b=MayBeUseful -test_c=ProbablyUseless -test_d=ReallyUseful -test_e=ProbablyUseless -test_f=ProbablyUseless -test_g=ReallyUseful -test_h=ProbablyUseless -test_bug190882=ReallyUseful -test_bug192412_a=Useless -test_bug192412_b=Useless -test_bug168000=MayBeUseful -test_bug200993=ReallyUseful - -[firstValidFunctions] -test_usefulfunctions=SqlQueryMaker::handleTracks|SqlQueryMaker::handleResult|SqlWorkerThread::run -test_usefulfunctions2=Digikam::Album::removeExtraData|~TreeAlbumItem|~TreeAlbumCheckListItem -;should qt_assert appear here?? -test_usefulfunctions3=qt_assert|ExceptionGuard|QMenuPrivate::activateCausedStack -test_usefulfunctions4=KarbonPart::addShape|KoShapeDeleteCommand::undo|QUndoCommand::undo -test_usefulfunctions5=qt_assert|KMetaDataWidget::Private::slotLoadingFinished|KMetaDataWidget::qt_metacall -test_trailing_const=QString::operator==|qStringComparisonHelper|QString::operator!= -test_anon_namespace=formatICalInvitationHelper|KCal::IncidenceFormatter::formatICalInvitationNoHtml|(anonymous namespace)::Formatter::format - -[debugger] -test_a=gdb -test_b=gdb -test_c=gdb -test_d=gdb -test_e=gdb -test_f=gdb -test_g=gdb -test_h=gdb -test_bug190882=gdb -test_bug192412_a=gdb -test_bug192412_b=gdb -test_bug168000=gdb -test_bug200993=gdb -test_usefulfunctions=gdb -test_usefulfunctions2=gdb -test_usefulfunctions3=gdb -test_usefulfunctions4=gdb -test_usefulfunctions5=gdb -test_trailing_const=gdb -test_anon_namespace=gdb diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_a b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_a deleted file mode 100644 index 529c44c77..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_a +++ /dev/null @@ -1,140 +0,0 @@ -[?1034h(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -[Thread debugging using libthread_db enabled] -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -(no debugging symbols found) -0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#5 0x00007f8c3562e645 in raise () from /lib64/libc.so.6 -#6 0x00007f8c3562fc33 in abort () from /lib64/libc.so.6 -#7 0x00007f8c37500df9 in ?? () from /usr/X11R6/lib64/libGL.so.1 -#8 0x00007f8c333f1abe in ?? () from /usr/X11R6/lib64/libGLcore.so.1 -#9 0x00007f8c333f2423 in ?? () from /usr/X11R6/lib64/libGLcore.so.1 -#10 0x00007f8c331493c4 in ?? () from /usr/X11R6/lib64/libGLcore.so.1 -#11 0x00007f8c32de6aa6 in ?? () from /usr/X11R6/lib64/libGLcore.so.1 -#12 0x00007f8c3b6e1c23 in ?? () from /usr/lib64/libkdeinit4_kwin.so -#13 0x00007f8c3b6e23bc in ?? () from /usr/lib64/libkdeinit4_kwin.so -#14 0x00007f8c3b6d2316 in ?? () from /usr/lib64/libkdeinit4_kwin.so -#15 0x00007f8c3b67c2ca in ?? () from /usr/lib64/libkdeinit4_kwin.so -#16 0x00007f8c3a8ca454 in QMetaObject::activate(QObject*, int, int, void**) () - from /usr/lib64/libQtCore.so.4 -#17 0x00007f8c3a8c4da3 in QObject::event(QEvent*) () - from /usr/lib64/libQtCore.so.4 -#18 0x00007f8c37e871bd in QApplicationPrivate::notify_helper(QObject*, QEvent*) - () from /usr/lib64/libQtGui.so.4 -#19 0x00007f8c37e8ef8a in QApplication::notify(QObject*, QEvent*) () - from /usr/lib64/libQtGui.so.4 -#20 0x00007f8c362c2bab in KApplication::notify(QObject*, QEvent*) () - from /usr/lib64/libkdeui.so.5 -#21 0x00007f8c3a8b6091 in QCoreApplication::notifyInternal(QObject*, QEvent*) - () from /usr/lib64/libQtCore.so.4 -#22 0x00007f8c3a8e21c0 in ?? () from /usr/lib64/libQtCore.so.4 -#23 0x00007f8c3a8de58d in ?? () from /usr/lib64/libQtCore.so.4 -#24 0x00007f8c344760db in g_main_context_dispatch () - from /usr/lib64/libglib-2.0.so.0 -#25 0x00007f8c344798ad in ?? () from /usr/lib64/libglib-2.0.so.0 -#26 0x00007f8c34479a6b in g_main_context_iteration () - from /usr/lib64/libglib-2.0.so.0 -#27 0x00007f8c3a8de4ef in - QEventDispatcherGlib::processEvents(QFlags) () - from /usr/lib64/libQtCore.so.4 -#28 0x00007f8c37f179bf in ?? () from /usr/lib64/libQtGui.so.4 -#29 0x00007f8c3a8b49a2 in - QEventLoop::processEvents(QFlags) () from - /usr/lib64/libQtCore.so.4 -#30 0x00007f8c3a8b4b2d in - QEventLoop::exec(QFlags) () from - /usr/lib64/libQtCore.so.4 -#31 0x00007f8c3a8b6ffd in QCoreApplication::exec() () - from /usr/lib64/libQtCore.so.4 -#32 0x00007f8c3b691c21 in kdemain () from /usr/lib64/libkdeinit4_kwin.so -#33 0x00007f8c3561a586 in __libc_start_main () from /lib64/libc.so.6 -#34 0x0000000000400889 in _start () \ No newline at end of file diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_anon_namespace b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_anon_namespace deleted file mode 100644 index a9ea13370..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_anon_namespace +++ /dev/null @@ -1,53 +0,0 @@ -Thread 1 (Thread 0x7fe4756407f0 (LWP 9487)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0x00007fe46fd0ac57 in formatICalInvitationHelper(QString, KCal::Calendar*, KCal::InvitationFormatterHelper*, bool, KDateTime::Spec) () from /usr/lib64/libkcal.so.4 -#7 0x00007fe46fd0d130 in KCal::IncidenceFormatter::formatICalInvitationNoHtml(QString, KCal::Calendar*, KCal::InvitationFormatterHelper*) () from /usr/lib64/libkcal.so.4 -#8 0x00007fe451a3d7d0 in (anonymous namespace)::Formatter::format(KMail::Interface::BodyPart*, KMail::HtmlWriter*) const () from /usr/lib64/kde4/kmail_bodypartformatter_text_calendar.so -#9 0x00007fe45d93a319 in KMail::ObjectTreeParser::parseObjectTree(partNode*) () from /usr/lib64/libkmailprivate.so.4 -#10 0x00007fe45d93ad55 in KMail::ObjectTreeParser::stdChildHandling(partNode*) () from /usr/lib64/libkmailprivate.so.4 -#11 0x00007fe45d93b006 in KMail::ObjectTreeParser::processMultiPartAlternativeSubtype(partNode*, KMail::ProcessResult&) () from /usr/lib64/libkmailprivate.so.4 -#12 0x00007fe45d93aa31 in KMail::ObjectTreeParser::parseObjectTree(partNode*) () from /usr/lib64/libkmailprivate.so.4 -#13 0x00007fe45d93ad55 in KMail::ObjectTreeParser::stdChildHandling(partNode*) () from /usr/lib64/libkmailprivate.so.4 -#14 0x00007fe45d93b094 in KMail::ObjectTreeParser::processMultiPartMixedSubtype(partNode*, KMail::ProcessResult&) () from /usr/lib64/libkmailprivate.so.4 -#15 0x00007fe45d93aa31 in KMail::ObjectTreeParser::parseObjectTree(partNode*) () from /usr/lib64/libkmailprivate.so.4 -#16 0x00007fe45d7bf3e6 in KMReaderWin::parseMsg(KMMessage*) () from /usr/lib64/libkmailprivate.so.4 -#17 0x00007fe45d7b45e1 in KMReaderWin::displayMessage() () from /usr/lib64/libkmailprivate.so.4 -#18 0x00007fe45d7b47ce in KMReaderWin::updateReaderWin() () from /usr/lib64/libkmailprivate.so.4 -#19 0x00007fe45d7b50d5 in KMReaderWin::update(KMail::Interface::Observable*) () from /usr/lib64/libkmailprivate.so.4 -#20 0x00007fe45d9da719 in KMail::ISubject::notify() () from /usr/lib64/libkmailprivate.so.4 -#21 0x00007fe45d6d980c in KMMessage::updateBodyPart(QString, QByteArray const&) () from /usr/lib64/libkmailprivate.so.4 -#22 0x00007fe45d9b0f59 in KMail::ImapJob::slotGetMessageResult(KJob*) () from /usr/lib64/libkmailprivate.so.4 -#23 0x00007fe45d9b2b1b in KMail::ImapJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkmailprivate.so.4 -#24 0x00007fe473b8a19a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4 -#25 0x00007fe473f7b382 in KJob::result(KJob*) () from /usr/lib64/libkdecore.so.5 -#26 0x00007fe473f7b60f in KJob::emitResult() () from /usr/lib64/libkdecore.so.5 -#27 0x00007fe4713c1733 in KIO::SimpleJob::slotFinished() () from /usr/lib64/libkio.so.5 -#28 0x00007fe4713c1bf3 in KIO::TransferJob::slotFinished() () from /usr/lib64/libkio.so.5 -#29 0x00007fe4713bfbb1 in KIO::TransferJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkio.so.5 -#30 0x00007fe473b8a19a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4 -#31 0x00007fe471480301 in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib64/libkio.so.5 -#32 0x00007fe47147d693 in KIO::SlaveInterface::dispatch() () from /usr/lib64/libkio.so.5 -#33 0x00007fe47147158d in KIO::Slave::gotInput() () from /usr/lib64/libkio.so.5 -#34 0x00007fe471471bcc in KIO::Slave::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkio.so.5 -#35 0x00007fe473b8a19a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4 -#36 0x00007fe4713914d7 in KIO::ConnectionPrivate::dequeue() () from /usr/lib64/libkio.so.5 -#37 0x00007fe4713915fd in KIO::Connection::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkio.so.5 -#38 0x00007fe473b86d89 in QObject::event(QEvent*) () from /usr/lib64/libQtCore.so.4 -#39 0x00007fe472f8a4bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4 -#40 0x00007fe472f90914 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4 -#41 0x00007fe47452da86 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5 -#42 0x00007fe473b7718c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4 -#43 0x00007fe473b79907 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQtCore.so.4 -#44 0x00007fe473ba0a03 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/libQtCore.so.4 -#45 0x00007fe46b430e6e in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0 -#46 0x00007fe46b434838 in ?? () from /usr/lib64/libglib-2.0.so.0 -#47 0x00007fe46b434960 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0 -#48 0x00007fe473ba0543 in QEventDispatcherGlib::processEvents(QFlags) () from /usr/lib64/libQtCore.so.4 -#49 0x00007fe47302711e in QGuiEventDispatcherGlib::processEvents(QFlags) () from /usr/lib64/libQtGui.so.4 -#50 0x00007fe473b75ab2 in QEventLoop::processEvents(QFlags) () from /usr/lib64/libQtCore.so.4 -#51 0x00007fe473b75e8c in QEventLoop::exec(QFlags) () from /usr/lib64/libQtCore.so.4 -#52 0x00007fe473b79bcb in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4 -#53 0x00000000004041f7 in main () diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_b b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_b deleted file mode 100644 index 51ac8a48b..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_b +++ /dev/null @@ -1,70 +0,0 @@ -[Current thread is 0 (LWP 2636)] - -Thread 4 (Thread 0xa9226b90 (LWP 2637)): -#0 0xb8076424 in __kernel_vsyscall () -#1 0xb6982c55 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 -#2 0xb69fa6a2 in QWaitCondition::wait () from /usr/lib/libQtCore.so.4 -#3 0xb7af1a0a in ?? () from /usr/lib/libQtNetwork.so.4 -#4 0x0923ebb0 in ?? () -#5 0x0923ebac in ?? () -#6 0xffffffff in ?? () -#7 0xb6b72000 in ?? () -#8 0xa92262f0 in ?? () -#9 0xb808541b in _dl_fixup () from /lib/ld-linux.so.2 -#10 0xb69f9910 in ?? () from /usr/lib/libQtCore.so.4 -#11 0x0923eba0 in ?? () -#12 0x00000000 in ?? () - -Thread 3 (Thread 0xa892ab90 (LWP 2648)): -#0 0xb8076424 in __kernel_vsyscall () -#1 0xb6982c55 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 -#2 0xb69fa6a2 in QWaitCondition::wait () from /usr/lib/libQtCore.so.4 -#3 0xa949380a in RenderThread::run () from - /usr/lib/kde4/plasma_wallpaper_image.so -#4 0xb69f9910 in ?? () from /usr/lib/libQtCore.so.4 -#5 0x08f7ee5c in ?? () -#6 0x00000000 in ?? () - -Thread 2 (Thread 0xa714fb90 (LWP 2703)): -#0 0xb8076424 in __kernel_vsyscall () -#1 0xb67d7ab1 in select () from /lib/libc.so.6 -#2 0xb6ab7bf7 in ?? () from /usr/lib/libQtCore.so.4 -#3 0x00000008 in ?? () -#4 0xa714f278 in ?? () -#5 0x00000000 in ?? () - -Thread 1 (Thread 0xb4909730 (LWP 2636)): -#0 0xa985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0xaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0xaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0xb721455d in QGraphicsLinearLayout::removeItem () from - /usr/lib/libQtGui.so.4 -#7 0xb804c3f0 in PanelAppletOverlay::mousePressEvent () from - /usr/lib/libkdeinit4_plasma.so -#8 0xb6d2fd1a in QWidget::event () from /usr/lib/libQtGui.so.4 -#9 0xb6cddaec in QApplicationPrivate::notify_helper () from - /usr/lib/libQtGui.so.4 -#10 0xb6ce4863 in QApplication::notify () from /usr/lib/libQtGui.so.4 -#11 0xb78a7f2d in KApplication::notify () from /usr/lib/libkdeui.so.5 -#12 0xb6ad3f31 in QCoreApplication::notifyInternal () from - /usr/lib/libQtCore.so.4 -#13 0xb6ce5be3 in QApplicationPrivate::sendMouseEvent () from - /usr/lib/libQtGui.so.4 -#14 0xb6d42715 in ?? () from /usr/lib/libQtGui.so.4 -#15 0x09b3eb08 in ?? () -#16 0xbfb933dc in ?? () -#17 0x09b3eb08 in ?? () -#18 0x092de818 in ?? () -#19 0xb7310bd0 in ?? () from /usr/lib/libQtGui.so.4 -#20 0xb7310bd4 in ?? () from /usr/lib/libQtGui.so.4 -#21 0xbfb9345c in ?? () -#22 0x00000028 in ?? () -#23 0x09a53f60 in ?? () -#24 0x09a53000 in ?? () -#25 0xb6779bae in mem2chunk_check () from /lib/libc.so.6 -#26 0xb6d41bcd in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4 -#27 0xb6d67172 in ?? () from /usr/lib/libQtGui.so.4 -#28 0x08dbb988 in ?? () -#29 0xbfb938bc in ?? () -#30 0x00000000 in ?? () \ No newline at end of file diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug168000 b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug168000 deleted file mode 100644 index ae9a45386..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug168000 +++ /dev/null @@ -1,16 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#5 0x00007f50e99f776f in QWidget::testAttribute_helper (this=0x6e6440, - attribute=Qt::WA_WState_Created) at kernel/qwidget.cpp:9081 -#6 0x00007f50e9a37d51 in QWidget::mapFromGlobal (this=0x6e6440, - pos=@0x7ffff350ff90) - at ../../include/QtGui/../../src/gui/kernel/qwidget.h:991 -#7 0x00007f50e9a37e79 in QWidget::mapFromGlobal (this=0x6e6450, - pos=@0x7ffff350ff90) at kernel/qwidget_x11.cpp:1069 -#8 0x000000000041fb6c in _start () -#0 0x00007f50e75ff241 in nanosleep () from /lib/libc.so.6 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug190882 b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug190882 deleted file mode 100644 index 52be7b3c3..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug190882 +++ /dev/null @@ -1,78 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0x00000000 in ?? () -#7 0xb74b192b in QGLWidget::glDraw (this=0xad928a8) at /local/src/qt-x11-opensource-src-4.5.1/src/opengl/qgl.cpp:3458 -#8 0xb74b041e in QGLWidget::paintEvent (this=0xad928a8) at /local/src/qt-x11-opensource-src-4.5.1/src/opengl/qgl.cpp:3261 -#9 0xb5b8d942 in QWidget::event (this=0xad928a8, event=0xbffe9924) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qwidget.cpp:7659 -#10 0xb74b36bc in QGLWidget::event (this=0xad928a8, e=0xbffe9924) at /local/src/qt-x11-opensource-src-4.5.1/src/opengl/qgl.cpp:3244 -#11 0xb5b3827c in QApplicationPrivate::notify_helper (this=0x8088b68, receiver=0xad928a8, e=0xbffe9924) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:4057 -#12 0xb5b3fa54 in QApplication::notify (this=0xbffec4bc, receiver=0xad928a8, e=0xbffe9924) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:4022 -#13 0xb69ee93b in KApplication::notify (this=0xbffec4bc, receiver=0xad928a8, event=0xbffe9924) at /local/svn/kde/trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp:307 -#14 0xb7fcddcb in QCoreApplication::notifyInternal (this=0xbffec4bc, receiver=0xad928a8, event=0xbffe9924) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.cpp:610 -#15 0xb5b96205 in QCoreApplication::sendSpontaneousEvent (event=, receiver=) - at ../../include/QtCore/../../../../src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.h:216 -#16 QWidgetPrivate::drawWidget (event=, receiver=) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qwidget.cpp:5052 -#17 0xb5d5133d in QWidgetPrivate::repaint_sys (this=0xad928f0, rgn=...) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/painting/qbackingstore.cpp:1536 -#18 0xb5b86d5e in QWidgetPrivate::syncBackingStore (this=0xad928f0) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qwidget.cpp:1599 -#19 0xb5b8e123 in QWidget::event (this=0xad928a8, event=0x874e6b0) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qwidget.cpp:7799 -#20 0xb74b36bc in QGLWidget::event (this=0xad928a8, e=0x874e6b0) at /local/src/qt-x11-opensource-src-4.5.1/src/opengl/qgl.cpp:3244 -#21 0xb5b3827c in QApplicationPrivate::notify_helper (this=0x8088b68, receiver=0xad928a8, e=0x874e6b0) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:4057 -#22 0xb5b3fa54 in QApplication::notify (this=0xbffec4bc, receiver=0xad928a8, e=0x874e6b0) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:4022 -#23 0xb69ee93b in KApplication::notify (this=0xbffec4bc, receiver=0xad928a8, event=0x874e6b0) at /local/svn/kde/trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp:307 -#24 0xb7fcddcb in QCoreApplication::notifyInternal (this=0xbffec4bc, receiver=0xad928a8, event=0x874e6b0) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.cpp:610 -#25 0xb7fce898 in QCoreApplication::sendEvent (event=, receiver=) - at ../../include/QtCore/../../../../src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.h:213 -#26 QCoreApplicationPrivate::sendPostedEvents (event=, receiver=) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.cpp:1247 -#27 0xb7fcea6d in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.cpp:1140 -#28 0xb7ff952f in QCoreApplication::sendPostedEvents () at ../../include/QtCore/../../../../src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.h:218 -#29 postEventSourceDispatch () at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qeventdispatcher_glib.cpp:209 -#30 0xb56839c8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 -#31 0xb5687083 in ?? () from /usr/lib/libglib-2.0.so.0 -#32 0xb5687241 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 -#33 0xb7ff915c in QEventDispatcherGlib::processEvents (this=0x80506a8, flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qeventdispatcher_glib.cpp:324 -#34 0xb5bd7845 in QGuiEventDispatcherGlib::processEvents (this=0x80506a8, flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qguieventdispatcher_glib.cpp:202 -#35 0xb7fcc359 in QEventLoop::processEvents (this=0xbffea210, flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qeventloop.cpp:149 -#36 0xb7fcc7a2 in QEventLoop::exec (this=0xbffea210, flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qeventloop.cpp:200 -#37 0xb6057bb3 in QDialog::exec (this=0xbffea250) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/dialogs/qdialog.cpp:498 -#38 0xad36ef3c in Glsl::slotActivate (this=0xa47fc40) at /local/svn/kde/trunk/koffice/krita/plugins/extensions/glsl/glsl.cc:71 -#39 0xad36efb5 in Glsl::qt_metacall (this=0xa47fc40, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbffea3e8) at /local/build/koffice/krita/plugins/extensions/glsl/glsl.moc:68 -#40 0xb7fe3ef8 in QMetaObject::activate (sender=0xa4825d8, from_signal_index=5, to_signal_index=6, argv=0xbffea3e8) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qobject.cpp:3111 -#41 0xb7fe4388 in QMetaObject::activate (sender=0xa4825d8, m=0xb63cc108, from_local_signal_index=1, to_local_signal_index=2, argv=0xbffea3e8) - at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qobject.cpp:3205 -#42 0xb5b31b91 in QAction::triggered (this=0xa4825d8, _t1=false) at .moc/release-shared/moc_qaction.cpp:236 -#43 0xb5b33112 in QAction::activate (this=0xa4825d8, event=QAction::Trigger) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qaction.cpp:1160 -#44 0xb5fb25cc in QMenuPrivate::activateCausedStack (this=0xa5b6370, causedStack=..., action=0xa4825d8, action_e=QAction::Trigger, self=true) - at /local/src/qt-x11-opensource-src-4.5.1/src/gui/widgets/qmenu.cpp:967 -#45 0xb5fb8ceb in QMenuPrivate::activateAction (this=0xa5b6370, action=0xa4825d8, action_e=QAction::Trigger, self=) - at /local/src/qt-x11-opensource-src-4.5.1/src/gui/widgets/qmenu.cpp:1060 -#46 0xb5fb98b7 in QMenu::mouseReleaseEvent (this=0xa5ae708, e=0xbffeac44) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/widgets/qmenu.cpp:2254 -#47 0xb6ac8fc2 in KMenu::mouseReleaseEvent (this=0xa5ae708, e=0xbffeac44) at /local/svn/kde/trunk/KDE/kdelibs/kdeui/widgets/kmenu.cpp:456 -#48 0xb5b8db77 in QWidget::event (this=0xa5ae708, event=0xbffeac44) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qwidget.cpp:7521 -#49 0xb5fbbbbc in QMenu::event (this=0xa5ae708, e=0xbffeac44) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/widgets/qmenu.cpp:2353 -#50 0xb5b3827c in QApplicationPrivate::notify_helper (this=0x8088b68, receiver=0xa5ae708, e=0xbffeac44) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:4057 -#51 0xb5b4032b in QApplication::notify (this=0xbffec4bc, receiver=0xa5ae708, e=0xbffeac44) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:3759 -#52 0xb69ee93b in KApplication::notify (this=0xbffec4bc, receiver=0xa5ae708, event=0xbffeac44) at /local/svn/kde/trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp:307 -#53 0xb7fcddcb in QCoreApplication::notifyInternal (this=0xbffec4bc,receiver=0xa5ae708, event=0xbffeac44) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.cpp:610 -#54 0xb5b3f3ae in QCoreApplication::sendSpontaneousEvent (event=, receiver=) - at ../../include/QtCore/../../../../src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.h:216 -#55 QApplicationPrivate::sendMouseEvent (event=,receiver=) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:2925 -#56 0xb5bae8c0 in QETWidget::translateMouseEvent (this=0xa5ae708, event=0xbffec1a0) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication_x11.cpp:4382 -#57 0xb5bad8cc in QApplication::x11ProcessEvent (this=0xbffec4bc,event=0xbffec1a0) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication_x11.cpp:3444 -#58 0xb5bd8112 in x11EventSourceDispatch (s=0x808ba38, callback=0,user_data=0x0) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qguieventdispatcher_glib.cpp:146 -#59 0xb56839c8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 -#60 0xb5687083 in ?? () from /usr/lib/libglib-2.0.so.0 -#61 0xb5687241 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 -#62 0xb7ff915c in QEventDispatcherGlib::processEvents (this=0x80506a8,flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qeventdispatcher_glib.cpp:324 -#63 0xb5bd7845 in QGuiEventDispatcherGlib::processEvents (this=0x80506a8,flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qguieventdispatcher_glib.cpp:202 -#64 0xb7fcc359 in QEventLoop::processEvents (this=0xbffec444, flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qeventloop.cpp:149 -#65 0xb7fcc7a2 in QEventLoop::exec (this=0xbffec444, flags=...) at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qeventloop.cpp:200 -#66 0xb7fceb2f in QCoreApplication::exec () at /local/src/qt-x11-opensource-src-4.5.1/src/corelib/kernel/qcoreapplication.cpp:888 -#67 0xb5b380f7 in QApplication::exec () at /local/src/qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication.cpp:3526 -#68 0xb80c5591 in kdemain (argc=1, argv=0xbffec5b4) at /local/svn/kde/trunk/koffice/krita/main.cc:44 -#69 0x0804887b in main (argc=1, argv=0xbffec5b4) at /local/build/koffice/krita/krita_dummy.cpp:3 - diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug192412_a b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug192412_a deleted file mode 100644 index 400f4011a..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug192412_a +++ /dev/null @@ -1,9 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0x0805a0eb in ?? () -#7 0x08050ac4 in _start () diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug192412_b b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug192412_b deleted file mode 100644 index 7817eacf6..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug192412_b +++ /dev/null @@ -1,9 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#4 KCmdLineArgs::arg (this=0x0, n=0) at /home/gkiagia/kde/src/KDE/kdelibs/kdecore/kernel/kcmdlineargs.cpp:1530 -#5 0x00000000004023af in _start () diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug200993 b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug200993 deleted file mode 100644 index d92cede9e..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_bug200993 +++ /dev/null @@ -1,20 +0,0 @@ -Thread 1 (Thread 0x7fe4756407f0 (LWP 9487)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0xffffe430 in __kernel_vsyscall () -#7 0xb617b990 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 -#8 0xb617d2c8 in *__GI_abort () at abort.c:88 -#9 0xb617478e in *__GI___assert_fail (assertion=0xb3391928 "!s_refcnt", file=0xb3391720 "/local/svn/kde/trunk/KDE/kdelibs/khtml/khtml_global.cpp", line=258, - function=0xb3391ac0 "static void KHTMLGlobal::finalCheck()") at assert.c:78 -#10 0xb2f947d3 in KHTMLGlobal::finalCheck () at /local/svn/kde/trunk/KDE/kdelibs/khtml/khtml_global.cpp:258 -#11 0xb418554d in ~KHTMLFactory (this=0x825fcd0, __in_chrg=) at /local/svn/kde/trunk/KDE/kdelibs/khtml/khtml_factory.cpp:35 -#12 0xb70e8e86 in QObjectCleanupHandler::clear (this=0x825d9e0) at /local/git/Qt/qt/src/corelib/kernel/qobjectcleanuphandler.cpp:140 -#13 0xb70e8ed0 in ~QObjectCleanupHandler (this=0x825d9e0, __in_chrg=) at /local/git/Qt/qt/src/corelib/kernel/qobjectcleanuphandler.cpp:86 -#14 0xb741fc21 in destroy () at /local/svn/kde/trunk/KDE/kdelibs/kdecore/util/kpluginfactory.cpp:29 -#15 0xb72e154b in ~KCleanUpGlobalStatic (this=0xb74d15d4, __in_chrg=) at /local/svn/kde/trunk/KDE/kdelibs/kdecore/kernel/kglobal.h:62 -#16 0xb617e9b1 in *__GI_exit (status=0) at exit.c:75 -#17 0xb616770d in __libc_start_main (main=0x804877e
, argc=1, ubp_av=0xbf97df04, init=0x80487b0 <__libc_csu_init>, fini=0x80487a0 <__libc_csu_fini>, rtld_fini=0xb7f70220 <_dl_fini>, - stack_end=0xbf97defc) at libc-start.c:252 -#18 0x080486d1 in _start () at ../sysdeps/i386/elf/start.S:119 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_c b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_c deleted file mode 100644 index bfa2131f3..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_c +++ /dev/null @@ -1,35 +0,0 @@ -0x00007fd2f44f4001 in nanosleep () from /lib/libc.so.6 -[Current thread is 0 (LWP 4414)] - -Thread 3 (Thread 0x7fd2c7276950 (LWP 4425)): -#0 0x00007fd2f451bc66 in poll () from /lib/libc.so.6 -#1 0x00007fd2f6bbbc61 in net::DownloadThread::waitForSocketReady () from /usr/lib/libbtcore.so.7 -#2 0x00007fd2f6bbbccc in net::DownloadThread::update () from /usr/lib/libbtcore.so.7 -#3 0x00007fd2f6bbc6d9 in net::NetworkThread::run () from /usr/lib/libbtcore.so.7 -#4 0x00007fd2fba5ad79 in ?? () from /usr/lib/libQtCore.so.4 -#5 0x00007fd2fb7e9fc7 in start_thread () from /lib/libpthread.so.0 -#6 0x00007fd2f45245dd in clone () from /lib/libc.so.6 -#7 0x0000000000000000 in ?? () - -Thread 2 (Thread 0x7fd2c6a75950 (LWP 4426)): -#0 0x00007fd2fb7edd69 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 -#1 0x00007fd2fba5bb09 in QWaitCondition::wait () from /usr/lib/libQtCore.so.4 -#2 0x00007fd2f6bbb7a4 in net::UploadThread::update () from /usr/lib/libbtcore.so.7 -#3 0x00007fd2f6bbc6d9 in net::NetworkThread::run () from /usr/lib/libbtcore.so.7 -#4 0x00007fd2fba5ad79 in ?? () from /usr/lib/libQtCore.so.4 -#5 0x00007fd2fb7e9fc7 in start_thread () from /lib/libpthread.so.0 -#6 0x00007fd2f45245dd in clone () from /lib/libc.so.6 -#7 0x0000000000000000 in ?? () - -Thread 1 (Thread 0x7fd2fc35f750 (LWP 4414)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#5 0x00007fd2f44d272b in memcpy () from /lib/libc.so.6 -#6 0x00007fd2f6bd4add in bt::WebSeed::handleData () from /usr/lib/libbtcore.so.7 -#7 0x00007fd2f6bd5703 in bt::WebSeed::update () from /usr/lib/libbtcore.so.7 -#8 0x00007fd2f6bdc120 in bt::Downloader::update () from /usr/lib/libbtcore.so.7 -#9 0x00007fd2f6bfee5b in bt::TorrentControl::update () from /usr/lib/libbtcore.so.7 -#10 0x000000000042996a in _start () - diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_d b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_d deleted file mode 100644 index 5ac7675e0..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_d +++ /dev/null @@ -1,104 +0,0 @@ -0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0xb59786c0 (LWP 6637)): -#0 0xa985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0xaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0xaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0xb3fe1ac0 in QBasicAtomicInt::ref (this=0xc) at - /home/tz/develop/kde/svn/qt-copy/include/QtCore/../../src/corelib/arch/qatomic_i386.h:116 -#7 0xb40010e6 in QHash (this=0xbfb999fc, other=@0x84afe24) at - /home/tz/develop/kde/svn/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:264 -#8 0xb400111c in QSet (this=0xbfb999fc, other=@0x84afe24) at - /home/tz/develop/kde/svn/qt-copy/include/QtCore/../../src/corelib/tools/qset.h:56 -#9 0xb4001136 in QForeachContainer (this=0xbfb999fc, t=@0x84afe24) at - /home/tz/develop/kde/svn/qt-copy/include/QtCore/../../src/corelib/global/qglobal.h:1964 -#10 0xb3ffa778 in KoShape::notifyChanged (this=0x84a4538) at - /home/tz/develop/kde/svn/koffice/libs/flake/KoShape.cpp:458 -#11 0xb3ffb773 in KoShape::setParent (this=0x84a4538, parent=0x0) at - /home/tz/develop/kde/svn/koffice/libs/flake/KoShape.cpp:375 -#12 0xb40032de in ~Private (this=0x84a0ca0) at - /home/tz/develop/kde/svn/koffice/libs/flake/KoShapeContainer.cpp:36 -#13 0xb4002aa8 in ~KoShapeContainer (this=0x84b4bf8) at - /home/tz/develop/kde/svn/koffice/libs/flake/KoShapeContainer.cpp:56 -#14 0xb4240152 in ~MagicCurtain (this=0x84b4bf8) at - /home/tz/develop/kde/svn/koffice/kword/part/KWDocument.cpp:80 -#15 0xb423ab9e in ~KWDocument (this=0x81a34e0) at - /home/tz/develop/kde/svn/koffice/kword/part/KWDocument.cpp:154 -#16 0xb77b7849 in KoMainWindow::setRootDocument (this=0x8200b38, doc=0x0) at - /home/tz/develop/kde/svn/koffice/libs/main/KoMainWindow.cpp:501 -#17 0xb77ba45b in KoMainWindow::slotFileClose (this=0x8200b38) at - /home/tz/develop/kde/svn/koffice/libs/main/KoMainWindow.cpp:1283 -#18 0xb77ba922 in KoMainWindow::qt_metacall (this=0x8200b38, - _c=QMetaObject::InvokeMetaMethod, _id=13, _a=0xbfb99c7c) at - /home/ko2/koffice-build/libs/main/KoMainWindow.moc:135 -#19 0xb6c8a635 in QMetaObject::activate (sender=0x8207500, from_signal_index=5, - to_signal_index=6, argv=0xbfb99c7c) at kernel/qobject.cpp:3028 -#20 0xb6c8a83e in QMetaObject::activate (sender=0x8207500, m=0xb7730af8, - from_local_signal_index=1, to_local_signal_index=2, argv=0xbfb99c7c) at - kernel/qobject.cpp:3121 -#21 0xb702cb16 in QAction::triggered (this=0x8207500, _t1=false) at - .moc/debug-shared/moc_qaction.cpp:216 -#22 0xb702e6b8 in QAction::activate (this=0x8207500, event=QAction::Trigger) at - kernel/qaction.cpp:1125 -#23 0xb702e857 in QAction::event (this=0x8207500, e=0xbfb9a0d4) at - kernel/qaction.cpp:1044 -#24 0xb709d70a in QWidgetAction::event (this=0x8207500, event=0xbfb9a0d4) at - kernel/qwidgetaction.cpp:230 -#25 0xb70348c5 in QApplicationPrivate::notify_helper (this=0x805afa0, - receiver=0x8207500, e=0xbfb9a0d4) at kernel/qapplication.cpp:3803 -#26 0xb7034bab in QApplication::notify (this=0xbfb9ae7c, receiver=0x8207500, - e=0xbfb9a0d4) at kernel/qapplication.cpp:3393 -#27 0xb79f6ebb in KApplication::notify (this=0xbfb9ae7c, receiver=0x8207500, - event=0xbfb9a0d4) at - /home/tz/develop/kde/svn/kdelibs/kdeui/kernel/kapplication.cpp:311 -#28 0xb6c7570a in QCoreApplication::notifyInternal (this=0xbfb9ae7c, - receiver=0x8207500, event=0xbfb9a0d4) at kernel/qcoreapplication.cpp:583 -#29 0xb703153d in QCoreApplication::sendEvent (receiver=0x8207500, - event=0xbfb9a0d4) at - ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:209 -#30 0xb7074325 in QShortcutMap::dispatchEvent (this=0x805b03c, e=0xbfb9a4f4) at - kernel/qshortcutmap.cpp:771 -#31 0xb7075364 in QShortcutMap::tryShortcutEvent (this=0x805b03c, w=0x893ac60, - e=0xbfb9a4f4) at kernel/qshortcutmap.cpp:362 -#32 0xb7034dc6 in QApplication::notify (this=0xbfb9ae7c, receiver=0x893ac60, - e=0xbfb9a4f4) at kernel/qapplication.cpp:3430 -#33 0xb79f6ebb in KApplication::notify (this=0xbfb9ae7c, receiver=0x893ac60, - event=0xbfb9a4f4) at - /home/tz/develop/kde/svn/kdelibs/kdeui/kernel/kapplication.cpp:311 -#34 0xb6c7570a in QCoreApplication::notifyInternal (this=0xbfb9ae7c, - receiver=0x893ac60, event=0xbfb9a4f4) at kernel/qcoreapplication.cpp:583 -#35 0xb704079f in QCoreApplication::sendSpontaneousEvent (receiver=0x893ac60, - event=0xbfb9a4f4) at - ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:212 -#36 0xb70a00ce in qt_sendSpontaneousEvent (receiver=0x893ac60, - event=0xbfb9a4f4) at kernel/qapplication_x11.cpp:4588 -#37 0xb70da5b4 in QKeyMapper::sendKeyEvent (keyWidget=0x893ac60, grab=false, - type=QEvent::KeyPress, code=87, modifiers=@0xbfb9a658, text=@0xbfb9a68c, - autorepeat=false, count=1, nativeScanCode=25, - nativeVirtualKey=119, nativeModifiers=4) at kernel/qkeymapper_x11.cpp:1652 -#38 0xb70db921 in QKeyMapperPrivate::translateKeyEvent (this=0x807ef50, - keyWidget=0x893ac60, event=0xbfb9abdc, grab=false) at - kernel/qkeymapper_x11.cpp:1623 -#39 0xb70b15af in QApplication::x11ProcessEvent (this=0xbfb9ae7c, - event=0xbfb9abdc) at kernel/qapplication_x11.cpp:3053 -#40 0xb70dde71 in x11EventSourceDispatch (s=0x805df20, callback=0, - user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:142 -#41 0xb670ecc6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 -#42 0xb6712083 in ?? () from /usr/lib/libglib-2.0.so.0 -#43 0xb671263e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 -#44 0xb6ca4b8c in QEventDispatcherGlib::processEvents (this=0x805b0d8, - flags=@0xbfb9ad74) at kernel/qeventdispatcher_glib.cpp:319 -#45 0xb70dd68c in QGuiEventDispatcherGlib::processEvents (this=0x805b0d8, - flags=@0xbfb9ada4) at kernel/qguieventdispatcher_glib.cpp:198 -#46 0xb6c725ca in QEventLoop::processEvents (this=0xbfb9ae20, - flags=@0xbfb9ade4) at kernel/qeventloop.cpp:143 -#47 0xb6c72809 in QEventLoop::exec (this=0xbfb9ae20, flags=@0xbfb9ae28) at - kernel/qeventloop.cpp:190 -#48 0xb6c75ef3 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:845 -#49 0xb70345de in QApplication::exec () at kernel/qapplication.cpp:3331 -#50 0xb7f3be82 in kdemain (argc=1, argv=0xbfb9af74) at - /home/tz/develop/kde/svn/koffice/kword/part/main.cpp:38 -#51 0x08048736 in main (argc=139070860, argv=0x0) at - /home/ko2/koffice-build/kword/part/kword_dummy.cpp:3 \ No newline at end of file diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_e b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_e deleted file mode 100644 index f7fe2d046..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_e +++ /dev/null @@ -1,21 +0,0 @@ -Thread 1 (Thread 0xb4eda700 (LWP 9067)): -#0 0xa985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0xaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0xaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0xffffe430 in __kernel_vsyscall () -#7 0xb5f05990 in raise () from /lib/libc.so.6 -#8 0xb5f072c8 in abort () from /lib/libc.so.6 -#9 0xb5f47683 in ?? () from /lib/libc.so.6 -#10 0xb5f48edb in free () from /lib/libc.so.6 -#11 0xb6128ec1 in operator delete(void*) () from /usr/lib/libstdc++.so.6 -#12 0x08054227 in ?? () -#13 0xb7c6466a in K3StaticDeleterPrivate::deleteStaticDeleters () at - /usr/src/debug/kdelibs-4.2.0/kde3support/kdecore/k3staticdeleter.cpp:56 -#14 0xb6ce9efb in qt_call_post_routines() () from /usr/lib/libQtCore.so.4 -#15 0xb6289c18 in QApplication::~QApplication() () from /usr/lib/libQtGui.so.4 -#16 0xb7eb019e in ~KApplication (this=0xbfbdb0a0) at - /usr/src/debug/kdelibs-4.2.0/kdeui/kernel/kapplication.cpp:928 -#17 0xb7eb7318 in ~KUniqueApplication (this=0xbfbdb0a0) at - /usr/src/debug/kdelibs-4.2.0/kdeui/kernel/kuniqueapplication.cpp:372 -#18 0x0805116a in _start () \ No newline at end of file diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_f b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_f deleted file mode 100644 index ad6409f0b..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_f +++ /dev/null @@ -1,53 +0,0 @@ -(no debugging symbols found) -[Thread debugging using libthread_db enabled] -[New Thread 0x7f085740d780 (LWP 11923)] -[New Thread 0x4275c950 (LWP 11931)] -0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#5 0x00007f0856662a3c in Kopete::MetaContact::metaContactId () - from /usr/lib/libkopete.so.4 -#6 0x00007f0842c975cc in ?? () from /usr/lib/kde4/kopete_statistics.so -#7 0x00007f0842c97944 in ?? () from /usr/lib/kde4/kopete_statistics.so -#8 0x00007f0842c88a61 in ?? () from /usr/lib/kde4/kopete_statistics.so -#9 0x00007f085389842d in QObject::event (this=0xc220a0, e=0x98d950) - at kernel/qobject.cpp:1124 -#10 0x00007f08544cae5d in QApplicationPrivate::notify_helper (this=0x69a640, - receiver=0xc220a0, e=0x2ad1350) at kernel/qapplication.cpp:3772 -#11 0x00007f08544d2b2a in QApplication::notify (this=0x7fff5f54d0f0, - receiver=0xc220a0, e=0x2ad1350) at kernel/qapplication.cpp:3739 -#12 0x00007f08554b9b7b in KApplication::notify (this=0x7fff5f54d0f0, - receiver=0xc220a0, event=0x2ad1350) - at /build/buildd/kde4libs-4.0.98+svn833207/kdeui/kernel/kapplication.cpp:311 -#13 0x00007f0853889411 in QCoreApplication::notifyInternal ( - this=0x7fff5f54d0f0, receiver=0xc220a0, event=0x2ad1350) - at kernel/qcoreapplication.cpp:587 -#14 0x00007f085388a0ba in QCoreApplicationPrivate::sendPostedEvents ( - receiver=0x0, event_type=0, data=0x675580) - at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215 -#15 0x00007f08538b1bb3 in postEventSourceDispatch (s=) - at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220 -#16 0x00007f084f4840f2 in g_main_context_dispatch () - from /usr/lib/libglib-2.0.so.0 -#17 0x00007f084f487396 in ?? () from /usr/lib/libglib-2.0.so.0 -#18 0x00007f084f48782f in g_main_context_iteration () - from /usr/lib/libglib-2.0.so.0 -#19 0x00007f08538b183f in QEventDispatcherGlib::processEvents (this=0x688fb0, - flags=) at kernel/qeventdispatcher_glib.cpp:325 -#20 0x00007f085455c16f in QGuiEventDispatcherGlib::processEvents ( - this=0x7fff5f54c5a0, flags=) - at kernel/qguieventdispatcher_glib.cpp:204 -#21 0x00007f0853887d22 in QEventLoop::processEvents ( - this=, flags={i = 1599393824}) - at kernel/qeventloop.cpp:149 -#22 0x00007f0853887ead in QEventLoop::exec (this=0x7fff5f54d060, flags= - {i = 1599393904}) at kernel/qeventloop.cpp:200 -#23 0x00007f085388a37d in QCoreApplication::exec () - at kernel/qcoreapplication.cpp:845 -#24 0x0000000000448c6c in _start () -#0 0x00007f0853178241 in nanosleep () from /lib/libc.so.6 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_g b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_g deleted file mode 100644 index b627e961b..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_g +++ /dev/null @@ -1,76 +0,0 @@ -[Thread debugging using libthread_db enabled] -[New Thread 0x7fd180c72740 (LWP 24313)] -[New Thread 0x42f84950 (LWP 24317)] -[New Thread 0x42783950 (LWP 24316)] -[New Thread 0x41f82950 (LWP 24315)] -0x00007fd17fb15bf2 in QString::operator== (this=0x687e90, - other=) at tools/qstring.cpp:1928 - in tools/qstring.cpp -[Current thread is 0 (LWP 24313)] - -Thread 4 (Thread 0x41f82950 (LWP 24315)): -#0 map_function (s=@0x687e88) at /home/gkiagia/kde/src/drkonqi/tests/crashtest/crashtest.cpp:71 -#1 0x0000000000402dbb in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIteration (this=, it=) - at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:73 -#2 0x0000000000402e3a in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIterations (this=0x67f220, - sequenceBeginIterator=, beginIndex=, endIndex=1) at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:82 -#3 0x0000000000403882 in QtConcurrent::IterateKernel::iterator, void>::forThreadFunction (this=0x67f220) at /usr/include/qt4/QtCore/qtconcurrentiteratekernel.h:247 -#4 0x00007fd17fac8f79 in QtConcurrent::ThreadEngineBase::run (this=0x67f260) at concurrent/qtconcurrentthreadengine.cpp:184 -#5 0x00007fd17facc251 in QThreadPoolThread::run (this=0x685b20) at concurrent/qthreadpool.cpp:106 -#6 0x00007fd17fad5802 in QThreadPrivate::start (arg=0x685b20) at thread/qthread_unix.cpp:189 -#7 0x00007fd17f853fc7 in start_thread () from /lib/libpthread.so.0 -#8 0x00007fd17df8e5ad in clone () from /lib/libc.so.6 -#9 0x0000000000000000 in ?? () - -Thread 3 (Thread 0x42783950 (LWP 24316)): -#0 0x00007fd17f85b5ef in waitpid () from /lib/libpthread.so.0 -#1 0x00007fd1807e260d in KCrash::startDirectly (argv=0x42782890) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fd1807e3581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#4 KCmdLineArgs::arg (this=0x0, n=0) at /home/gkiagia/kde/src/KDE/kdelibs/kdecore/kernel/kcmdlineargs.cpp:1516 -#5 0x000000000040233f in do_crash () at /home/gkiagia/kde/src/drkonqi/tests/crashtest/crashtest.cpp:42 -#6 0x0000000000402dbb in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIteration (this=, it=) - at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:73 -#7 0x0000000000402e3a in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIterations (this=0x67f220, - sequenceBeginIterator=, beginIndex=, endIndex=4) at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:82 -#8 0x0000000000403882 in QtConcurrent::IterateKernel::iterator, void>::forThreadFunction (this=0x67f220) at /usr/include/qt4/QtCore/qtconcurrentiteratekernel.h:247 -#9 0x00007fd17fac8f79 in QtConcurrent::ThreadEngineBase::run (this=0x67f260) at concurrent/qtconcurrentthreadengine.cpp:184 -#10 0x00007fd17facc251 in QThreadPoolThread::run (this=0x67ec30) at concurrent/qthreadpool.cpp:106 -#11 0x00007fd17fad5802 in QThreadPrivate::start (arg=0x67ec30) at thread/qthread_unix.cpp:189 -#12 0x00007fd17f853fc7 in start_thread () from /lib/libpthread.so.0 -#13 0x00007fd17df8e5ad in clone () from /lib/libc.so.6 -#14 0x0000000000000000 in ?? () - -Thread 2 (Thread 0x42f84950 (LWP 24317)): -#0 0x0000000000403b3b in qStringComparisonHelper (s1=@0x687e98, s2=) at /usr/include/qt4/QtCore/qstring.h:905 -#1 0x0000000000403b69 in QString::operator!= (this=0x687e98, s=0x68816a "") at /usr/include/qt4/QtCore/qstring.h:910 -#2 0x00000000004027e5 in map_function (s=@0x687e98) at /home/gkiagia/kde/src/drkonqi/tests/crashtest/crashtest.cpp:71 -#3 0x0000000000402dbb in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIteration (this=, it=) - at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:73 -#4 0x0000000000402e3a in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIterations (this=0x67f220, - sequenceBeginIterator=, beginIndex=, endIndex=3) at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:82 -#5 0x0000000000403882 in QtConcurrent::IterateKernel::iterator, void>::forThreadFunction (this=0x67f220) at /usr/include/qt4/QtCore/qtconcurrentiteratekernel.h:247 -#6 0x00007fd17fac8f79 in QtConcurrent::ThreadEngineBase::run (this=0x67f260) at concurrent/qtconcurrentthreadengine.cpp:184 -#7 0x00007fd17facc251 in QThreadPoolThread::run (this=0x654a30) at concurrent/qthreadpool.cpp:106 -#8 0x00007fd17fad5802 in QThreadPrivate::start (arg=0x654a30) at thread/qthread_unix.cpp:189 -#9 0x00007fd17f853fc7 in start_thread () from /lib/libpthread.so.0 -#10 0x00007fd17df8e5ad in clone () from /lib/libc.so.6 -#11 0x0000000000000000 in ?? () - -Thread 1 (Thread 0x7fd180c72740 (LWP 24313)): -#0 0x00007fd17fb15bf2 in QString::operator== (this=0x687e90, other=) at tools/qstring.cpp:1928 -#1 0x0000000000403b3b in qStringComparisonHelper (s1=@0x687e90, s2=) at /usr/include/qt4/QtCore/qstring.h:905 -#2 0x0000000000403b69 in QString::operator!= (this=0x687e90, s=0x6880ba "") at /usr/include/qt4/QtCore/qstring.h:910 -#3 0x00000000004027e5 in map_function (s=@0x687e90) at /home/gkiagia/kde/src/drkonqi/tests/crashtest/crashtest.cpp:71 -#4 0x0000000000402dbb in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIteration (this=, it=) - at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:73 -#5 0x0000000000402e3a in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIterations (this=0x67f220, - sequenceBeginIterator=, beginIndex=, endIndex=2) at /usr/include/qt4/QtCore/qtconcurrentmapkernel.h:82 -#6 0x0000000000403882 in QtConcurrent::IterateKernel::iterator, void>::forThreadFunction (this=0x67f220) at /usr/include/qt4/QtCore/qtconcurrentiteratekernel.h:247 -#7 0x00007fd17fac9261 in QtConcurrent::ThreadEngineBase::startBlocking (this=0x67f260) at concurrent/qtconcurrentthreadengine.cpp:76 -#8 0x0000000000403a30 in QtConcurrent::ThreadEngine::startBlocking (this=0x67f220) at /usr/include/qt4/QtCore/qtconcurrentthreadengine.h:185 -#9 0x0000000000403a4c in QtConcurrent::ThreadEngineStarter::startBlocking (this=0x7fff88daed20) at /usr/include/qt4/QtCore/qtconcurrentthreadengine.h:286 -#10 0x0000000000403acb in QtConcurrent::blockingMap (sequence=@0x7fff88daedd0, map=) at /usr/include/qt4/QtCore/qtconcurrentmap.h:386 -#11 0x0000000000402283 in do_threads () at /home/gkiagia/kde/src/drkonqi/tests/crashtest/crashtest.cpp:79 -#12 0x0000000000402785 in main (argc=2, argv=0x7fff88daf0e8) at /home/gkiagia/kde/src/drkonqi/tests/crashtest/crashtest.cpp:141 -0x00007fd17fb15bf2 1928 in tools/qstring.cpp diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_h b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_h deleted file mode 100644 index 1fb066dfc..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_h +++ /dev/null @@ -1,12 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#4 0x00007f44eff82065 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 -#5 0x00007f44eff85153 in *__GI_abort () at abort.c:88 -#6 0x00007f44f1b6d775 in qt_message_output (msgType=QtFatalMsg, buf=) at global/qglobal.cpp:2017 -#7 0x00007f44f1b6d8bb in qFatal (msg=) at global/qglobal.cpp:2216 -#8 0x0000000000402815 in main () diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_trailing_const b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_trailing_const deleted file mode 100644 index f6be80ab2..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_trailing_const +++ /dev/null @@ -1,22 +0,0 @@ -Thread 4 (Thread 0x7feabc3ea710 (LWP 23321)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#4 0x00007feac3c101ed in QString::operator==(QLatin1String const&) const () from /usr/lib/libQtCore.so.4 -#5 0x0000000000402e7b in qStringComparisonHelper (s1=..., s2=0x404957 "thread 4") at /usr/include/QtCore/qstring.h:908 -#6 0x0000000000402ea9 in QString::operator!= (this=0x21ef798, s=0x404957 "thread 4") at /usr/include/QtCore/qstring.h:913 -#7 0x00000000004023d0 in map_function (s=...) at /home/milian/projects/kde4/drkonqi/tests/crashtest/crashtest.cpp:78 -#8 0x00000000004040c4 in QtConcurrent::FunctionWrapper1::operator() (this=0x21ef6d8, u=...) at /usr/include/QtCore/qtconcurrentfunctionwrappers.h:86 -#9 0x0000000000403e0c in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIteration (this=0x21ef6a0, it=...) - at /usr/include/QtCore/qtconcurrentmapkernel.h:73 -#10 0x0000000000403e97 in QtConcurrent::MapKernel::iterator, QtConcurrent::FunctionWrapper1 >::runIterations (this=0x21ef6a0, sequenceBeginIterator=..., - beginIndex=2, endIndex=3) at /usr/include/QtCore/qtconcurrentmapkernel.h:82 -#11 0x000000000040433e in QtConcurrent::IterateKernel::iterator, void>::forThreadFunction (this=0x21ef6a0) at /usr/include/QtCore/qtconcurrentiteratekernel.h:266 -#12 0x0000000000404010 in QtConcurrent::IterateKernel::iterator, void>::threadFunction (this=0x21ef6a0) at /usr/include/QtCore/qtconcurrentiteratekernel.h:228 -#13 0x00007feac3bc2dc5 in QtConcurrent::ThreadEngineBase::run() () from /usr/lib/libQtCore.so.4 -#14 0x00007feac3bc4b05 in ?? () from /usr/lib/libQtCore.so.4 -#15 0x00007feac3bce485 in ?? () from /usr/lib/libQtCore.so.4 -#16 0x00007feac3946cb0 in start_thread () from /lib/libpthread.so.0 -#17 0x00007feac205e7ad in clone () from /lib/libc.so.6 -#18 0x0000000000000000 in ?? () diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions deleted file mode 100644 index a4fb43c8f..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions +++ /dev/null @@ -1,22 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0x00000000 in ?? () -#6 QBasicAtomicInt::operator!= (this=0xa6bf968, result=...) at /usr/include/qt4/QtCore/qbasicatomic.h:69 -#7 QList >::detach (this=0xa6bf968, result=...) at /usr/include/qt4/QtCore/qlist.h:119 -#8 QList >::append (this=0xa6bf968, result=...) at /usr/include/qt4/QtCore/qlist.h:424 -#9 QList >::operator<< (this=0xa6bf968, result=...) at /usr/include/qt4/QtCore/qlist.h:304 -#10 SqlQueryMaker::handleTracks (this=0xa6bf968, result=...) at /build/buildd/amarok-2.2.0/src/collection/sqlcollection/SqlQueryMaker.cpp:975 -#11 0xb443a084 in SqlQueryMaker::handleResult (this=0xa6bf968, result=...) at /build/buildd/amarok-2.2.0/src/collection/sqlcollection/SqlQueryMaker.cpp:671 -#12 0xb443c32b in SqlWorkerThread::run() () from /usr/lib/kde4/amarok_collection-mysqlecollection.so -#13 0x02b2137d in ThreadWeaver::JobRunHelper::runTheJob (this=0xb299a26c, th=0x9aeb9b8, job=0xa6c0e20) at ../../../threadweaver/Weaver/Job.cpp:106 -#14 0x02b216e1 in ThreadWeaver::Job::execute (this=0xa6c0e20, th=0x9aeb9b8) at ../../../threadweaver/Weaver/Job.cpp:135 -#15 0x02b2038a in ThreadWeaver::ThreadRunHelper::run (this=0xb299a2f4, parent=0x992bf40, th=0x9aeb9b8) at ../../../threadweaver/Weaver/Thread.cpp:95 -#16 0x02b209db in ThreadWeaver::Thread::run (this=0x9aeb9b8) at ../../../threadweaver/Weaver/Thread.cpp:142 -#17 0x089bfe32 in QThreadPrivate::start (arg=0x9aeb9b8) at thread/qthread_unix.cpp:188 -#18 0x06e2d80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 -#19 0x086be8de in clone () from /lib/tls/i686/cmov/libc.so.6 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions2 b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions2 deleted file mode 100644 index 45595c1af..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions2 +++ /dev/null @@ -1,23 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0x00000000 in ?? () -#6 0x0824add1 in QMap::node_create (this=0xbd74808,key=0x0) at /usr/include/qt4/QtCore/qmap.h:420 -#7 QMap::detach_helper (this=0xbd74808, key=0x0) at /usr/include/qt4/QtCore/qmap.h:708 -#8 QMap::detach (this=0xbd74808, key=0x0) at /usr/include/qt4/QtCore/qmap.h:172 -#9 QMap::remove (this=0xbd74808, key=0x0) at /usr/include/qt4/QtCore/qmap.h:609 -#10 Digikam::Album::removeExtraData (this=0xbd74808, key=0x0) at /build/buildd/digikam-1.0.0/digikam/album.cpp:215 -#11 0x0833cfb6 in ~TreeAlbumItem (this=0xc098ea0, __in_chrg=) at /build/buildd/digikam-1.0.0/digikam/treefolderitem.cpp:160 -#12 0x0833cff8 in ~TreeAlbumCheckListItem (this=0xc098ea0, __in_chrg=) at /build/buildd/digikam-1.0.0/digikam/treefolderitem.cpp:191 -#13 0x02ecff6c in ~QTreeWidgetItem (this=0xc098cd8, __in_chrg=) at itemviews/qtreewidget.cpp:1514 -#14 0x0833cff8 in ~TreeAlbumCheckListItem (this=0xc098cd8, __in_chrg=) at /build/buildd/digikam-1.0.0/digikam/treefolderitem.cpp:191 -#15 0x02ecff6c in ~QTreeWidgetItem (this=0xc098758, __in_chrg=) at itemviews/qtreewidget.cpp:1514 -#16 0x0833cff8 in ~TreeAlbumCheckListItem (this=0xc098758, __in_chrg=) at /build/buildd/digikam-1.0.0/digikam/treefolderitem.cpp:191 -#17 0x02ecff6c in ~QTreeWidgetItem (this=0xc0966e8, __in_chrg=) at itemviews/qtreewidget.cpp:1514 -#18 0x0833cff8 in ~TreeAlbumCheckListItem (this=0xc0966e8, __in_chrg=) at /build/buildd/digikam-1.0.0/digikam/treefolderitem.cpp:191 -#19 0x02ecff6c in ~QTreeWidgetItem (this=0xc08ec10, __in_chrg=) at itemviews/qtreewidget.cpp:1514 -#95 0x083bcb2b in main (argc=5, argv=0xbfede9b4) at /build/buildd/digikam-1.0.0/digikam/main.cpp:195 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions3 b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions3 deleted file mode 100644 index 76939ceb3..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions3 +++ /dev/null @@ -1,26 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#5 0x00007f57c1a6e4b5 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 -#6 0x00007f57c1a71f50 in *__GI_abort () at abort.c:92 -#7 0x00007f57c3de6e0d in qt_message_output (msgType=QtFatalMsg, buf=0x22c9138 "ASSERT: \"!(*watched)\" in file /home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp, line 997") at /home/w00t/kdesvn/qt-copy/src/corelib/global/qglobal.cpp:2248 -#8 0x00007f57c3de700f in qt_message (msgType=QtFatalMsg, msg=0x7f57c3fa9f90 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fff621502b0) at -/home/w00t/kdesvn/qt-copy/src/corelib/global/qglobal.cpp:2294 -#9 0x00007f57c3de787c in qFatal (msg=0x7f57c3fa9f90 "ASSERT: \"%s\" in file %s, line %d") at /home/w00t/kdesvn/qt-copy/src/corelib/global/qglobal.cpp:2477 -#10 0x00007f57c3de699f in qt_assert (assertion=0x7f57c3653b74 "!(*watched)", file=0x7f57c3653b40 "/home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp", line=997) at /home/w00t/kdesvn/qt-copy/src/corelib/global/qglobal.cpp:2011 -#11 0x00007f57c32fb473 in ExceptionGuard (this=0x7fff62150420, w=0x202e2c1) at /home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp:997 -#12 0x00007f57c32f07fa in QMenuPrivate::activateCausedStack (this=0x202e0b0, causedStack=..., action=0x202ec60, action_e=QAction::Hover, self=true) at /home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp:1006 -#13 0x00007f57c32f0d23 in QMenuPrivate::activateAction (this=0x202e0b0, action=0x202ec60, action_e=QAction::Hover, self=true) at /home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp:1103 -#14 0x00007f57c32eea8c in QMenuPrivate::setCurrentAction (this=0x202e0b0, action=0x202ec60, popup=96, reason=QMenuPrivate::SelectedFromElsewhere, activateFirst=false) at /home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp:571 -#15 0x00007f57c32f7c18 in QMenu::mouseMoveEvent (this=0x202e070, e=0x7fff62151190) at /home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp:2824 -#16 0x00007f57c2dc4c19 in QWidget::event (this=0x202e070, event=0x7fff62151190) at /home/w00t/kdesvn/qt-copy/src/gui/kernel/qwidget.cpp:7999 -#17 0x00007f57c32f5c12 in QMenu::event (this=0x202e070, e=0x7fff62151190) at /home/w00t/kdesvn/qt-copy/src/gui/widgets/qmenu.cpp:2428 -#18 0x00007f57bc81d605 in Oxygen::MenuBarDataV1::eventFilter (this=0x20ccc00, object=0x202e070, event=0x7fff62151190) at /home/w00t/kdesvn/kdebase/runtime/kstyles/oxygen/animations/oxygenmenubardata.cpp:83 -#19 0x00007f57c3f1f5db in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=0x1c95380, receiver=0x202e070, event=0x7fff62151190) at /home/w00t/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:819 -#20 0x00007f57c2d51785 in QApplicationPrivate::notify_helper (this=0x1c95380, receiver=0x202e070, e=0x7fff62151190) at /home/w00t/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:4296 -#21 0x00007f57c2d4f656 in QApplication::notify (this=0x7fff62157f70, receiver=0x202e070, e=0x7fff62151190) at /home/w00t/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:3865 -#22 0x00007f57c580e9f6 in KApplication::notify (this=0x7fff62157f70, receiver=0x202e070, event=0x7fff62151190) at /home/w00t/kdesvn/kdelibs/kdeui/kernel/kapplication.cpp:302 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions4 b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions4 deleted file mode 100644 index 91e808037..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions4 +++ /dev/null @@ -1,17 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0x00471f42 in qt_meta_stringdata_QAnimationGroup () from /usr/lib/libQtCore.so.4 -#7 0x0087f7fc in __dynamic_cast () from /usr/lib/libstdc++.so.6 -#8 0x0521ae26 in KarbonPart::addShape(KoShape*) () from /usr/lib/libkarbonui.so.6 -#9 0x0437c9b0 in KoShapeDeleteCommand::undo() () from /usr/lib/libflake.so.6 -#10 0x089e4a78 in QUndoCommand::undo (this=0xa70abb0) at util/qundostack.cpp:226 -#11 0x0437c562 in KoShapeCreateCommand::undo() () from /usr/lib/libflake.so.6 -#12 0x089e6147 in QUndoStack::undo (this=0x9e107d8) at util/qundostack.cpp:659 -#13 0x08a0d703 in QUndoStack::qt_metacall (this=0x9e107d8, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0xbfba6d28) at .moc/release-shared/moc_qundostack.cpp:105 -#14 0x011b5482 in KUndoStack::qt_metacall (this=0x9e107d8, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0xbfba6d28) at ./kundostack.moc:64 -#15 0x07398a52 in KoUndoStack::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkotext.so.6 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions5 b/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions5 deleted file mode 100644 index e3e03acb4..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_data/test_usefulfunctions5 +++ /dev/null @@ -1,25 +0,0 @@ -[Current thread is 0 (process 12545)] - -Thread 1 (Thread 0x7fddaac76740 (LWP 12545)): -#0 0x00007fdda985f5b5 in waitpid () from /lib/libpthread.so.0 -#1 0x00007fddaa7e660d in KCrash::startDirectly (argv=0x7fffb2db2800) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:436 -#2 0x00007fddaa7e7581 in KCrash::defaultCrashHandler (sig=11) at /home/gkiagia/kde/src/KDE/kdelibs/kdeui/util/kcrash.cpp:340 -#3 -#6 0xffffe424 in __kernel_vsyscall () -#7 0xb57400cf in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 -#8 0xb57419e7 in abort () at abort.c:88 -#9 0xb660f7f4 in qt_message_output (msgType=QtFatalMsg, buf=0x6
) at global/qglobal.cpp:2248 -#10 0xb660fa13 in qt_message (msgType=QtFatalMsg, msg=0xb678c85c "ASSERT: \"%s\" in file %s, line %d", ap=0xbfb81204 "\203\234\f\b\354\233\f\bw\001") at global/qglobal.cpp:2294 -#11 0xb660fb38 in qFatal (msg=0xb678c85c "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2477 -#12 0xb660fbb5 in qt_assert (assertion=0x80c9c83 "rowCount >= usedRowCnt", file=0x80c9bec "/local/svn/kde/trunk/KDE/kdebase/apps/dolphin/src/panels/information/kmetadatawidget.cpp", line=375) at global/qglobal.cpp:2011 -#13 0x08083a65 in KMetaDataWidget::Private::slotLoadingFinished (this=0x82f7a90) at /local/svn/kde/trunk/KDE/kdebase/apps/dolphin/src/panels/information/kmetadatawidget.cpp:375 -#14 0x08085757 in KMetaDataWidget::qt_metacall (this=0x8124650, _c=InvokeMetaMethod, _id=1, _a=0x839a290) at /local/build/KDE/kdebase/apps/dolphin/src/kmetadatawidget.moc:89 -#15 0xb6726efd in QMetaObject::metacall (object=0x8124650, cl=8929, idx=28, argv=0x839a290) at kernel/qmetaobject.cpp:237 -#16 0xb6731855 in QMetaCallEvent::placeMetaCall (this=0x8247550, object=0x8124650) at kernel/qobject.cpp:561 -#17 0xb67329ff in QObject::event (this=0x8124650, e=0x8247550) at kernel/qobject.cpp:1240 -#18 0xb5cb6330 in QWidget::event (this=0x8124650, event=0x8247550) at kernel/qwidget.cpp:8471 -#19 0x0808564e in KMetaDataWidget::event (this=0x8124650, event=0x8247550) at /local/svn/kde/trunk/KDE/kdebase/apps/dolphin/src/panels/information/kmetadatawidget.cpp:700 -#20 0xb5c5615c in QApplicationPrivate::notify_helper (this=0x811ab60, receiver=0x8124650, e=0x8247550) at kernel/qapplication.cpp:4300 -#21 0xb5c5d038 in QApplication::notify (this=0x8124650, receiver=0x8124650, e=0x8247550) at kernel/qapplication.cpp:4265 -#22 0xb6da6dd4 in KApplication::notify (this=0xbfb81d04, receiver=0x8124650, event=0x8247550) at /local/svn/kde/trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302 -#23 0xb6721b8e in QCoreApplication::notifyInternal (this=0xbfb81d04, receiver=0x8124650, event=0x8247550) at kernel/qcoreapplication.cpp:704 diff --git a/drkonqi/tests/backtraceparsertest/backtraceparsertest_manual.cpp b/drkonqi/tests/backtraceparsertest/backtraceparsertest_manual.cpp deleted file mode 100644 index e8ba07456..000000000 --- a/drkonqi/tests/backtraceparsertest/backtraceparsertest_manual.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2010 George Kiagiadakis - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "fakebacktracegenerator.h" -#include "../../parser/backtraceparser.h" -#include -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - KAboutData aboutData(QStringLiteral("backtraceparsertest_manual"), i18n("backtraceparsertest_manual"), QStringLiteral("1.0")); - KAboutData::setApplicationData(aboutData); - - QCommandLineParser parser; - parser.addOption(QCommandLineOption(QStringLiteral("debugger"), i18n("The debugger name passed to the parser factory"), QStringLiteral("name"), QStringLiteral("gdb"))); - parser.addPositionalArgument(QStringLiteral("file"), i18n("A file containing the backtrace."), QStringLiteral("[file]")); - aboutData.setupCommandLine(&parser); - parser.process(app); - aboutData.processCommandLine(&parser); - - QString debugger = parser.value(QStringLiteral("debugger")); - if(parser.positionalArguments().isEmpty()) { - parser.showHelp(1); - return 1; - } - QString file = parser.positionalArguments().first(); - - if (!QFile::exists(file)) { - QTextStream(stderr) << "The specified file does not exist" << endl; - return 1; - } - - FakeBacktraceGenerator generator; - QSharedPointer btparser(BacktraceParser::newParser(debugger)); - btparser->connectToGenerator(&generator); - generator.sendData(file); - - QMetaEnum metaUsefulness = BacktraceParser::staticMetaObject.enumerator( - BacktraceParser::staticMetaObject.indexOfEnumerator("Usefulness")); - QTextStream(stdout) << "Usefulness: " << metaUsefulness.valueToKey(btparser->backtraceUsefulness()) << endl; - QTextStream(stdout) << "First valid functions: " << btparser->firstValidFunctions().join(QStringLiteral(" ")) << endl; - QTextStream(stdout) << "Simplified backtrace:\n" << btparser->simplifiedBacktrace() << endl; - QStringList l = static_cast(btparser->librariesWithMissingDebugSymbols().toList()); - QTextStream(stdout) << "Missing dbgsym libs: " << l.join(QStringLiteral(" ")) << endl; - - return 0; -} diff --git a/drkonqi/tests/backtraceparsertest/fakebacktracegenerator.cpp b/drkonqi/tests/backtraceparsertest/fakebacktracegenerator.cpp deleted file mode 100644 index e9d5b006a..000000000 --- a/drkonqi/tests/backtraceparsertest/fakebacktracegenerator.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "fakebacktracegenerator.h" -#include -#include - -void FakeBacktraceGenerator::sendData(const QString & filename) -{ - QFile file(filename); - file.open(QIODevice::ReadOnly | QIODevice::Text); - QTextStream stream(&file); - - emit starting(); - while (!stream.atEnd()) { - emit newLine(stream.readLine() + '\n'); - } - emit newLine(QString()); -} - - diff --git a/drkonqi/tests/backtraceparsertest/fakebacktracegenerator.h b/drkonqi/tests/backtraceparsertest/fakebacktracegenerator.h deleted file mode 100644 index c311cb9ed..000000000 --- a/drkonqi/tests/backtraceparsertest/fakebacktracegenerator.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef FAKEBACKTRACEGENERATOR_H -#define FAKEBACKTRACEGENERATOR_H - -#include - -class FakeBacktraceGenerator : public QObject -{ - Q_OBJECT -public: - FakeBacktraceGenerator(QObject *parent = 0) : QObject(parent) {} - void sendData(const QString & filename); - -Q_SIGNALS: - void starting(); - void newLine(const QString & line); -}; - -#endif // FAKEBACKTRACEGENERATOR_H diff --git a/drkonqi/tests/bugzillalibtest/CMakeLists.txt b/drkonqi/tests/bugzillalibtest/CMakeLists.txt deleted file mode 100644 index 484588df1..000000000 --- a/drkonqi/tests/bugzillalibtest/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1410) - -set(bugzillalibtest_SRCS - bugzillalibtest.cpp - ../../bugzillaintegration/bugzillalib.cpp -) - -add_executable(bugzillalibtest ${bugzillalibtest_SRCS}) -ecm_mark_as_test(bugzillalibtest) - -target_link_libraries(bugzillalibtest KF5::KIOWidgets KF5::XmlRpcClient Qt5::Xml KF5::I18n) - diff --git a/drkonqi/tests/bugzillalibtest/bugzillalibtest.cpp b/drkonqi/tests/bugzillalibtest/bugzillalibtest.cpp deleted file mode 100644 index 833c62f0c..000000000 --- a/drkonqi/tests/bugzillalibtest/bugzillalibtest.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************* -* bugzillalibtest.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program 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 General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -******************************************************************/ -#include -#include -#include -#include -#include - -#include "../../bugzillaintegration/bugzillalib.h" -#include "../../debugpackageinstaller.h" - -class BugzillaLibTest : public QObject -{ - Q_OBJECT - public: - BugzillaLibTest(QString user, QString password) : QObject() - { - manager = new BugzillaManager(QStringLiteral("http://bugstest.kde.org/")); - connect(manager, &BugzillaManager::loginFinished, this, &BugzillaLibTest::loginFinished); - connect(manager, &BugzillaManager::loginError, this, &BugzillaLibTest::loginError); - connect(manager, &BugzillaManager::reportSent, this, &BugzillaLibTest::reportSent); - connect(manager, &BugzillaManager::sendReportError, this, &BugzillaLibTest::sendReportError); - connect(manager, &BugzillaManager::sendReportErrorInvalidValues, this, &BugzillaLibTest::sendBR2); - manager->tryLogin(user, password); - qDebug() << "Login ..."; - } - - private Q_SLOTS: - void loginFinished(bool ok) - { - qDebug() << "Login Finished" << ok; - if (!ok) { - return; - } - - //Uncomment to Test - //FIXME provide a way to select the test from the command line - - //Send a new bug report - /* - sendBR(); - */ - - //Attach a simple text to a report as a file - /* - manager->attachTextToReport("Bugzilla Lib Attachment Content Test", "/tmp/var", - "Bugzilla Lib Attachment Description Test", 150000); - */ - - /* - manager->addMeToCC(100005); - */ - } - - void loginError(const QString & msg) - { - qDebug() << "Login Error" << msg; - } - - void sendBR() - { - BugReport br; - br.setValid(true); - br.setProduct(QStringLiteral("konqueror")); - br.setComponent(QStringLiteral("general")); - br.setVersion(QStringLiteral("undefined")); - br.setOperatingSystem(QStringLiteral("Linux")); - br.setPriority(QStringLiteral("NOR")); - br.setPlatform(QStringLiteral("random test")); - br.setBugSeverity(QStringLiteral("crash")); - br.setShortDescription(QStringLiteral("bla bla")); - br.setDescription(QStringLiteral("bla bla large")); - - manager->sendReport(br); - qDebug() << "Trying to send bug report"; - } - - void sendBR2() - { - BugReport br; - br.setValid(true); - br.setProduct(QStringLiteral("konqueror")); - br.setComponent(QStringLiteral("general")); - br.setVersion(QStringLiteral("undefined")); - br.setOperatingSystem(QStringLiteral("Linux")); - br.setPriority(QStringLiteral("NOR")); - br.setPlatform(QStringLiteral("unspecified")); - br.setBugSeverity(QStringLiteral("crash")); - br.setShortDescription(QStringLiteral("bla bla")); - br.setDescription(QStringLiteral("bla bla large")); - - manager->sendReport(br); - qDebug() << "Trying to send bug report"; - } - - void reportSent( int num) - { - qDebug() << "BR sent " << num << manager->urlForBug(num); - } - - void sendReportError(const QString & msg) - { - qDebug() << "Error sending bug report" << msg; - } - - private: - BugzillaManager * manager; - -}; - -int main (int argc, char ** argv) -{ - QApplication app(argc, argv); - KAboutData aboutData( QStringLiteral("bzlibtest"), i18n("BugzillaLib Test (DrKonqi2)"), - QStringLiteral("1.0"), i18n("Test application for bugtracker manager lib"), KAboutLicense::GPL, - i18n("(c) 2009, DrKonqi2 Developers")); - - QCommandLineParser parser; - parser.addOption(QCommandLineOption(QStringLiteral("user"), i18nc("@info:shell","bugstest.kde.org username"), QStringLiteral("username"))); - parser.addOption(QCommandLineOption(QStringLiteral("pass"), i18nc("@info:shell","bugstest.kde.org password"), QStringLiteral("password"))); - - aboutData.setupCommandLine(&parser); - parser.process(app); - aboutData.processCommandLine(&parser); - - if (!parser.isSet(QStringLiteral("user")) || !parser.isSet(QStringLiteral("pass"))) { - qDebug() << "Provide bugstest.kde.org username and password. See help"; - return 0; - } - - new BugzillaLibTest(parser.value(QStringLiteral("user")), parser.value(QStringLiteral("pass"))); - return app.exec(); -} - -#include "bugzillalibtest.moc" diff --git a/drkonqi/tests/crashtest/CMakeLists.txt b/drkonqi/tests/crashtest/CMakeLists.txt deleted file mode 100644 index 9e10498a6..000000000 --- a/drkonqi/tests/crashtest/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_executable(crashtest crashtest.cpp) -ecm_mark_as_test(crashtest) - -target_link_libraries(crashtest - KF5::I18n KF5::Crash KF5::CoreAddons Qt5::Widgets - Qt5::Concurrent) - diff --git a/drkonqi/tests/crashtest/crashtest.cpp b/drkonqi/tests/crashtest/crashtest.cpp deleted file mode 100644 index eea8a0e0a..000000000 --- a/drkonqi/tests/crashtest/crashtest.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/***************************************************************** - * drkonqi - The KDE Crash Handler - * - * Copyright (C) 2000-2002 David Faure - * Copyright (C) 2000-2002 Waldo Bastian - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************/ - -// Let's crash. -#include -#include -#include -#include -#include -#include -#include -#include - -enum CrashType { Crash, Malloc, Div0, Assert, QAssert, Threads }; - -struct SomeStruct -{ - int foo() { return ret; } - int ret; -}; - -void do_crash() -{ - SomeStruct *obj = 0; - int ret = obj->foo(); - printf("result = %d\n", ret); -} - -void do_malloc() -{ - delete (char*)0xdead; -} - -void do_div0() -{ - volatile int a = 99; - volatile int b = 10; - volatile int c = a / ( b - 10 ); - printf("result = %d\n", c); -} - -void do_assert() -{ - assert(false); -} - -void do_qassert() -{ - Q_ASSERT(false); -} - -void map_function(const QString & s) -{ - while ( s != QLatin1String("thread 4") ) {} - do_crash(); -} - -void do_threads() -{ - QStringList foo; - foo << QStringLiteral("thread 1") << QStringLiteral("thread 2") << QStringLiteral("thread 3") << QStringLiteral("thread 4") << QStringLiteral("thread 5"); - QThreadPool::globalInstance()->setMaxThreadCount(5); - QtConcurrent::blockingMap(foo, map_function); -} - -void level4(int t) -{ - if (t == Malloc) - do_malloc(); - else if (t == Div0) - do_div0(); - else if (t == Assert) - do_assert(); - else if (t == QAssert) - do_qassert(); - else if (t == Threads) - do_threads(); - else - do_crash(); -} - -void level3(int t) -{ - level4(t); -} - -void level2(int t) -{ - level3(t); -} - -void level1(int t) -{ - level2(t); -} - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - KAboutData aboutData(QStringLiteral("crashtext"), i18n("Crash Test for DrKonqi"), - QStringLiteral("1.1"), - i18n("Crash Test for DrKonqi"), - KAboutLicense::GPL, - i18n("(c) 2000-2002 David Faure, Waldo Bastian")); - - QCommandLineParser parser; - parser.addOption(QCommandLineOption(QStringLiteral("autorestart"), i18n("Automatically restart"))); - parser.addPositionalArgument(QStringLiteral("type"), i18n("Type of crash."), QStringLiteral("crash|malloc|div0|assert|threads")); - aboutData.setupCommandLine(&parser); - parser.process(app); - aboutData.processCommandLine(&parser); - - //start drkonqi directly so that drkonqi's output goes to the console - KCrash::CrashFlags flags = KCrash::AlwaysDirectly; - if (parser.isSet(QStringLiteral("autorestart"))) - flags |= KCrash::AutoRestart; - KCrash::setFlags(flags); - - QByteArray type = parser.positionalArguments().isEmpty() ? QByteArray() : parser.positionalArguments().first().toUtf8(); - int crashtype = Crash; - if (type == "malloc") - crashtype = Malloc; - else if (type == "div0") - crashtype = Div0; - else if (type == "assert") - crashtype = Assert; - else if (type == "qassert") - crashtype = QAssert; - else if (type == "threads") - crashtype = Threads; - level1(crashtype); - return app.exec(); -} diff --git a/drkonqi/tests/integration/CMakeLists.txt b/drkonqi/tests/integration/CMakeLists.txt deleted file mode 100644 index 9114b91db..000000000 --- a/drkonqi/tests/integration/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -add_test(NAME drkonqi_integration_suite - COMMAND ${RUBY_EXECTUABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/suite - --drkonqi $ - --at-spi-bus-launcher ${ATSPI_BUS_LAUNCHER_EXECUTABLE} - --at-spi-registryd ${ATSPI_REGISTRYD_EXECUTABLE}) -set_tests_properties(drkonqi_integration_suite PROPERTIES TIMEOUT 150) - -# Hack to get rb files to show in qtc. -file(GLOB RUBIES suite *.rb) -add_custom_target(Rubies ALL echo SOURCES ${RUBIES}) diff --git a/drkonqi/tests/integration/duplicate_attach_test.rb b/drkonqi/tests/integration/duplicate_attach_test.rb deleted file mode 100644 index daaff237a..000000000 --- a/drkonqi/tests/integration/duplicate_attach_test.rb +++ /dev/null @@ -1,228 +0,0 @@ -# Copyright (C) 2017 Harald Sitter -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License or (at your option) version 3 or any later version -# accepted by the membership of KDE e.V. (or its successor approved -# by the membership of KDE e.V.), which shall act as a proxy -# defined in Section 14 of version 3 of the license. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -require_relative 'test_helper' - -require 'xmlrpc/client' -require 'xmlrpc/server' - -# Monkey patch the xmlrpc server to let us handle regular GET requests. -# Drkonqi partially goes through regular bugzilla cgi's simply requesting xml -# output. -module XMLServerInterceptor - # raw xml data is here - # def process(*args) - # warn "+++ #{__method__} +++" - # p args - # warn "--- #{__method__} ---" - # super - # end - - def service(req, resp) - # Where webrick comes in with request, server rejects non-xmlrpc requests - # so we'll manually handle GET requests as necessary and forward to an - # actual bugzilla so we don't have to reimplement everything. - warn "+++ #{__method__} +++" - if req.request_method == 'GET' - if req.request_uri.path.include?('buglist.cgi') # Returns CSV. - resp.body = <<-EOF -bug_id,"bug_severity","priority","bug_status","product","short_desc","resolution" -375161,"crash","NOR","NEEDSINFO","dolphin","Dolphin crash, copy from Samba share","BACKTRACE" - EOF - return - end - - if req.request_uri.path.include?('show_bug.cgi') - uri = req.request_uri.dup - uri.host = 'bugstest.kde.org' - uri.scheme = 'https' - uri.port = nil - resp.set_redirect(WEBrick::HTTPStatus::TemporaryRedirect, uri.to_s) - return - end - end - warn "--- #{__method__} ---" - super - end -end - -class XMLRPC::Server - prepend XMLServerInterceptor - - # Expose webrick server so we can get our port :| - # https://github.com/ruby/xmlrpc/issues/17 - attr_accessor :server -end - -class TestDuplicateAttach < ATSPITest - def setup - server = XMLRPC::Server.new(0) - port = server.server.config.fetch(:Port) - ENV['DRKONQI_KDE_BUGZILLA_URL'] = "http://localhost:#{port}/" - - @got_comment = false - - server.set_default_handler do |name, args| - puts '+++ handler +++' - p name, args - if name == 'User.login' - next {"id"=>12345, "token"=>"12345-cJ5o717AbC"} - end - if name == 'Bug.update' - id = args.fetch('ids').fetch(0) - cc_to_add = args.fetch('cc').fetch('add') - next {"bugs"=>[{"last_change_time"=>DateTime.now, "id"=>id, "changes"=>{"cc"=>{"removed"=>"", "added"=>cc_to_add}}, "alias"=>[]}]} - end - if name == 'Bug.add_attachment' - # Check for garbage string from test - @got_comment = args.fetch('comment').include?('yyyyyyyyyyyyyyyy') - next { "ids" => [1234] } - end - puts '~~~ bugzilla ~~~' - # Pipe request through bugstest. - # The arguments are killing me. - client = XMLRPC::Client.new('bugstest.kde.org', '/xmlrpc.cgi', 443, - nil, nil, nil, nil, true) - bugzilla = client.call(name, *args) - p bugzilla - next bugzilla - end - - @xml_server_thread = Thread.start { server.serve } - - @tracee = fork { loop { sleep(999_999_999) } } - - assert File.exist?(DRKONQI_PATH), "drkonqi not at #{DRKONQI_PATH}" - @drkonqi_pid = spawn(DRKONQI_PATH, - '--signal', '11', - '--pid', @tracee.to_s, - '--bugaddress', 'submit@bugs.kde.org', - '--dialog') - puts "pid: #{@drkonqi_pid}" - end - - def teardown - Process.kill('KILL', @tracee) - Process.waitpid2(@tracee) - @xml_server_thread.kill - @xml_server_thread.join - end - - def drkonqi_running? - Process.waitpid(@drkonqi_pid, Process::WNOHANG).nil? - end - - # When evaluating duplicates - def test_duplicate_attach - drkonqi = nil - - 8.times do # be gracious for drkonqi to come up an atspi - drkonqi = ATSPI.applications.find { |x| x.name == 'drkonqi' } - break if drkonqi - sleep 2 - end - - refute_nil drkonqi, 'Could not find drkonqi on atspi api.' \ - " It is running: #{drkonqi_running?}" - - accessible = find_in(drkonqi.windows[-1], name: 'Report Bug') - press(accessible) - - find_in(drkonqi, name: 'Crash Reporting Assistant') do |window| - accessible = find_in(window, name: 'Next') - press(accessible) - - accessible = find_in(window, name: 'Yes') - toggle_on(accessible) - - accessible = find_in(window, name: /^What I was doing when the application.+/) - toggle_on(accessible) - - accessible = find_in(window, name: 'Next') - press(accessible) - - loop do - # Drkonqi is now doing the trace, wait until it is done. - accessible = find_in(window, name: 'Next') - refute_nil accessible - if accessible.states.include?(:sensitive) - press(accessible) - break - end - warn accessible.states - sleep 2 - end - - # Set pseudo login data if there are none. - accessible = find_in(window, name: 'Username input') - accessible.text.set_to 'xxx' if accessible.text.length <= 0 - accessible = find_in(window, name: 'Password input') - accessible.text.set_to 'yyy' if accessible.text.length <= 0 - - accessible = find_in(window, name: 'Login') - press(accessible) - - sleep 2 # Wait for login and bug listing - - accessible = find_in(window, name: '375161') - toggle_on(accessible) - - accessible = find_in(window, name: 'Open selected report') - press(accessible) - end - - find_in(drkonqi, name: 'Bug Description') do |window| - accessible = find_in(window, name: 'Suggest this crash is related') - press(accessible) - end - - find_in(drkonqi, name: 'Related Bug Report') do |window| - accessible = find_in(window, name: /^Completely sure: attach my information.+/) - toggle_on(accessible) - - accessible = find_in(window, name: 'Continue') - press(accessible) - end - - find_in(drkonqi, name: 'Crash Reporting Assistant') do |window| - accessible = find_in(window, name: /^The report is going to be attached.+/) - refute_nil accessible - - accessible = find_in(window, name: 'Next') - press(accessible) - - accessible = find_in(window, name: 'Information about the crash text') - accessible.text.set_to(accessible.text.to_s + - Array.new(128).collect { 'y' }.join) - - accessible = find_in(window, name: 'Next') - press(accessible) - - accessible = find_in(window, name: 'Next') - press(accessible) - - accessible = find_in(window, name: /.*Crash report sent.*/) - refute_nil accessible - - accessible = find_in(window, name: 'Finish') - press(accessible) - end - - assert @got_comment # only true iff the server go tour yyyyyy garbage string - end -end diff --git a/drkonqi/tests/integration/suite b/drkonqi/tests/integration/suite deleted file mode 100755 index 4995165bb..000000000 --- a/drkonqi/tests/integration/suite +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env ruby -# -# Copyright (C) 2017 Harald Sitter -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License or (at your option) version 3 or any later version -# accepted by the membership of KDE e.V. (or its successor approved -# by the membership of KDE e.V.), which shall act as a proxy -# defined in Section 14 of version 3 of the license. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -require 'fileutils' -require 'optparse' -require 'tmpdir' - -STDOUT.sync = true # force immediate flushing without internal caching - -class Isolator - def mangle_env(tmpdir) - ENV['HOME'] = tmpdir - ENV.keys.each { |k| ENV.delete(k) if k.start_with?('XDG_') } - end - - private - - def dbus_run(cmd) - warn dbus_run_cmd(cmd) - system(dbus_run_cmd(cmd)) - end - - def dbus_run_cmd(cmd) - "dbus-run-session -- #{cmd}" - end -end - -# Isolates GUI via xephyr -class XephyrIsolator < Isolator - def run(cmd) - ephemeral('Xephyr -screen 1024x768x24+32 :666') do - ENV['DISPLAY'] = ':666' - dbus_run(cmd) || raise - end - end - - private - - def ephemeral(*args) - pid = spawn(*args) - yield - ensure - Process.kill('KILL', pid) if pid - Process.waitpid2(pid) if pid - end -end - -# Isolates GUI via xvfb-run -class XvfbIsolator < Isolator - def run(cmd) - warn "xvfb-run -a --server-args=\"-screen 0 1024x768x24\" #{dbus_run_cmd(cmd)}" - system("xvfb-run -a --server-args=\"-screen 0 1024x768x24\" #{dbus_run_cmd(cmd)}") || raise - end -end - -class NoIsolator < Isolator - def mangle_env(*) - # noop without isolation - end - - def run(cmd) - # No X11 and no DBus isolation. - warn cmd.to_s - system(cmd) || raise - end -end - -def new_isolator - return NoIsolator.new if ENV['JENKINS_SERVER_COOKIE'] || ENV['NO_ISOLATOR'] - return XephyrIsolator.new if ENV['XEPHYR'] - XvfbIsolator.new -end - -OptionParser.new do |opts| - opts.banner = "Usage: #{$0} ARGS" - - opts.separator('') - - opts.on('--drkonqi PATH', 'Path to drkonqi bin to test.') do |v| - ENV['DRKONQI_PATH'] = v - end - - opts.on('--at-spi-bus-launcher PATH', - 'Path to --at-spi-bus-launcher bin to use for testing.') do |v| - ENV['AT_SPI_BUS_LAUNCHER_PATH'] = v - end - - opts.on('--at-spi-registryd PATH', - 'Path to registry bin to use for testing.') do |v| - ENV['AT_SPI_REGISTRY_PATH'] = v - end -end.parse! - -ENV['DRKONQI_PATH'] ||= '/usr/lib/x86_64-linux-gnu/libexec/drkonqi' -ENV['AT_SPI_BUS_LAUNCHER_PATH'] ||= '/usr/lib/at-spi2-core/at-spi-bus-launcher' -ENV['AT_SPI_REGISTRY_PATH'] ||= '/usr/lib/at-spi2-core/at-spi2-registryd' -ENV['KDE_FORK_SLAVES'] = '1' # fork slaves so they inherit env -ENV['KIO_DISABLE_CACHE_CLEANER'] = '1' # do not start the cleaner, it'll dangle -ENV['DRKONQI_IGNORE_QUALITY'] = '1' - -# Isolate ourselves by forcing into a separate home and unsetting the XDG path -# variables. Then spin up a suitable virtual X, run a new dbus session bus -# and our test in that environment. -Dir.mktmpdir do |tmpdir| - Dir.glob("#{__dir__}/*_test.rb").each do |test| - isolator = new_isolator - isolator.mangle_env(tmpdir) - isolator.run("ruby '#{test}' -p") - end - sleep 2 # Wait a bit to make sure all children are dead. -end - -warn 'all done' -system 'ps -ejH' -exit 0 diff --git a/drkonqi/tests/integration/test_helper.rb b/drkonqi/tests/integration/test_helper.rb deleted file mode 100644 index 266befcd0..000000000 --- a/drkonqi/tests/integration/test_helper.rb +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (C) 2017 Harald Sitter -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License or (at your option) version 3 or any later version -# accepted by the membership of KDE e.V. (or its successor approved -# by the membership of KDE e.V.), which shall act as a proxy -# defined in Section 14 of version 3 of the license. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -STDOUT.sync = true # force immediate flushing without internal caching - -DRKONQI_PATH = ENV['DRKONQI_PATH'] -AT_SPI_BUS_LAUNCHER_PATH = ENV['AT_SPI_BUS_LAUNCHER_PATH'] -AT_SPI_REGISTRY_PATH = ENV['AT_SPI_REGISTRY_PATH'] -warn "Testing against #{DRKONQI_PATH} with #{AT_SPI_BUS_LAUNCHER_PATH} " \ - " and #{AT_SPI_REGISTRY_PATH}" - -# Only set inside the test to prevent dbus activation of supporting services. -# We'll force a11y here as depending on the distribution a11y may not be enabled -# by default. -ENV['QT_ACCESSIBILITY'] = '1' -ENV['QT_LINUX_ACCESSIBILITY_ALWAYS_ON'] = '1' - -# We kill these after our test run. When isolated they would die with our -# bus, on CI systems we employ no isolation and instead need to manage them -# manually. -# NB: do not give additional options to the launcher. Ubuntu broke theirs -# causing crashes... -launcher_pid = spawn(AT_SPI_BUS_LAUNCHER_PATH, '--launch-immediately') -registry_pid = spawn(AT_SPI_REGISTRY_PATH) - -require 'atspi' -require 'minitest/autorun' - -# Adds convenience methods for ATSPI on top of minitest. -class ATSPITest < Minitest::Test - def find_in(parent, name: nil, recursion: false) - raise 'no accessible' if parent.nil? - accessibles = parent.children.collect do |child| - ret = [] - if child.children.size != 0 # recurse - ret += find_in(child, name: name, recursion: true) - end - if name && child.states.include?(:showing) - if (name.is_a?(Regexp) && child.name.match(name)) || - (name.is_a?(String) && child.name == name) - ret << child - end - end - ret - end.compact.uniq.flatten - return accessibles if recursion - raise "not exactly one accessible for #{name} => #{accessibles.collect {|x| x.name}.join(', ')}" if accessibles.size > 1 - raise "cannot find accessible(#{name})" if accessibles.size < 1 - yield accessibles[0] if block_given? - accessibles[0] - end - - def press(accessible) - raise 'no accessible' if accessible.nil? - action = accessible.actions.find { |x| x.name == 'Press' } - refute_nil action, 'expected accessible to be pressable' - action.do_it! - sleep 0.25 - end - - def focus(accessible) - raise 'no accessible' if accessible.nil? - action = accessible.actions.find { |x| x.name == 'SetFocus' } - refute_nil action, 'expected accessible to be focusable' - action.do_it! - sleep 0.1 - end - - def toggle(accessible) - raise 'no accessible' if accessible.nil? - action = accessible.actions.find { |x| x.name == 'Toggle' } - refute_nil action, 'expected accessible to be toggle' - action.do_it! - sleep 0.1 - end - - def toggle_on(accessible) - raise 'no accessible' if accessible.nil? - return if accessible.states.any? { |x| %i[checked selected].include?(x) } - toggle(accessible) - end -end - -Minitest.after_run do - Process.kill('KILL', launcher_pid) - Process.kill('KILL', registry_pid) -end diff --git a/drkonqi/ui/backtracewidget.ui b/drkonqi/ui/backtracewidget.ui deleted file mode 100644 index b92a04f5a..000000000 --- a/drkonqi/ui/backtracewidget.ui +++ /dev/null @@ -1,170 +0,0 @@ - - - Form - - - - 0 - 0 - 511 - 476 - - - - GetBacktraceWidget - - - - - - - - - - - - - 1 - - - - - 0 - - - 0 - - - - - - - - - - 4 - - - - - 10 - - - - - - 0 - 0 - - - - - 48 - 48 - - - - true - - - - - - - true - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Show backtrace content (advanced) - - - - - - - - - - - false - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - Qt::RichText - - - true - - - false - - - - - - - - - - - - StatusWidget - QWidget -
statuswidget.h
- 1 -
-
- - -
diff --git a/drkonqi/ui/maindialog.ui b/drkonqi/ui/maindialog.ui deleted file mode 100644 index 56ed2d334..000000000 --- a/drkonqi/ui/maindialog.ui +++ /dev/null @@ -1,98 +0,0 @@ - - - MainWidget - - - - 0 - 0 - 404 - 289 - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - - - - - - true - - - - - - - - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - true - - - - - - - - - - true - - - Qt::TextBrowserInteraction - - - - - - - -