aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt223
-rw-r--r--MultiMC.cpp4
-rw-r--r--depends/groupview/src/categorizedview.cpp29
-rw-r--r--depends/groupview/src/categorizedview_p.h17
-rw-r--r--depends/groupview/src/categorydrawer.cpp2
-rw-r--r--depends/pack200/src/bands.cpp2
-rw-r--r--depends/pack200/src/bytes.h2
-rw-r--r--depends/pack200/src/coding.cpp1
-rw-r--r--depends/pack200/src/unpack.cpp17
-rw-r--r--depends/pack200/src/unpack200.cpp2
-rw-r--r--depends/quazip/unzip.c2
-rw-r--r--depends/quazip/zip.c2
-rw-r--r--depends/settings/include/keyring.h5
-rw-r--r--depends/settings/src/stubkeyring.h5
-rw-r--r--gui/ConsoleWindow.cpp21
-rw-r--r--gui/ConsoleWindow.h21
-rw-r--r--gui/MainWindow.cpp58
-rw-r--r--gui/dialogs/AccountListDialog.cpp17
-rw-r--r--gui/dialogs/AccountListDialog.h6
-rw-r--r--gui/dialogs/AccountSelectDialog.cpp8
-rw-r--r--gui/dialogs/AccountSelectDialog.h10
-rw-r--r--gui/dialogs/CopyInstanceDialog.cpp2
-rw-r--r--gui/dialogs/EditAccountDialog.cpp10
-rw-r--r--gui/dialogs/EditAccountDialog.h11
-rw-r--r--gui/dialogs/EditNotesDialog.cpp4
-rw-r--r--gui/dialogs/InstanceSettings.cpp2
-rw-r--r--gui/dialogs/LegacyModEditDialog.cpp2
-rw-r--r--gui/dialogs/OneSixModEditDialog.cpp2
-rw-r--r--gui/widgets/InstanceDelegate.cpp176
-rw-r--r--logic/BaseInstance.cpp2
-rw-r--r--logic/InstanceFactory.cpp12
-rw-r--r--logic/JavaChecker.cpp2
-rw-r--r--logic/JavaChecker.h2
-rw-r--r--logic/LegacyInstance.cpp1
-rw-r--r--logic/MinecraftProcess.cpp30
-rw-r--r--logic/MinecraftProcess.h14
-rw-r--r--logic/ModList.cpp10
-rw-r--r--logic/OneSixInstance.cpp1
-rw-r--r--logic/OneSixUpdate.cpp1
-rw-r--r--logic/auth/MojangAccount.cpp36
-rw-r--r--logic/auth/MojangAccount.h55
-rw-r--r--logic/auth/YggdrasilTask.cpp23
-rw-r--r--logic/auth/YggdrasilTask.h22
-rw-r--r--logic/auth/flows/AuthenticateTask.cpp (renamed from logic/auth/AuthenticateTask.cpp)88
-rw-r--r--logic/auth/flows/AuthenticateTask.h (renamed from logic/auth/AuthenticateTask.h)12
-rw-r--r--logic/auth/flows/InvalidateTask.cpp0
-rw-r--r--logic/auth/flows/InvalidateTask.h0
-rw-r--r--logic/auth/flows/RefreshTask.cpp156
-rw-r--r--logic/auth/flows/RefreshTask.h43
-rw-r--r--logic/auth/flows/ValidateTask.cpp (renamed from logic/auth/ValidateTask.cpp)8
-rw-r--r--logic/auth/flows/ValidateTask.h (renamed from logic/auth/ValidateTask.h)9
-rw-r--r--logic/lists/InstanceList.cpp22
-rw-r--r--logic/lists/InstanceList.h6
-rw-r--r--logic/lists/MojangAccountList.cpp33
-rw-r--r--logic/lists/MojangAccountList.h30
-rw-r--r--test.cpp60
56 files changed, 778 insertions, 563 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3cacbe2..79a69225 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,14 +27,14 @@ ENDIF()
######## Set compiler flags ########
IF(APPLE)
message(STATUS "Using APPLE CMAKE_CXX_FLAGS")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
ELSEIF(UNIX)
# assume GCC, add C++0x/C++11 stuff
MESSAGE(STATUS "Using UNIX CMAKE_CXX_FLAGS")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
ELSEIF(MINGW)
MESSAGE(STATUS "Using MINGW CMAKE_CXX_FLAGS")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall")
ENDIF()
################################ INCLUDE LIBRARIES ################################
@@ -48,6 +48,23 @@ find_package(Qt5LinguistTools REQUIRED)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
+# The Qt5 cmake files don't provide its install paths, so ask qmake.
+get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
+function(QUERY_QMAKE VAR RESULT)
+ exec_program(${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
+ if(NOT return_code)
+ file(TO_CMAKE_PATH "${output}" output)
+ set(${RESULT} ${output} PARENT_SCOPE)
+ endif(NOT return_code)
+endfunction(QUERY_QMAKE)
+
+query_qmake(QT_INSTALL_PLUGINS QT_PLUGINS_DIR)
+query_qmake(QT_INSTALL_IMPORTS QT_IMPORTS_DIR)
+query_qmake(QT_INSTALL_LIBS QT_LIBS_DIR)
+query_qmake(QT_HOST_DATA QT_DATA_DIR)
+set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs)
+
+
######## Included Libs ########
# Add quazip
@@ -289,11 +306,14 @@ logic/auth/MojangAccount.h
logic/auth/MojangAccount.cpp
logic/auth/YggdrasilTask.h
logic/auth/YggdrasilTask.cpp
-logic/auth/AuthenticateTask.h
-logic/auth/AuthenticateTask.cpp
-logic/auth/ValidateTask.h
-logic/auth/ValidateTask.cpp
-
+logic/auth/flows/AuthenticateTask.h
+logic/auth/flows/AuthenticateTask.cpp
+logic/auth/flows/RefreshTask.cpp
+logic/auth/flows/RefreshTask.cpp
+logic/auth/flows/ValidateTask.h
+logic/auth/flows/ValidateTask.cpp
+logic/auth/flows/InvalidateTask.h
+logic/auth/flows/InvalidateTask.cpp
# legacy instances
logic/LegacyInstance.h
@@ -439,7 +459,6 @@ CONFIGURE_FILE(generated.qrc.in generated.qrc)
QT5_ADD_RESOURCES(GENERATED_QRC ${CMAKE_CURRENT_BINARY_DIR}/generated.qrc)
QT5_ADD_RESOURCES(GRAPHICS_QRC graphics.qrc)
-
# Add executable
ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32
${MULTIMC_SOURCES} ${MULTIMC_UI} ${GRAPHICS_QRC} ${GENERATED_QRC} ${MULTIMC_RCS})
@@ -449,110 +468,122 @@ TARGET_LINK_LIBRARIES(MultiMC xz-embedded unpack200 quazip libUtil libSettings l
QT5_USE_MODULES(MultiMC Core Widgets Network Xml ${MultiMC_QT_ADDITIONAL_MODULES})
ADD_DEPENDENCIES(MultiMC MultiMCLauncher JavaCheck)
-option(BUILD_KEYRING_TEST "Build the simple keyring test binary" OFF)
-IF(BUILD_KEYRING_TEST)
- # test.cpp
- ADD_EXECUTABLE(Test test.cpp)
- QT5_USE_MODULES(Test Core)
- TARGET_LINK_LIBRARIES(Test libUtil libSettings)
-ENDIF()
-
################################ INSTALLATION AND PACKAGING ################################
-# use QtCreator's QTDIR var
-IF(DEFINED ENV{QTDIR})
- SET(Qt5_DIR $ENV{QTDIR})
-ENDIF()
-######## Plugin and library folders ########
-
-SET(PLUGIN_DEST_DIR plugins)
-SET(QTCONF_DEST_DIR .)
-SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC")
-
-IF(WIN32)
- SET(PLUGIN_DEST_DIR .)
- SET(QTCONF_DEST_DIR .)
- SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe")
-ENDIF()
+######## Packaging/install paths setup ########
-IF(UNIX)
-IF(APPLE)
+IF(UNIX AND APPLE)
SET(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS)
SET(QTCONF_DEST_DIR MultiMC.app/Contents/Resources)
- SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app")
-ELSE()
- SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC")
-ENDIF()
-ENDIF()
-
-SET(QT_PLUGINS_DIR ${Qt5_DIR}/plugins)
-SET(QT_LIBRARY_DIRS ${Qt5_DIR}/lib)
-
+ SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app")
-######## OS X Bundle Info ########
-
-IF(APPLE)
SET(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC")
SET(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.")
- SET(MACOSX_BUNDLE_BUNDLE_VERSION
- "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}")
+ SET(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}")
#SET(MACOSX_BUNDLE_GUI_IDENTIFIER "")
SET(MACOSX_BUNDLE_ICON_FILE MultiMC.icns)
-ENDIF(APPLE)
+ELSEIF(UNIX)
+ SET(PLUGIN_DEST_DIR plugins)
+ SET(QTCONF_DEST_DIR .)
+ SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC")
+ELSEIF(WIN32)
+ SET(PLUGIN_DEST_DIR .)
+ SET(QTCONF_DEST_DIR .)
+ SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe")
+ENDIF()
+
+# directories to look for dependencies
+SET(DIRS "${QT_LIBS_DIR}")
######## Install ########
#### Executable ####
-IF(WIN32)
-INSTALL(TARGETS MultiMC
- BUNDLE DESTINATION . COMPONENT Runtime
- LIBRARY DESTINATION . COMPONENT Runtime
- RUNTIME DESTINATION . COMPONENT Runtime
-)
-ENDIF()
-IF(UNIX)
-IF(APPLE)
-INSTALL(TARGETS MultiMC
- BUNDLE DESTINATION . COMPONENT Runtime
- RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime
-)
-ELSE()
-INSTALL(TARGETS MultiMC
- BUNDLE DESTINATION . COMPONENT Runtime
- RUNTIME DESTINATION bin COMPONENT Runtime
-)
-INSTALL(PROGRAMS package/linux/MultiMC DESTINATION .)
-ENDIF()
-ENDIF()
+IF(APPLE AND UNIX) ## OSX
+ INSTALL(TARGETS MultiMC
+ BUNDLE DESTINATION . COMPONENT Runtime
+ RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime
+ )
+ELSEIF(UNIX) ## LINUX and similar
+ INSTALL(TARGETS MultiMC
+ BUNDLE DESTINATION . COMPONENT Runtime
+ RUNTIME DESTINATION bin COMPONENT Runtime
+ )
+ INSTALL(PROGRAMS package/linux/MultiMC DESTINATION .)
-#### Plugins ####
+ELSEIF(WIN32) ## WINDOWS
+ INSTALL(TARGETS MultiMC
+ BUNDLE DESTINATION . COMPONENT Runtime
+ LIBRARY DESTINATION . COMPONENT Runtime
+ RUNTIME DESTINATION . COMPONENT Runtime
+ )
+ENDIF()
-OPTION(MultiMC_INSTALL_SHARED_LIBS "if set, Qt's shared libraries will be copied to the installation directory on install")
+#### Dist package logic ####
-IF (MultiMC_INSTALL_SHARED_LIBS)
- # Image formats
- INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime)
+if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+# Image formats
+INSTALL(
+ DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
+ DESTINATION ${PLUGIN_DEST_DIR}
+ COMPONENT Runtime
+ REGEX "tga|svg|tiff|mng" EXCLUDE
+)
- # Platform plugins
- INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/platforms" DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime)
+# Platform plugins
+INSTALL(
+ DIRECTORY "${QT_PLUGINS_DIR}/platforms"
+ DESTINATION ${PLUGIN_DEST_DIR}
+ COMPONENT Runtime
+ REGEX "minimal|linuxfb|offscreen" EXCLUDE
+)
+else()
+# Image formats
+INSTALL(
+ DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
+ DESTINATION ${PLUGIN_DEST_DIR}
+ COMPONENT Runtime
+ REGEX "tga|svg|tiff|mng" EXCLUDE
+ REGEX "d\\." EXCLUDE
+ REGEX "_debug\\." EXCLUDE
+)
- # qtconf
- INSTALL(CODE "
- FILE(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\")
- " COMPONENT Runtime)
+# Platform plugins
+INSTALL(
+ DIRECTORY "${QT_PLUGINS_DIR}/platforms"
+ DESTINATION ${PLUGIN_DEST_DIR}
+ COMPONENT Runtime
+ REGEX "minimal|linuxfb|offscreen" EXCLUDE
+ REGEX "d\\." EXCLUDE
+ REGEX "_debug\\." EXCLUDE
+)
+endif()
+
+# qtconf
+INSTALL(
+ CODE "
+FILE(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\")
+"
+ COMPONENT Runtime
+)
- # Dirs to look for dependencies.
- SET(DIRS "${QT_LIBRARY_DIRS}")
+INSTALL(
+ CODE "
+FILE(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${PLUGIN_DEST_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+function(gp_resolved_file_type_override resolved_file type_var)
+ if(resolved_file MATCHES \"^/usr/lib/libQt\")
+ message(\"resolving \${resolved_file} as other\")
+ set(\${type_var} other PARENT_SCOPE)
+ endif()
+endfunction()
+
+include(BundleUtilities)
+fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
+"
+ COMPONENT Runtime
+)
- INSTALL(CODE "
- file(GLOB_RECURSE QTPLUGINS
- \"\${CMAKE_INSTALL_PREFIX}/${PLUGIN_DEST_DIR}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
- include(BundleUtilities)
- fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
- " COMPONENT Runtime)
-ENDIF()
######## Package ########
@@ -596,14 +627,12 @@ include_directories(${PROJECT_BINARY_DIR}/include)
file (GLOB TRANSLATIONS_FILES translations/*.ts)
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts files (WARNING: make clean will delete the source .ts files! Danger!)")
-if (UPDATE_TRANSLATIONS)
- qt5_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
-else (UPDATE_TRANSLATIONS)
- qt5_add_translation(QM_FILES ${TRANSLATIONS_FILES})
-endif (UPDATE_TRANSLATIONS)
+IF(UPDATE_TRANSLATIONS)
+ qt5_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
+ELSE()
+ qt5_add_translation(QM_FILES ${TRANSLATIONS_FILES})
+ENDIF()
add_custom_target (translations DEPENDS ${QM_FILES})
install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/translations)
-
-
diff --git a/MultiMC.cpp b/MultiMC.cpp
index a41f5f0a..e10292ab 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -189,6 +189,9 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv),
case QNetworkProxy::FtpCachingProxy:
proxyDesc = "FTP caching: ";
break;
+ default:
+ proxyDesc = "DERP proxy: ";
+ break;
}
proxyDesc += QString("%3@%1:%2 pass %4")
.arg(proxy.hostName())
@@ -326,6 +329,7 @@ void MultiMC::initGlobalSettings()
m_settings->registerSetting(new Setting("InstSortMode", "Name"));
+ m_settings->registerSetting(new Setting("SelectedInstance", QString()));
// Persistent value for the client ID
m_settings->registerSetting(new Setting("YggdrasilClientToken", ""));
diff --git a/depends/groupview/src/categorizedview.cpp b/depends/groupview/src/categorizedview.cpp
index f4449949..1345205c 100644
--- a/depends/groupview/src/categorizedview.cpp
+++ b/depends/groupview/src/categorizedview.cpp
@@ -58,18 +58,6 @@ struct KCategorizedView::Private::Item
struct KCategorizedView::Private::Block
{
- Block()
- : topLeft ( QPoint() )
- , height ( -1 )
- , firstIndex ( QModelIndex() )
- , quarantineStart ( QModelIndex() )
- , items ( QList<Item>() )
- , outOfQuarantine ( false )
- , alternate ( false )
- , collapsed ( false )
- {
- }
-
bool operator!= ( const Block &rhs ) const
{
return firstIndex != rhs.firstIndex;
@@ -83,7 +71,7 @@ struct KCategorizedView::Private::Block
}
QPoint topLeft;
- int height;
+ int height = -1;
QPersistentModelIndex firstIndex;
// if we have n elements on this block, and we inserted an element at position i. The quarantine
// will start at index (i, column, parent). This means that for all elements j where i <= j <= n, the
@@ -97,25 +85,16 @@ struct KCategorizedView::Private::Block
// this affects the whole block, not items separately. items contain the topLeft point relative
// to the block. Because of insertions or removals a whole block can be moved, so the whole block
// will enter in quarantine, what is faster than moving all items in absolute terms.
- bool outOfQuarantine;
+ bool outOfQuarantine = false;
// should we alternate its color ? is just a hint, could not be used
- bool alternate;
- bool collapsed;
+ bool alternate = false;
+ bool collapsed = false;
};
KCategorizedView::Private::Private ( KCategorizedView *q )
: q ( q )
- , proxyModel ( 0 )
- , categoryDrawer ( 0 )
- , categorySpacing ( 5 )
- , alternatingBlockColors ( false )
- , collapsibleBlocks ( false )
, hoveredBlock ( new Block() )
- , hoveredIndex ( QModelIndex() )
- , pressedPosition ( QPoint() )
- , rubberBandRect ( QRect() )
- , constantItemWidth( 0 )
{
}
diff --git a/depends/groupview/src/categorizedview_p.h b/depends/groupview/src/categorizedview_p.h
index 13809312..524bba3a 100644
--- a/depends/groupview/src/categorizedview_p.h
+++ b/depends/groupview/src/categorizedview_p.h
@@ -137,14 +137,15 @@ public:
*/
void _k_slotCollapseOrExpandClicked(QModelIndex);
- KCategorizedView *q;
- KCategorizedSortFilterProxyModel *proxyModel;
- KCategoryDrawer *categoryDrawer;
- int categorySpacing;
- bool alternatingBlockColors;
- bool collapsibleBlocks;
- bool constantItemWidth;
-
+ KCategorizedView *q = nullptr;
+ KCategorizedSortFilterProxyModel *proxyModel = nullptr;
+ KCategoryDrawer *categoryDrawer = nullptr;
+ int categorySpacing = 5;
+ bool alternatingBlockColors = false;
+ bool collapsibleBlocks = false;
+ bool constantItemWidth = false;
+
+ // FIXME: this is some really weird logic. Investigate.
Block *hoveredBlock;
QString hoveredCategory;
QModelIndex hoveredIndex;
diff --git a/depends/groupview/src/categorydrawer.cpp b/depends/groupview/src/categorydrawer.cpp
index 04903206..214ce3b2 100644
--- a/depends/groupview/src/categorydrawer.cpp
+++ b/depends/groupview/src/categorydrawer.cpp
@@ -42,9 +42,9 @@ public:
~Private()
{
}
+ KCategorizedView *view;
int leftMargin;
int rightMargin;
- KCategorizedView *view;
};
KCategoryDrawer::KCategoryDrawer(KCategorizedView *view)
diff --git a/depends/pack200/src/bands.cpp b/depends/pack200/src/bands.cpp
index 1c10b35b..1608d838 100644
--- a/depends/pack200/src/bands.cpp
+++ b/depends/pack200/src/bands.cpp
@@ -79,7 +79,6 @@ void band::readData(int expectedLength)
// Read one value to see what it might be.
int XB = _meta_default;
- int cp1 = 0, cp2 = 0;
if (!is_BYTE1)
{
// must be a variable-length coding
@@ -109,7 +108,6 @@ void band::readData(int expectedLength)
{
// Skip over the escape value.
u->rp = xvs.rp;
- cp1 = 1;
}
else
{
diff --git a/depends/pack200/src/bytes.h b/depends/pack200/src/bytes.h
index 2e4a9daf..6ed0b729 100644
--- a/depends/pack200/src/bytes.h
+++ b/depends/pack200/src/bytes.h
@@ -87,7 +87,7 @@ struct bytes
bytes res;
res.ptr = ptr + beg;
res.len = end - beg;
- assert(res.len == 0 || inBounds(res.ptr) && inBounds(res.limit() - 1));
+ assert(res.len == 0 ||(inBounds(res.ptr) && inBounds(res.limit() - 1)));
return res;
}
// building C strings inside byte buffers:
diff --git a/depends/pack200/src/coding.cpp b/depends/pack200/src/coding.cpp
index 226ba458..3e311131 100644
--- a/depends/pack200/src/coding.cpp
+++ b/depends/pack200/src/coding.cpp
@@ -121,7 +121,6 @@ coding *coding::init()
this->min = this->umin = 0;
if (S != 0 && range != 0)
{
- int Smask = (1 << S) - 1;
int64_t maxPosCode = range - 1;
int64_t maxNegCode = range - 1;
while (IS_NEG_CODE(S, maxPosCode))
diff --git a/depends/pack200/src/unpack.cpp b/depends/pack200/src/unpack.cpp
index b286269d..55d253b2 100644
--- a/depends/pack200/src/unpack.cpp
+++ b/depends/pack200/src/unpack.cpp
@@ -483,10 +483,6 @@ void unpacker::putu1ref(entry *e)
putu1_at(put_space(1), oidx);
}
-static int total_cp_size[] = {0, 0};
-static int largest_cp_ref[] = {0, 0};
-static int hash_probes[] = {0, 0};
-
// Allocation of small and large blocks.
enum
@@ -705,7 +701,7 @@ void unpacker::read_file_header()
unpack_abort("impossible archive size"); // bad input data
return;
}
- if (archive_size < header_size_1)
+ if (archive_size < (size_t)header_size_1)
{
unpack_abort("too much read-ahead"); // somehow we pre-fetched too much?
return;
@@ -1316,8 +1312,6 @@ void unpacker::read_signature_values(entry *cpMap, int len)
// Cf. PackageReader.readConstantPool
void unpacker::read_cp()
{
- byte *rp0 = rp;
-
int i;
for (int k = 0; k < (int)N_TAGS_IN_ORDER; k++)
@@ -1596,7 +1590,6 @@ band **unpacker::attr_definitions::buildBands(unpacker::layout_definition *lo)
const char *unpacker::attr_definitions::parseIntLayout(const char *lp, band *&res, byte le_kind,
bool can_be_signed)
{
- const char *lp0 = lp;
band *b = U_NEW(band, 1);
char le = *lp++;
int spec = UNSIGNED5_spec;
@@ -1638,7 +1631,6 @@ const char *unpacker::attr_definitions::parseIntLayout(const char *lp, band *&re
const char *unpacker::attr_definitions::parseNumeral(const char *lp, int &res)
{
- const char *lp0 = lp;
bool sgn = false;
if (*lp == '0')
{
@@ -1703,7 +1695,6 @@ band **unpacker::attr_definitions::popBody(int bs_base)
const char *unpacker::attr_definitions::parseLayout(const char *lp, band **&res, int curCble)
{
- const char *lp0 = lp;
int bs_base = band_stack.length();
bool top_level = (bs_base == 0);
band *b;
@@ -3135,8 +3126,6 @@ unpacker::read_bcs()
void unpacker::read_bands()
{
- byte *rp0 = rp;
-
read_file_header();
if (cp.nentries == 0)
@@ -3312,7 +3301,7 @@ void constant_pool::initMemberIndexes()
// Get the pre-existing indexes:
int nclasses = tag_count[CONSTANT_Class];
- entry *classes = tag_base[CONSTANT_Class] + entries;
+ // entry *classes = tag_base[CONSTANT_Class] + entries; // UNUSED
int nfields = tag_count[CONSTANT_Fieldref];
entry *fields = tag_base[CONSTANT_Fieldref] + entries;
int nmethods = tag_count[CONSTANT_Methodref];
@@ -3563,8 +3552,6 @@ void unpacker::start(void *packptr, size_t len)
void unpacker::check_options()
{
- const char *strue = "true";
- const char *sfalse = "false";
if (deflate_hint_or_zero != 0)
{
bool force_deflate_hint = (deflate_hint_or_zero > 0);
diff --git a/depends/pack200/src/unpack200.cpp b/depends/pack200/src/unpack200.cpp
index 2ff8c34a..0a9d2714 100644
--- a/depends/pack200/src/unpack200.cpp
+++ b/depends/pack200/src/unpack200.cpp
@@ -97,8 +97,6 @@ static int read_magic(unpacker *u, char peek[], int peeklen)
void unpack_200(std::string input_path, std::string output_path)
{
unpacker u;
- int status = 0;
-
FILE *input = fopen(input_path.c_str(), "rb");
if (!input)
{
diff --git a/depends/quazip/unzip.c b/depends/quazip/unzip.c
index 6e115ae6..52bc081f 100644
--- a/depends/quazip/unzip.c
+++ b/depends/quazip/unzip.c
@@ -1173,7 +1173,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
if (password != NULL)
{
int i;
- s->pcrc_32_tab = get_crc_table();
+ s->pcrc_32_tab = (const unsigned long*) get_crc_table();
init_keys(password,s->keys,s->pcrc_32_tab);
if (ZSEEK(s->z_filefunc, s->filestream,
s->pfile_in_zip_read->pos_in_zipfile +
diff --git a/depends/quazip/zip.c b/depends/quazip/zip.c
index bf8c0a10..a36a20a1 100644
--- a/depends/quazip/zip.c
+++ b/depends/quazip/zip.c
@@ -903,7 +903,7 @@ extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi,
unsigned char bufHead[RAND_HEAD_LEN];
unsigned int sizeHead;
zi->ci.encrypt = 1;
- zi->ci.pcrc_32_tab = get_crc_table();
+ zi->ci.pcrc_32_tab = (const unsigned long*) get_crc_table();
/*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/
crcForCrypting = (uLong)zi->ci.dosDate << 16; // ATTANTION! Without this row, you don't unpack your password protected archive in other app.
diff --git a/depends/settings/include/keyring.h b/depends/settings/include/keyring.h
index 747211de..a4da23b1 100644
--- a/depends/settings/include/keyring.h
+++ b/depends/settings/include/keyring.h
@@ -34,6 +34,11 @@ class LIBSETTINGS_EXPORT Keyring
{
public:
/**
+ * @brief virtual dtor
+ */
+ virtual ~Keyring() {};
+
+ /**
* @brief the System Keyring instance
* @return the Keyring instance
*/
diff --git a/depends/settings/src/stubkeyring.h b/depends/settings/src/stubkeyring.h
index f25cefde..1f4b1be0 100644
--- a/depends/settings/src/stubkeyring.h
+++ b/depends/settings/src/stubkeyring.h
@@ -24,6 +24,11 @@
class StubKeyring : public Keyring
{
public:
+ /**
+ * @brief virtual dtor
+ */
+ virtual ~StubKeyring() {};
+
virtual bool storePassword(QString service, QString username, QString password);
virtual QString getPassword(QString service, QString username);
virtual bool hasPassword(QString service, QString username);
diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp
index d8a1b69d..d0210df6 100644
--- a/gui/ConsoleWindow.cpp
+++ b