From: Heikki Holstila Date: Mon, 11 Oct 2010 14:58:42 +0000 (+0300) Subject: code cleanup X-Git-Url: https://vcs.maemo.org/git/?p=fapman;a=commitdiff_plain;h=23b54f1b9c89080d87c3a51d28dcaabc86b6ab2b code cleanup --- diff --git a/Makefile b/Makefile index d570259..2a58f1a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: fapman -# Generated by qmake (2.01a) (Qt 4.6.2) on: Fri Oct 1 12:03:15 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon Oct 11 17:25:50 2010 # Project: fapman.pro # Template: app # Command: /opt/NokiaQtSDK/Maemo/4.6.2/targets/fremantle-1030/bin/qmake -spec /opt/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/share/qt4/mkspecs/linux-g++-maemo5 -unix -o Makefile fapman.pro @@ -428,6 +428,7 @@ mainwindow.o: mainwindow.cpp mainwindow.h \ blacklistselect.h \ version.h \ ui_mainwindow.h \ + rotatingbackground.h \ packageview.h \ package.h \ confirmdialog.h \ @@ -436,7 +437,6 @@ mainwindow.o: mainwindow.cpp mainwindow.h \ help.h \ settings.h \ logview.h \ - rotatingbackground.h \ dpkginterface.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp diff --git a/TODO.txt b/TODO.txt index 1b18d7a..2148089 100644 --- a/TODO.txt +++ b/TODO.txt @@ -39,6 +39,7 @@ later/any/uncertain: - warn about unauthenticated packages / option to disable installing unauthenticated packages - show download speed and current repo for apt-get update (very hard since apt-get update output does not show all the information needed to get the current list file names?) +- ability to import/export blacklist known bugs: diff --git a/aaptinterface.cpp b/aaptinterface.cpp index 8011035..c53088f 100644 --- a/aaptinterface.cpp +++ b/aaptinterface.cpp @@ -106,7 +106,32 @@ AAptInterface::~AAptInterface() if( iProcAptGetClean->state() != QProcess::NotRunning ) iProcAptGetClean->kill(); - delete iDataReadBuffer; + // qprocesses are automatically deleted by their parent + + QHashIterator a( iPackagesAvailable ); + while (a.hasNext()) + { + a.next(); + delete a.value(); + } + iPackagesAvailable.clear(); + + QHashIterator i( iPackagesInstalled ); + while (i.hasNext()) + { + i.next(); + delete i.value(); + } + iPackagesInstalled.clear(); + + for(int x=0; xtoListFileNames(); } else { delete r; + r=0; } } } @@ -1013,6 +1039,7 @@ void AAptInterface::readRepositoryInfo() iRepositories.append(r); } else { delete r; + r=0; } } ham.close(); @@ -1647,7 +1674,7 @@ void AAptInterface::startFetchDates() i.next(); if( !i.value()->date().isValid() && i.value()->section().startsWith("user/") && !i.value()->isBlacklisted() ) { - Repository* repo = 0; + const Repository* repo = 0; for( int x=0; xrepositories().count(); x++ ) { if( i.value()->repositories().at(x) && i.value()->repositories().at(x)->url().startsWith("http://repository.maemo.org") ) { @@ -1684,13 +1711,13 @@ void AAptInterface::startFetchDates() if( !fe.value()->date().isValid() && fe.value()->section().startsWith("user/") && !fe.value()->isBlacklisted() ) { QString url; - Repository* repo = 0; + const Repository* repo = 0; QString fullFilename = "unknown_filename"; for( int x=0; xrepositories().count(); x++ ) { if( fe.value()->repositories().at(x) && fe.value()->repositories().at(x)->url().startsWith("http://repository.maemo.org") ) { repo = fe.value()->repositories().at(x); - if( fe.value()->fullFileNames().count()>x ) + if( repo && fe.value()->fullFileNames().count()>x ) fullFilename = fe.value()->fullFileNames().at(x); break; } @@ -1742,6 +1769,7 @@ void AAptInterface::startFetchDates() updProgress++; } delete nam; + nam=0; if( iDateRequestsReceived>0 && iNetworkError != QNetworkReply::NoError && iNetworkError != QNetworkReply::QNetworkReply::ContentAccessDenied && iNetworkError != QNetworkReply::QNetworkReply::ContentNotFoundError ) diff --git a/aaptinterface.h b/aaptinterface.h index 2390249..f14ae59 100644 --- a/aaptinterface.h +++ b/aaptinterface.h @@ -65,20 +65,20 @@ public: ModeAptGetSimulate, ModeAptGetInstall, ModeAptGetClean }; enum multiLine { MultiLineNone, MultiLineDesc, MultiLineIcon, MultiLineUpgradeDesc }; - AAptInterface(QObject* parent); - ~AAptInterface(); + explicit AAptInterface(QObject* parent); + virtual ~AAptInterface(); void setSettings(Settings* s_) { iSettings = s_; } void addQueuedOperation(interfaceMode mode_); bool run(dimmer* uiDimmer); void setProcessPackages(QStringList pkgs) { iProcessPackages=pkgs; iProcessPackagesOrig=pkgs; } - QStringList processPackages() { return iProcessPackages; } - QStringList processPackageVersions() { return iProcessPackageVersions; } + QStringList processPackages() const { return iProcessPackages; } + QStringList processPackageVersions() const { return iProcessPackageVersions; } - bool running(); + bool running() const; bool cancel(); - int numSelectedPackages() { return iNumSelectedPackages; } + int numSelectedPackages() const { return iNumSelectedPackages; } void setNumSelectedPackages(int p_) { iNumSelectedPackages=p_; } QHash* packagesAvailable() { return &iPackagesAvailable; } @@ -104,6 +104,9 @@ public: QDateTime lastDpkgUpdate() { return iLastDpkgUpdate; } private: + AAptInterface(const AAptInterface& old); + AAptInterface operator= (const AAptInterface& old); + void runNext(); void cleanAfterRunEach(); void cleanAfterRunAll(); diff --git a/blacklistselect.h b/blacklistselect.h index 5dcf492..8454bcb 100644 --- a/blacklistselect.h +++ b/blacklistselect.h @@ -37,12 +37,15 @@ public: enum blackList { BlacklistNone, BlacklistThis, BlacklistAll }; explicit BlacklistSelect(Package* pkg, QWidget *parent = 0); - ~BlacklistSelect(); + virtual ~BlacklistSelect(); protected: void changeEvent(QEvent *e); private: + BlacklistSelect(const BlacklistSelect& old); + BlacklistSelect operator= (const BlacklistSelect& old); + Ui::BlacklistSelect *ui; Package* iPkg; diff --git a/confirmdialog.h b/confirmdialog.h index ac4c12c..c2f50cf 100644 --- a/confirmdialog.h +++ b/confirmdialog.h @@ -32,7 +32,8 @@ class ConfirmDialog : public QDialog public: explicit ConfirmDialog(bool button, QWidget *parent); - ~ConfirmDialog(); + virtual ~ConfirmDialog(); + void setText(QString title, QString text); void disableButton(); #ifdef Q_WS_MAEMO_5 // workaround for buggy Qt autorotation @@ -50,6 +51,9 @@ protected: void changeEvent(QEvent *e); private: + ConfirmDialog(const ConfirmDialog& old); + ConfirmDialog operator= (const ConfirmDialog& old); + Ui::ConfirmDialog *ui; }; diff --git a/dimmer.cpp b/dimmer.cpp index 9c06508..fdff869 100644 --- a/dimmer.cpp +++ b/dimmer.cpp @@ -46,6 +46,11 @@ dimmer::dimmer(QWidget *parent) : hide(); } +dimmer::~dimmer() +{ + // iTimer and other widgets are automatically deleted by their parent +} + void dimmer::paintEvent(QPaintEvent *) { QPainter painter(this); diff --git a/dimmer.h b/dimmer.h index ae61df3..22dfa90 100644 --- a/dimmer.h +++ b/dimmer.h @@ -27,6 +27,8 @@ class dimmer : public QWidget Q_OBJECT public: explicit dimmer(QWidget *parent = 0); + virtual ~dimmer(); + void paintEvent(QPaintEvent *); void resizeEvent(QResizeEvent *); @@ -39,6 +41,9 @@ public: int progress() { return iProgress; } private: + dimmer(const dimmer& old); + dimmer operator= (const dimmer& old); + int iAlpha; QWidget* iParent; QBoxLayout* iLayout; diff --git a/dpkginterface.cpp b/dpkginterface.cpp index f4957eb..246b298 100644 --- a/dpkginterface.cpp +++ b/dpkginterface.cpp @@ -6,6 +6,10 @@ DpkgInterface::DpkgInterface(QObject *parent) : { } +DpkgInterface::~DpkgInterface() +{ +} + bool DpkgInterface::loadDebFiles(QStringList files_) { qDebug() << files_; diff --git a/dpkginterface.h b/dpkginterface.h index ac93cd6..a2280e9 100644 --- a/dpkginterface.h +++ b/dpkginterface.h @@ -8,11 +8,14 @@ class DpkgInterface : public QObject Q_OBJECT public: explicit DpkgInterface(QObject *parent = 0); + virtual ~DpkgInterface(); + bool loadDebFiles(QStringList files_); -signals: -public slots: +private: + DpkgInterface(const DpkgInterface& old); + DpkgInterface operator= (const DpkgInterface& old); }; diff --git a/fapman b/fapman index d04cfd6..e662776 100755 Binary files a/fapman and b/fapman differ diff --git a/filterselect.h b/filterselect.h index 4789b97..c346863 100644 --- a/filterselect.h +++ b/filterselect.h @@ -32,7 +32,8 @@ class FilterSelect : public QDialog public: explicit FilterSelect(QString title, QWidget *parent = 0); - ~FilterSelect(); + virtual ~FilterSelect(); + void setList(QStringList labels, int selected); int selection(); #ifdef Q_WS_MAEMO_5 // workaround for buggy Qt autorotation @@ -50,6 +51,9 @@ protected: void changeEvent(QEvent *e); private: + FilterSelect(const FilterSelect& old); + FilterSelect operator= (const FilterSelect& old); + Ui::FilterSelect *ui; }; diff --git a/help.h b/help.h index 883b874..6b9ca4a 100644 --- a/help.h +++ b/help.h @@ -32,7 +32,8 @@ class Help : public QDialog public: explicit Help(QWidget *parent = 0); - ~Help(); + virtual ~Help(); + #ifdef Q_WS_MAEMO_5 // workaround for buggy Qt autorotation int exec() { QRect r = dynamic_cast(this->parent())->rect(); @@ -48,6 +49,9 @@ protected: void changeEvent(QEvent *e); private: + Help(const Help& old); + Help operator= (const Help& old); + Ui::Help *ui; }; diff --git a/logview.h b/logview.h index 68ed3b1..76d71cc 100644 --- a/logview.h +++ b/logview.h @@ -32,13 +32,17 @@ class LogView : public QDialog public: explicit LogView(QByteArray text, QWidget *parent = 0); - ~LogView(); + virtual ~LogView(); + int exec(); protected: void changeEvent(QEvent *e); private: + LogView(const LogView& old); + LogView operator= (const LogView& old); + Ui::LogView *ui; private slots: diff --git a/main.cpp b/main.cpp index 0aaf9ff..766c0d6 100644 --- a/main.cpp +++ b/main.cpp @@ -23,7 +23,10 @@ #include "mainwindow.h" #include "confirmdialog.h" -#include +extern "C" +{ + #include +} bool EnableDebugOutput = false; diff --git a/mainwindow.cpp b/mainwindow.cpp index 44215ce..a2f6c5c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -18,8 +18,11 @@ */ #ifdef MYDEF_GTK_EXISTS -#include -#include +extern "C" +{ + #include + #include +} #endif #include @@ -33,7 +36,10 @@ #include #endif -#include +extern "C" +{ + #include +} #include "mainwindow.h" #include "version.h" @@ -160,13 +166,14 @@ MainWindow::~MainWindow() // save "need repo refresh" status iSettings->qsettings()->setValue("need_repo_refresh", iAptInterface->needRepoRefresh()); - delete iWinPackageView; - delete iWinRepoView; - delete iAptInterface; - delete iDpkgInterface; - delete iDimmer; - delete iSettings; - delete ui; + delete iWinPackageView; iWinPackageView=0; + delete iWinRepoView; iWinRepoView=0; + delete iAptInterface; iAptInterface=0; + delete iDpkgInterface; iDpkgInterface=0; + delete iDimmer; iDimmer=0; + delete iSettings; iSettings=0; + delete ui; ui=0; + //iMediaObject and aout automatically deleted by their parent } void MainWindow::changeEvent(QEvent *e) diff --git a/mainwindow.h b/mainwindow.h index 8b98800..c2267e6 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -48,7 +48,8 @@ public: enum nextOperation { OpNone, OpPromptSimulated, OpOpenPkgView }; explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); + virtual ~MainWindow(); + void operationQueueFinished(QList lastModes, bool success, QString title, QStringList msgs); void busyDialog(bool show_, QString title="", QString text=""); void closeEvent(QCloseEvent *event); @@ -69,6 +70,9 @@ protected: void changeEvent(QEvent *e); private: + MainWindow(const MainWindow& old); + MainWindow operator= (const MainWindow& old); + void dateFetchAsk(); void showFreeSpace(); diff --git a/package.cpp b/package.cpp index 6b8c13f..95afd4f 100644 --- a/package.cpp +++ b/package.cpp @@ -21,9 +21,11 @@ #include "package.h" #include "repository.h" #include "aaptinterface.h" -#include "apt-src/debversion.h" #include "blacklistselect.h" +#include "apt-src/debversion.h" + + Package::Package(QByteArray name_, AAptInterface *apt_): iAptInterface(apt_), iName(name_), iIsInstalled(false), iMarkedForOperation(false), iPkgStatus(PkgStatUnknown), iSize(0), iInstalledSize(0), iMarkedOperation(PkgOpNone), @@ -33,11 +35,13 @@ Package::Package(QByteArray name_, AAptInterface *apt_): Package::~Package() { - if( iIcon != 0 ) + if( iIcon ) { delete iIcon; + iIcon=0; + } } -QString Package::displayName() +QString Package::displayName() const { QString pkgname = name(); if( !iMaemoDisplayName.isEmpty() ) @@ -48,7 +52,7 @@ QString Package::displayName() return pkgname; } -QString Package::fileName() +QString Package::fileName() const { if( iFullFileNames.count()>0 ) { return iFullFileNames.at(0).mid( iFullFileNames.at(0).lastIndexOf('/')+1 ); @@ -88,7 +92,7 @@ void Package::convertIcon() } } -bool Package::isUpgradeable() +bool Package::isUpgradeable() const { if( iSection=="user/hidden" || iPinned ) return false; @@ -103,7 +107,7 @@ bool Package::isUpgradeable() return false; } -QString Package::upgradeableVersion() +QString Package::upgradeableVersion() const { QString ver; if( isInstalled() ) { @@ -114,7 +118,7 @@ QString Package::upgradeableVersion() return ver; } -Package* Package::availablePackage() +Package* Package::availablePackage() const { if( !isInstalled() ) return 0; @@ -141,7 +145,7 @@ Package::packageStatus Package::status() return iPkgStatus; } -bool Package::hasIconData() +bool Package::hasIconData() const { if( iIconData.length()>0 ) return true; @@ -176,7 +180,7 @@ QStringList Package::toTrimmedRichTextList(QList list_in) return list_out; } -QStringList Package::checkConflicts_RichText() +QStringList Package::checkConflicts_RichText() const { QStringList list; @@ -256,7 +260,7 @@ bool Package::versionConflicts(QString conflictVer, QString operVer) return confl; } -QString Package::maintainerRichText() +QString Package::maintainerRichText() const { QString m = iMaintainer; m.replace('<',"<"); diff --git a/package.h b/package.h index 0d8c5d9..1e0c108 100644 --- a/package.h +++ b/package.h @@ -34,8 +34,9 @@ public: // the order must match status filter strings enum packageStatus { PkgStatUnknown, PkgStatNotInstalled, PkgStatUpgradeable, PkgStatInstalled }; - Package(QByteArray name_, AAptInterface* apt_); - ~Package(); + explicit Package(QByteArray name_, AAptInterface* apt_); + virtual ~Package(); + inline void setName(QByteArray n_) { iName=n_; } inline void setMaemoDisplayName(QByteArray n_) { iMaemoDisplayName=n_; } inline void setInstalled(bool i_) { iIsInstalled=i_; } @@ -66,48 +67,50 @@ public: void convertIcon(); - inline QString name() { return iName; } - inline QString maemoDisplayName() { return QString::fromUtf8(iMaemoDisplayName); } - QString displayName(); - inline bool isInstalled() { return iIsInstalled; } - inline bool isMarkedForOperation() { return iMarkedForOperation; } - inline operation markedOperation() { return iMarkedOperation; } - inline QString version() { return iVersion; } - inline QString descShort() { return QString::fromUtf8(iDescriptionShort); } - inline QString descLong() { return QString::fromUtf8(iDescriptionLong); } - inline QString section() { return iSection; } - inline int size() { return iSize; } - inline int installedSize() { return iInstalledSize; } - inline QPixmap* icon() { return iIcon; } - bool hasIconData(); - bool isUpgradeable(); - QString upgradeableVersion(); - Package* availablePackage(); + inline QString name() const { return iName; } + inline QString maemoDisplayName() const { return QString::fromUtf8(iMaemoDisplayName); } + QString displayName() const; + inline bool isInstalled() const { return iIsInstalled; } + inline bool isMarkedForOperation() const { return iMarkedForOperation; } + inline operation markedOperation() const { return iMarkedOperation; } + inline QString version() const { return iVersion; } + inline QString descShort() const { return QString::fromUtf8(iDescriptionShort); } + inline QString descLong() const { return QString::fromUtf8(iDescriptionLong); } + inline QString section() const { return iSection; } + inline int size() const { return iSize; } + inline int installedSize() const { return iInstalledSize; } + inline QPixmap* icon() const { return iIcon; } + bool hasIconData() const; + bool isUpgradeable() const; + QString upgradeableVersion() const; + Package* availablePackage() const; packageStatus status(); - QString fileName(); - inline QStringList fullFileNames() { return iFullFileNames; } - inline QDateTime date() { return iDate; } - inline QList repositories() { return iRepositories; } - inline BlacklistSelect::blackList blacklisted() { return iBlacklist; } - inline bool isBlacklisted() { if(iBlacklist==BlacklistSelect::BlacklistNone) return false; else return true; } - inline QString upgradeDescription() { return QString::fromUtf8(iUpgradeDescription); } - inline QList depends() { return iDepends; } - inline QList conflicts() { return iConflicts; } - inline QList preDepends() { return iPreDepends; } - inline QList provides() { return iProvides; } - inline QList replaces() { return iReplaces; } - inline QList breaks() { return iBreaks; } - inline QList recommends() { return iRecommends; } - inline QList suggests() { return iSuggests; } - inline bool isPinned() { return iPinned; } - QString maintainerRichText(); - - QStringList checkConflicts_RichText(); + QString fileName() const; + inline QStringList fullFileNames() const { return iFullFileNames; } + inline QDateTime date() const { return iDate; } + inline QList repositories() const { return iRepositories; } + inline BlacklistSelect::blackList blacklisted() const { return iBlacklist; } + inline bool isBlacklisted() const { if(iBlacklist==BlacklistSelect::BlacklistNone) return false; else return true; } + inline QString upgradeDescription() const { return QString::fromUtf8(iUpgradeDescription); } + inline QList depends() const { return iDepends; } + inline QList conflicts() const { return iConflicts; } + inline QList preDepends() const { return iPreDepends; } + inline QList provides() const { return iProvides; } + inline QList replaces() const { return iReplaces; } + inline QList breaks() const { return iBreaks; } + inline QList recommends() const { return iRecommends; } + inline QList suggests() const { return iSuggests; } + inline bool isPinned() const { return iPinned; } + QString maintainerRichText() const; + + QStringList checkConflicts_RichText() const; static bool versionCompare(QString isNewer, QString compare); static QStringList toTrimmedRichTextList(QList list_in); private: + Package(const Package& old); + Package operator= (const Package& old); static bool versionConflicts(QString conflictVer, QString operVer); @@ -127,7 +130,7 @@ private: operation iMarkedOperation; QStringList iFullFileNames; QDateTime iDate; - QList iRepositories; + QList iRepositories; BlacklistSelect::blackList iBlacklist; QByteArray iUpgradeDescription; QByteArray iMaintainer; diff --git a/packageselector.h b/packageselector.h index ef37ee1..93b909c 100644 --- a/packageselector.h +++ b/packageselector.h @@ -37,7 +37,7 @@ class PackageSelector : public QDialog public: explicit PackageSelector(Package* pkg, AAptInterface* apt, Settings* set, QWidget *parent); - ~PackageSelector(); + virtual ~PackageSelector(); #ifdef Q_WS_MAEMO_5 // workaround for buggy Qt autorotation int exec() { @@ -56,6 +56,9 @@ protected: void changeEvent(QEvent *e); private: + PackageSelector(const PackageSelector& old); + PackageSelector operator= (const PackageSelector& old); + QString getMaemoOrgUrl(Package* pkg); void updateInfo(); void queryChangelog(); diff --git a/packageview.cpp b/packageview.cpp index 857cac6..326a92e 100644 --- a/packageview.cpp +++ b/packageview.cpp @@ -52,7 +52,7 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti int statfilter = index.data(UserRoleCurrentStatFilter).toInt(); int catfilter = index.data(UserRoleCurrentCatFilter).toInt(); QString upg_version = index.data(UserRoleAvailVersion).toString(); - BlacklistSelect::blackList blacklisted = (BlacklistSelect::blackList) index.data(UserRoleBlacklisted).toInt(); + BlacklistSelect::blackList blacklisted = static_cast( index.data(UserRoleBlacklisted).toInt() ); painter->save(); QRect r = option.rect; @@ -276,10 +276,10 @@ PackageView::PackageView(QWidget *parent) : QMainWindow(parent), ui(new Ui::Pack PackageView::~PackageView() { - delete iListCoverLabel; - delete iKeyFilter; - delete iDimmer; - delete ui; + delete iListCoverLabel; iListCoverLabel=0; + delete iKeyFilter; iKeyFilter=0; + delete iDimmer; iDimmer=0; + delete ui; ui=0; } void PackageView::orientationChanged() @@ -501,7 +501,7 @@ void PackageView::addListItem(Package* pkg_, QString listname_) { p->setData(UserRoleDescShort, pkg_->descShort()); p->setData(UserRoleVersion, pkg_->version()); - p->setData(UserRoleMarked, (int)pkg_->markedOperation()); + p->setData(UserRoleMarked, static_cast(pkg_->markedOperation()) ); p->setData(UserRoleInstalled, pkg_->isInstalled()); p->setData(UserRoleUpgradeable, pkg_->isUpgradeable()); p->setData(UserRoleAvailVersion, pkg_->upgradeableVersion()); @@ -509,11 +509,11 @@ void PackageView::addListItem(Package* pkg_, QString listname_) p->setData(UserRoleCurrentCatFilter, iSelectedCatFilter); if( pkg_->availablePackage() ) - p->setData(UserRoleBlacklisted, (int)pkg_->availablePackage()->blacklisted()); + p->setData(UserRoleBlacklisted, static_cast(pkg_->availablePackage()->blacklisted()) ); else - p->setData(UserRoleBlacklisted, (int)pkg_->blacklisted()); + p->setData(UserRoleBlacklisted, static_cast(pkg_->blacklisted()) ); - //qDebug()<name(); + //qDebug() << pkg_->name(); pkg_->convertIcon(); p->setData(Qt::DecorationRole, *pkg_->icon()); diff --git a/packageview.h b/packageview.h index ef9ac7c..6ffb5e8 100644 --- a/packageview.h +++ b/packageview.h @@ -56,13 +56,17 @@ private: class ListItemDelegate : public QStyledItemDelegate { public: - ListItemDelegate(QObject *parent=0) : QStyledItemDelegate (parent) { } + explicit ListItemDelegate(QObject *parent=0) : QStyledItemDelegate(parent) {} + virtual ~ListItemDelegate() {} void paint (QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const; void loadIcons(); private: + ListItemDelegate(const ListItemDelegate& old); + ListItemDelegate operator= (const ListItemDelegate& old); + QPixmap iDefaultIcon; QPixmap iIconPkgInstall; QPixmap iIconPkgUpgrade; @@ -82,7 +86,8 @@ public: enum sortOrder { SortAlpha, SortDateDesc, SortSizeDesc }; explicit PackageView(QWidget *parent = 0); - ~PackageView(); + virtual ~PackageView(); + void openWin(); void resizeEvent(QResizeEvent* event); void setAptInterface(AAptInterface* a_) { iAptInterface=a_; } @@ -132,6 +137,9 @@ protected: void closeEvent(QCloseEvent *event); private: + PackageView(const PackageView& old); + PackageView operator= (const PackageView& old); + bool doFilterCategory(Package* pkg); QString generateSortString(Package* pkg); void addListItem(Package* pkg_, QString listname_); diff --git a/repoedit.h b/repoedit.h index 2a14c31..6591093 100644 --- a/repoedit.h +++ b/repoedit.h @@ -35,7 +35,8 @@ class RepoEdit : public QDialog public: explicit RepoEdit(AAptInterface* apt, Repository* repo, int pos, QWidget *parent = 0); - ~RepoEdit(); + virtual ~RepoEdit(); + #ifdef Q_WS_MAEMO_5 // workaround for buggy Qt autorotation int exec() { QRect r = dynamic_cast(this->parent())->rect(); @@ -52,6 +53,9 @@ protected: void changeEvent(QEvent *e); private: + RepoEdit(const RepoEdit& old); + RepoEdit operator= (const RepoEdit& old); + Ui::RepoEdit *ui; Repository* iRepo; int iPos; diff --git a/repository.cpp b/repository.cpp index e688188..96a3b91 100644 --- a/repository.cpp +++ b/repository.cpp @@ -22,12 +22,15 @@ #include "package.h" #include "aaptinterface.h" -Repository::Repository() +Repository::Repository(): iEnabled(false) { - iEnabled = false; } -QString Repository::toString() +Repository::~Repository() +{ +} + +QString Repository::toString() const { QString str; if( iEnabled ) @@ -42,7 +45,7 @@ QString Repository::toString() return( str.trimmed() ); } -QStringList Repository::toListFileNames() +QStringList Repository::toListFileNames() const { QStringList names; diff --git a/repository.h b/repository.h index ec48f1b..e67c968 100644 --- a/repository.h +++ b/repository.h @@ -27,24 +27,28 @@ class AAptInterface; class Repository { public: - Repository(); + explicit Repository(); + virtual ~Repository(); void setName(QString n_) { iName=n_; } void setEnabled(bool e_) { iEnabled=e_; } - QString name() { return iName; } - QString url() { return iUrl; } - QString dir() { return iDir; } - QString dist() { return iDist; } - QString components() { return iComponents; } - bool enabled() { return iEnabled; } - QString toString(); - QStringList toListFileNames(); + QString name() const { return iName; } + QString url() const { return iUrl; } + QString dir() const { return iDir; } + QString dist() const { return iDist; } + QString components() const { return iComponents; } + bool enabled() const { return iEnabled; } + QString toString() const; + QStringList toListFileNames() const; bool setFromString(QString repo); void set(QString name, QString url, QString dir_dist, QString components, bool enabled); void set(QString name, QString url, QString dir, QString dist, QString components, bool enabled); private: + Repository(const Repository& old); + Repository operator= (const Repository& old); + QString iName; QString iUrl; QString iDir; diff --git a/repoview.h b/repoview.h index 15811d8..c8d8dd0 100644 --- a/repoview.h +++ b/repoview.h @@ -35,7 +35,8 @@ class RepoView : public QMainWindow public: explicit RepoView(QWidget *parent = 0); - ~RepoView(); + virtual ~RepoView(); + void setAptInterface(AAptInterface* a_) { iAptInterface = a_; } void openWin(); void closeEvent(QCloseEvent *event); @@ -64,6 +65,9 @@ protected: void changeEvent(QEvent *e); private: + RepoView(const RepoView& old); + RepoView operator= (const RepoView& old); + Ui::RepoView *ui; bool iModified; diff --git a/rotatingbackground.cpp b/rotatingbackground.cpp index b7e99a3..43d9db7 100644 --- a/rotatingbackground.cpp +++ b/rotatingbackground.cpp @@ -26,6 +26,10 @@ RotatingBackground::RotatingBackground(QWidget *parent) : connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged())); } +RotatingBackground::~RotatingBackground() +{ +} + void RotatingBackground::loadWallpaper() { /* diff --git a/rotatingbackground.h b/rotatingbackground.h index 9d6a05a..61ccf7b 100644 --- a/rotatingbackground.h +++ b/rotatingbackground.h @@ -27,6 +27,8 @@ class RotatingBackground : public QWidget Q_OBJECT public: explicit RotatingBackground(QWidget *parent = 0); + virtual ~RotatingBackground(); + void loadWallpaper(); void paintEvent(QPaintEvent *); void resizeEvent(QResizeEvent *); @@ -35,6 +37,9 @@ public slots: void orientationChanged(); private: + RotatingBackground(const RotatingBackground& old); + RotatingBackground operator= (const RotatingBackground& old); + QPixmap iWallpaperLandscape; QPixmap iWallpaperPortrait; }; diff --git a/searchoptions.h b/searchoptions.h index 5f3f0d3..669ed76 100644 --- a/searchoptions.h +++ b/searchoptions.h @@ -32,7 +32,7 @@ class SearchOptions : public QDialog public: explicit SearchOptions(QWidget *parent = 0); - ~SearchOptions(); + virtual ~SearchOptions(); void setSelections(bool pkgname, bool dispname, bool dshort, bool dlong); bool searchPkgName(); @@ -44,6 +44,9 @@ protected: void changeEvent(QEvent *e); private: + SearchOptions(const SearchOptions& old); + SearchOptions operator= (const SearchOptions& old); + Ui::SearchOptions *ui; }; diff --git a/settings.cpp b/settings.cpp index d8f826a..7f343fd 100644 --- a/settings.cpp +++ b/settings.cpp @@ -39,8 +39,8 @@ Settings::Settings(QWidget *parent) : Settings::~Settings() { iQSettings->sync(); - delete iQSettings; - delete ui; + delete iQSettings; iQSettings=0; + delete ui; ui=0; } void Settings::changeEvent(QEvent *e) diff --git a/settings.h b/settings.h index 8725f71..35656a7 100644 --- a/settings.h +++ b/settings.h @@ -36,7 +36,7 @@ class Settings : public QDialog public: explicit Settings(QWidget *parent = 0); - ~Settings(); + virtual ~Settings(); void openWin(); void setAptInterface(AAptInterface* apt) { iAptInterface=apt; } void setPackageView(PackageView* v_) { iPackageView=v_; } @@ -64,6 +64,9 @@ protected: void changeEvent(QEvent *e); private: + Settings(const Settings& old); + Settings operator= (const Settings& old); + Ui::Settings *ui; QSettings* iQSettings; AAptInterface* iAptInterface; @@ -71,8 +74,8 @@ private: private slots: void on_pushButton_searchOptions_clicked(); - void on_pushButton_picksound_clicked(); - void on_btn_OK_clicked(); + void on_pushButton_picksound_clicked(); + void on_btn_OK_clicked(); }; #endif // SETTINGS_H diff --git a/settings.ui b/settings.ui index 2af57c6..3d9f134 100644 --- a/settings.ui +++ b/settings.ui @@ -75,15 +75,9 @@ - - - - 0 - 0 - - + - Disable autorotation (lock to landscape) + Never auto-update catalogs @@ -123,18 +117,23 @@ after successful installation - + - Don't auto-update catalogs -(not recommended) + Always fetch changelogs when viewing +package info - + + + + 0 + 0 + + - Always fetch changelogs when viewing -package info + Disable autorotation (lock to landscape) diff --git a/sortselector.h b/sortselector.h index adb1941..af86ff9 100644 --- a/sortselector.h +++ b/sortselector.h @@ -33,7 +33,8 @@ class SortSelector : public QDialog public: explicit SortSelector(PackageView::sortOrder currOrder, QWidget *parent = 0); - ~SortSelector(); + virtual ~SortSelector(); + #ifdef Q_WS_MAEMO_5 // workaround for buggy Qt autorotation int exec() { QRect r = dynamic_cast(this->parent())->rect(); @@ -50,6 +51,9 @@ protected: void changeEvent(QEvent *e); private: + SortSelector(const SortSelector& old); + SortSelector operator= (const SortSelector& old); + Ui::SortSelector *ui; };