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("
").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("
").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("
").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("
").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 closedBug %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)",
- "