From 2cdedc252ca67f168c92a90ff2b60b668ba51d60 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Sun, 4 Nov 2018 15:05:49 -0600 Subject: [PATCH] Replace args::ValueFlagList by vector in deployAppDirRootFiles function signature --- src/linuxdeploy.cpp | 14 +++++++------- src/linuxdeploy.h | 6 +++--- src/main.cpp | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/linuxdeploy.cpp b/src/linuxdeploy.cpp index cc8e74d..15b13e3 100644 --- a/src/linuxdeploy.cpp +++ b/src/linuxdeploy.cpp @@ -14,13 +14,13 @@ using namespace linuxdeploy::util; namespace bf = boost::filesystem; namespace linuxdeploy { - int deployAppDirRootFiles(args::ValueFlagList& desktopFilePaths, - args::ValueFlag& customAppRunPath, appdir::AppDir& appDir) { + int deployAppDirRootFiles(std::vector desktopFilePaths, + std::string customAppRunPath, appdir::AppDir& appDir) { // search for desktop file and deploy it to AppDir root ldLog() << std::endl << "-- Deploying files into AppDir root directory --" << std::endl; if (is_regular_file(appDir.path() / "AppRun")) { - if (customAppRunPath) + if (!customAppRunPath.empty()) ldLog() << LD_WARNING << "AppRun exists but custom AppRun specified, overwriting existing AppRun" << std::endl; else @@ -35,9 +35,9 @@ namespace linuxdeploy { << "Could not find desktop file in AppDir, cannot create links for AppRun, desktop file and icon in AppDir root" << std::endl; } else { - if (!desktopFilePaths.Get().empty()) { + if (!desktopFilePaths.empty()) { auto firstDeployedDesktopFileName = boost::filesystem::path( - desktopFilePaths.Get().front()).filename().string(); + desktopFilePaths.front()).filename().string(); auto desktopFileMatchingName = find_if( deployedDesktopFiles.begin(), @@ -65,8 +65,8 @@ namespace linuxdeploy { bool rv; - if (customAppRunPath) { - rv = appDir.createLinksInAppDirRoot(desktopFile, customAppRunPath.Get()); + if (!customAppRunPath.empty()) { + rv = appDir.createLinksInAppDirRoot(desktopFile, customAppRunPath); } else { rv = appDir.createLinksInAppDirRoot(desktopFile); } diff --git a/src/linuxdeploy.h b/src/linuxdeploy.h index 0434b4b..433b918 100644 --- a/src/linuxdeploy.h +++ b/src/linuxdeploy.h @@ -6,9 +6,9 @@ #include #include #include -#include + namespace linuxdeploy { - int deployAppDirRootFiles(args::ValueFlagList& desktopFilePaths, - args::ValueFlag& customAppRunPath, + int deployAppDirRootFiles(std::vector desktopFilePaths, + std::string customAppRunPath, linuxdeploy::core::appdir::AppDir& appDir); } diff --git a/src/main.cpp b/src/main.cpp index 0ccaa88..2de1c6f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -254,7 +254,7 @@ int main(int argc, char** argv) { return 1; } } - if (!linuxdeploy::deployAppDirRootFiles(desktopFilePaths, customAppRunPath, appDir)) + if (!linuxdeploy::deployAppDirRootFiles(desktopFilePaths.Get(), customAppRunPath.Get(), appDir)) return 1; if (outputPlugins) {