diff --git a/include/ros_packager.hxx b/include/ros_packager.hxx index 55e0bce..5c52648 100644 --- a/include/ros_packager.hxx +++ b/include/ros_packager.hxx @@ -124,7 +124,7 @@ class Packager { * * @param doc_path full path to the documentation file * *************************************************************************/ - void addGraphicsFile(const QString& graphic_path) {graphics_files_.push_back(graphic_path);} + void addGraphicsFile(const QString& graphic_path) {graphic_files_.push_back(graphic_path);} /*! ************************************************************************* * @brief add a contributor to the package, this is an additional author. diff --git a/src/ros_packager.cxx b/src/ros_packager.cxx index 2abb161..cfa567b 100644 --- a/src/ros_packager.cxx +++ b/src/ros_packager.cxx @@ -137,6 +137,13 @@ QString ROSPkg::Packager::createPackage() { ); } + for(const QString& graphic_file : graphic_files_) { + QFile(graphic_file).copy( + out_dir_+ + QDir::separator() + "Graphics" + QDir::separator() + QFileInfo(graphic_file).fileName() + ); + } + const QString zip_file_ = out_dir_ + ".zip"; elz::zipFolder(out_dir_.toStdString(), zip_file_.toStdString()); diff --git a/src/ros_system.cxx b/src/ros_system.cxx index f601ad5..f36e33d 100644 --- a/src/ros_system.cxx +++ b/src/ros_system.cxx @@ -400,6 +400,7 @@ void ROSPkg::System::unzipFile(const QString& file_name, const QString& author, files_list_["toml"].push_back(new_toml_); } + else if(files_list_["toml"].size() > 1) { QMessageBox::critical( parent_, @@ -441,6 +442,18 @@ void ROSPkg::System::uninstall(const QString& sha) { QFile(data_dir_ + "Sessions" + QDir::separator() + QString::fromStdString(ssn_file.string())).remove(); } + for(const std::filesystem::path& img_file: meta_data_.img_files()){ + info_text_ += "\n\nRemoved '" + data_dir_ + "Images" + QDir::separator() + QString::fromStdString(img_file.string()) + "'"; + + QFile(data_dir_ + "Images" + QDir::separator() + QString::fromStdString(img_file.string())).remove(); + } + + for(const std::filesystem::path& graphic_file: meta_data_.graphic_files()){ + info_text_ += "\n\nRemoved '" + data_dir_ + "Graphics" + QDir::separator() + QString::fromStdString(graphic_file.string()) + "'"; + + QFile(data_dir_ + "Graphics" + QDir::separator() + QString::fromStdString(graphic_file.string())).remove(); + } + if(QDir doc_dir_(doc_dir_path_); doc_dir_.exists()){ info_text_ += "\n\nRemoved '" + doc_dir_path_; doc_dir_.removeRecursively();