From bf17bbf5736e4774b1ac8e18698bc2fcf6ff9a1e Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sat, 9 Jul 2011 17:37:36 +1000 Subject: Version 1.3 (beta) --- heimdall-frontend/Source/Alerts.cpp | 0 heimdall-frontend/Source/Alerts.h | 0 heimdall-frontend/Source/FirmwareInfo.cpp | 0 heimdall-frontend/Source/FirmwareInfo.h | 0 heimdall-frontend/Source/PackageData.cpp | 0 heimdall-frontend/Source/PackageData.h | 0 heimdall-frontend/Source/Packaging.cpp | 16 ++-- heimdall-frontend/Source/Packaging.h | 10 +-- heimdall-frontend/Source/mainwindow.cpp | 6 +- heimdall-frontend/doc-pak/LICENSE | 4 +- heimdall-frontend/doc-pak/README | 2 +- heimdall-frontend/heimdall-frontend.pri | 16 ++-- heimdall-frontend/heimdall-frontend.pro | 8 +- heimdall-frontend/include/zconf.h | 0 heimdall-frontend/include/zlib.h | 0 heimdall-frontend/lib/win32/zlib.lib | Bin heimdall-frontend/mainwindow.ui | 118 +++++++++++++++--------------- 17 files changed, 96 insertions(+), 84 deletions(-) mode change 100755 => 100644 heimdall-frontend/Source/Alerts.cpp mode change 100755 => 100644 heimdall-frontend/Source/Alerts.h mode change 100755 => 100644 heimdall-frontend/Source/FirmwareInfo.cpp mode change 100755 => 100644 heimdall-frontend/Source/FirmwareInfo.h mode change 100755 => 100644 heimdall-frontend/Source/PackageData.cpp mode change 100755 => 100644 heimdall-frontend/Source/PackageData.h mode change 100755 => 100644 heimdall-frontend/Source/Packaging.cpp mode change 100755 => 100644 heimdall-frontend/Source/Packaging.h mode change 100755 => 100644 heimdall-frontend/include/zconf.h mode change 100755 => 100644 heimdall-frontend/include/zlib.h mode change 100755 => 100644 heimdall-frontend/lib/win32/zlib.lib (limited to 'heimdall-frontend') diff --git a/heimdall-frontend/Source/Alerts.cpp b/heimdall-frontend/Source/Alerts.cpp old mode 100755 new mode 100644 diff --git a/heimdall-frontend/Source/Alerts.h b/heimdall-frontend/Source/Alerts.h old mode 100755 new mode 100644 diff --git a/heimdall-frontend/Source/FirmwareInfo.cpp b/heimdall-frontend/Source/FirmwareInfo.cpp old mode 100755 new mode 100644 diff --git a/heimdall-frontend/Source/FirmwareInfo.h b/heimdall-frontend/Source/FirmwareInfo.h old mode 100755 new mode 100644 diff --git a/heimdall-frontend/Source/PackageData.cpp b/heimdall-frontend/Source/PackageData.cpp old mode 100755 new mode 100644 diff --git a/heimdall-frontend/Source/PackageData.h b/heimdall-frontend/Source/PackageData.h old mode 100755 new mode 100644 diff --git a/heimdall-frontend/Source/Packaging.cpp b/heimdall-frontend/Source/Packaging.cpp old mode 100755 new mode 100644 index 8db5dff..fc41ba6 --- a/heimdall-frontend/Source/Packaging.cpp +++ b/heimdall-frontend/Source/Packaging.cpp @@ -39,6 +39,7 @@ using namespace HeimdallFrontend; +const qint64 Packaging::kMaxFileSize = 8589934592ll; const char *Packaging::ustarMagic = "ustar"; bool Packaging::ExtractTar(QTemporaryFile& tarFile, PackageData *packageData) @@ -81,7 +82,7 @@ bool Packaging::ExtractTar(QTemporaryFile& tarFile, PackageData *packageData) return (false); } - bool ustarFormat = strcmp(tarHeader.fields.magic, ustarMagic) == 0; + //bool ustarFormat = strcmp(tarHeader.fields.magic, ustarMagic) == 0; bool empty = true; for (int i = 0; i < TarHeader::kBlockLength; i++) @@ -233,7 +234,7 @@ bool Packaging::WriteTarEntry(const QString& filename, QTemporaryFile *tarFile, return (false); } - if (file.size() > TarHeader::kMaxFileSize) + if (file.size() > Packaging::kMaxFileSize) { Alerts::DisplayError(QString("File is too large to be packaged:\n%1").arg(file.fileName())); return (false); @@ -306,8 +307,8 @@ bool Packaging::WriteTarEntry(const QString& filename, QTemporaryFile *tarFile, sprintf(tarHeader.fields.groupId, "%07o", 0); // Note: We don't support base-256 encoding. Support could be added later. - sprintf(tarHeader.fields.size, "%011o", file.size()); - sprintf(tarHeader.fields.modifiedTime, "%011o", qtFileInfo.lastModified().toMSecsSinceEpoch() / 1000); + sprintf(tarHeader.fields.size, "%011llo", file.size()); + sprintf(tarHeader.fields.modifiedTime, "%011llo", qtFileInfo.lastModified().toMSecsSinceEpoch() / 1000); // Regular File tarHeader.fields.typeFlag = '0'; @@ -373,7 +374,8 @@ bool Packaging::CreateTar(const FirmwareInfo& firmwareInfo, QTemporaryFile *tarF return (false); } - firmwareInfo.WriteXml(QXmlStreamWriter(&firmwareXmlFile)); + QXmlStreamWriter xml(&firmwareXmlFile); + firmwareInfo.WriteXml(xml); firmwareXmlFile.close(); if (!tarFile->open()) @@ -456,7 +458,7 @@ bool Packaging::ExtractPackage(const QString& packagePath, PackageData *packageD { FILE *compressedPackageFile = fopen(packagePath.toStdString().c_str(), "rb"); - if (fopen == NULL) + if (!compressedPackageFile) { Alerts::DisplayError(QString("Failed to open package:\n%1").arg(packagePath)); return (false); @@ -547,7 +549,7 @@ bool Packaging::BuildPackage(const QString& packagePath, const FirmwareInfo& fir { FILE *compressedPackageFile = fopen(packagePath.toStdString().c_str(), "wb"); - if (fopen == NULL) + if (!compressedPackageFile) { Alerts::DisplayError(QString("Failed to create package:\n%1").arg(packagePath)); return (false); diff --git a/heimdall-frontend/Source/Packaging.h b/heimdall-frontend/Source/Packaging.h old mode 100755 new mode 100644 index b02637a..402f786 --- a/heimdall-frontend/Source/Packaging.h +++ b/heimdall-frontend/Source/Packaging.h @@ -43,11 +43,6 @@ namespace HeimdallFrontend kUstarHeaderLength = 500, }; - enum : quint64 - { - kMaxFileSize = 8589934592 - }; - enum { kModeOtherExecute = 1, @@ -92,6 +87,11 @@ namespace HeimdallFrontend class Packaging { + public: + + // Would definitely prefer to use an enum but VC++ and GCC give conflicting warnings about C++0x or type overflow. + static const qint64 kMaxFileSize; + private: enum diff --git a/heimdall-frontend/Source/mainwindow.cpp b/heimdall-frontend/Source/mainwindow.cpp index f5880f9..a777c77 100644 --- a/heimdall-frontend/Source/mainwindow.cpp +++ b/heimdall-frontend/Source/mainwindow.cpp @@ -343,12 +343,14 @@ void MainWindow::SelectFirmwarePackage(void) void MainWindow::OpenDeveloperHomepage(void) { - QDesktopServices::openUrl(QUrl(loadedPackageData.GetFirmwareInfo().GetUrl(), QUrl::TolerantMode)); + if(!QDesktopServices::openUrl(QUrl(loadedPackageData.GetFirmwareInfo().GetUrl(), QUrl::TolerantMode))) + Alerts::DisplayWarning(QString("Cannot open invalid URL:\n%1").arg(loadedPackageData.GetFirmwareInfo().GetUrl())); } void MainWindow::OpenDeveloperDonationWebpage(void) { - QDesktopServices::openUrl(QUrl(loadedPackageData.GetFirmwareInfo().GetDonateUrl(), QUrl::TolerantMode)); + if (!QDesktopServices::openUrl(QUrl(loadedPackageData.GetFirmwareInfo().GetDonateUrl(), QUrl::TolerantMode))) + Alerts::DisplayWarning(QString("Cannot open invalid URL:\n%1").arg(loadedPackageData.GetFirmwareInfo().GetDonateUrl())); } void MainWindow::LoadFirmwarePackage(void) diff --git a/heimdall-frontend/doc-pak/LICENSE b/heimdall-frontend/doc-pak/LICENSE index a18336e..78dc138 100644 --- a/heimdall-frontend/doc-pak/LICENSE +++ b/heimdall-frontend/doc-pak/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2010 Benjamin Dobell, Glass Echidna +Copyright (c) 2010-2011 Benjamin Dobell, Glass Echidna Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/heimdall-frontend/doc-pak/README b/heimdall-frontend/doc-pak/README index 2c7952f..27fba92 100644 --- a/heimdall-frontend/doc-pak/README +++ b/heimdall-frontend/doc-pak/README @@ -1,4 +1,4 @@ -Heimdall (c) 2010 Benjamin Dobell, Glass Echidna +Heimdall (c) 2010-2011 Benjamin Dobell, Glass Echidna http://www.glassechidna.com.au/products/heimdall/ DISCLAIMER: diff --git a/heimdall-frontend/heimdall-frontend.pri b/heimdall-frontend/heimdall-frontend.pri index 63cf202..67ec8c4 100644 --- a/heimdall-frontend/heimdall-frontend.pri +++ b/heimdall-frontend/heimdall-frontend.pri @@ -1,12 +1,16 @@ -# ---------------------------------------------------- -# This file is generated by the Qt Visual Studio Add-in. -# ------------------------------------------------------ - HEADERS += ./Source/aboutform.h \ - ./Source/mainwindow.h + ./Source/Alerts.h \ + ./Source/FirmwareInfo.h \ + ./Source/mainwindow.h \ + ./Source/PackageData.h \ + ./Source/Packaging.h SOURCES += ./Source/aboutform.cpp \ + ./Source/Alerts.cpp \ + ./Source/FirmwareInfo.cpp \ ./Source/main.cpp \ - ./Source/mainwindow.cpp + ./Source/mainwindow.cpp \ + ./Source/PackageData.cpp \ + ./Source/Packaging.cpp FORMS += ./mainwindow.ui \ ./aboutform.ui RESOURCES += mainwindow.qrc diff --git a/heimdall-frontend/heimdall-frontend.pro b/heimdall-frontend/heimdall-frontend.pro index e784b56..cbb3359 100644 --- a/heimdall-frontend/heimdall-frontend.pro +++ b/heimdall-frontend/heimdall-frontend.pro @@ -7,7 +7,7 @@ TARGET = heimdall-frontend macx { PRIVATE_FRAMEWORKS.files = /Library/Frameworks/QtCore.framework \ - /Library/Frameworks/QtGui.framework + /Library/Frameworks/QtGui.framework /Library/Frameworks/QtXml.framework PRIVATE_FRAMEWORKS.path = Contents/Frameworks QMAKE_BUNDLE_DATA += PRIVATE_FRAMEWORKS @@ -44,11 +44,15 @@ macx { } } -QT += core gui +unix:LIBS += -lz ../libpit/libpit-1.3.a +win32:LIBS += ../Win32/Release/lib/libpit.lib + +QT += core gui xml CONFIG += release DEFINES += QT_LARGEFILE_SUPPORT INCLUDEPATH += ./GeneratedFiles \ ./GeneratedFiles/Release \ + ../libpit/Source \ . DEPENDPATH += . MOC_DIR += ./GeneratedFiles/release diff --git a/heimdall-frontend/include/zconf.h b/heimdall-frontend/include/zconf.h old mode 100755 new mode 100644 diff --git a/heimdall-frontend/include/zlib.h b/heimdall-frontend/include/zlib.h old mode 100755 new mode 100644 diff --git a/heimdall-frontend/lib/win32/zlib.lib b/heimdall-frontend/lib/win32/zlib.lib old mode 100755 new mode 100644 diff --git a/heimdall-frontend/mainwindow.ui b/heimdall-frontend/mainwindow.ui index 4ab96a9..510dd1d 100644 --- a/heimdall-frontend/mainwindow.ui +++ b/heimdall-frontend/mainwindow.ui @@ -120,9 +120,9 @@ 10 - 20 + 30 231 - 301 + 291 @@ -146,7 +146,7 @@ 10 - 20 + 30 131 21 @@ -230,7 +230,7 @@ 10 - 20 + 30 201 21 @@ -259,7 +259,7 @@ 10 - 20 + 30 391 21 @@ -275,7 +275,7 @@ 410 - 20 + 30 71 23 @@ -304,7 +304,7 @@ 10 - 20 + 30 81 21 @@ -333,8 +333,8 @@ 10 - 20 - 311 + 30 + 281 21 @@ -349,7 +349,7 @@ 410 - 20 + 30 71 23 @@ -364,9 +364,9 @@ - 330 - 20 - 71 + 300 + 30 + 101 23 @@ -400,9 +400,9 @@ 10 - 290 + 280 751 - 161 + 171 @@ -415,7 +415,7 @@ 320 - 120 + 130 311 31 @@ -431,7 +431,7 @@ 10 - 20 + 30 731 91 @@ -450,7 +450,7 @@ 10 - 120 + 130 301 21 @@ -475,7 +475,7 @@ 640 - 120 + 130 91 31 @@ -503,7 +503,7 @@ 10 20 381 - 51 + 61 @@ -516,7 +516,7 @@ 10 - 20 + 30 281 21 @@ -532,7 +532,7 @@ 300 - 20 + 30 71 23 @@ -548,9 +548,9 @@ - 670 + 660 240 - 71 + 81 23 @@ -577,7 +577,7 @@ 110 - 20 + 30 261 22 @@ -587,7 +587,7 @@ 10 - 20 + 30 91 16 @@ -600,7 +600,7 @@ 10 - 50 + 60 91 16 @@ -661,7 +661,7 @@ 110 - 50 + 60 261 21 @@ -679,7 +679,7 @@ 400 240 - 71 + 81 23 @@ -694,9 +694,9 @@ 400 - 20 + 30 341 - 211 + 201 @@ -707,7 +707,7 @@ 150 - 80 + 90 121 21 @@ -723,7 +723,7 @@ 20 - 80 + 90 121 21 @@ -757,7 +757,7 @@ 10 - 20 + 30 471 151 @@ -770,7 +770,7 @@ 380 - 180 + 190 101 23 @@ -785,7 +785,7 @@ 240 10 - 111 + 121 61 @@ -799,8 +799,8 @@ 10 - 20 - 91 + 30 + 101 21 @@ -812,7 +812,7 @@ - 490 + 480 10 151 61 @@ -828,7 +828,7 @@ 10 - 20 + 30 131 21 @@ -857,7 +857,7 @@ 10 - 20 + 30 201 21 @@ -939,14 +939,14 @@ - 140 + 130 60 - 91 + 101 23 - Add Developer + Add @@ -956,14 +956,14 @@ - 630 + 640 110 - 111 + 101 23 - Remove Developer + Remove @@ -1041,9 +1041,9 @@ - 650 + 640 10 - 111 + 121 61 @@ -1057,8 +1057,8 @@ 10 - 20 - 91 + 30 + 101 21 @@ -1083,7 +1083,7 @@ 10 - 50 + 60 91 16 @@ -1099,7 +1099,7 @@ 110 - 50 + 60 151 21 @@ -1112,7 +1112,7 @@ 10 - 20 + 30 91 16 @@ -1128,7 +1128,7 @@ 110 - 20 + 30 151 21 @@ -1141,7 +1141,7 @@ 10 - 80 + 90 91 16 @@ -1157,7 +1157,7 @@ 110 - 80 + 90 151 21 @@ -1173,7 +1173,7 @@ 160 - 110 + 120 101 23 @@ -1190,7 +1190,7 @@ 580 - 410 + 420 121 31 -- cgit v1.2.3