Skip to content

Commit

Permalink
Remove vector and print error in archive.cpp, Check for empty string …
Browse files Browse the repository at this point in the history
…in calculatorwindow.cpp, Change application name and version, Remove bundleaddons.sh
  • Loading branch information
vetux committed Oct 10, 2022
1 parent d5ff6f2 commit 83e5fd8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 0 additions & 2 deletions python/addon/bundleaddons.sh

This file was deleted.

4 changes: 1 addition & 3 deletions src/io/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ Archive::Archive(std::istream &stream) {
archive_read_support_format_all(a);
archive_read_open_memory(a, buf.data(), buf.size());

std::vector<char> readBuffer(100000 * 500);

struct archive_entry *entry;
// Read Entry Headers
for (;;) {
Expand All @@ -198,7 +196,7 @@ Archive::Archive(std::istream &stream) {
if (ret == ARCHIVE_EOF)
break;
if (ret < ARCHIVE_OK)
throw std::runtime_error("Failed to read archive data");
throw std::runtime_error("Failed to read archive data: " + std::string(archive_error_string(a)));

// Copy data to archive
auto prevSize = e.size();
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ void printUsage() {
int main(int argc, char *argv[]) {
QApplication a(argc, argv);

QApplication::setApplicationName("qcalculator");
QApplication::setApplicationName("qCalculator");
QApplication::setApplicationDisplayName("qCalculator");
QApplication::setApplicationVersion("v0.6.0");
QApplication::setApplicationVersion("v0.6.1");

auto args = parseArgs(argc, argv);

Expand Down
5 changes: 3 additions & 2 deletions src/windows/calculatorwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ void CalculatorWindow::onActionCreateAddonBundle() {
"Do you want to add a package?",
"Add Directory",
"Add File",
"Continue");
"No");
if (r == 0) {
dialog.setWindowTitle("Select python package directory...");
dialog.setFileMode(QFileDialog::Directory);
Expand Down Expand Up @@ -845,7 +845,8 @@ void CalculatorWindow::saveSymbolTablePathHistory() {
for (auto &path: symbolTablePathHistory) {
str += path + '\n';
}
str.pop_back();
if (!str.empty())
str.pop_back();
FileOperations::fileWriteAll(Paths::getSymbolTableHistoryFile(), str);
} catch (const std::exception &e) {
QMessageBox::warning(this, "Failed to save symbol table history", e.what());
Expand Down

0 comments on commit 83e5fd8

Please sign in to comment.