author | zecke <zecke> | 2002-06-23 14:19:13 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-23 14:19:13 (UTC) |
commit | ce9178fb13908eca5b7835e785fc0914a5022615 (patch) (side-by-side diff) | |
tree | d848ef07fb25ba6c21d3729140c4e3be9d69f6f6 /noncore/unsupported | |
parent | 3b02ead2254e59159db948d2a0980892eeb14ed8 (diff) | |
download | opie-ce9178fb13908eca5b7835e785fc0914a5022615.zip opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.gz opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.bz2 |
Simon thanks for the patch. Some clean ups. Patch provided by tronical
OAOAOAOAOAOAOAOAOAOAOAOAOBOBCVS: noncore/tools/remote/dvdgroupconf.cpp
-rw-r--r-- | noncore/unsupported/mail2/libmail/imaphandler.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistdoclnk.cpp | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/qpdf/fixed.h | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.cpp b/noncore/unsupported/mail2/libmail/imaphandler.cpp index 730a004..7493240 100644 --- a/noncore/unsupported/mail2/libmail/imaphandler.cpp +++ b/noncore/unsupported/mail2/libmail/imaphandler.cpp @@ -141,65 +141,65 @@ QString IMAPHandler::iList(const QString &reference, const QString &mailbox) { doLogin(); _ibase->sendCommand(QString("%1 LIST \"%2\" \"%3\"\r\n") .arg(tag()) .arg(escape(reference)) .arg(escape(mailbox))); return tag(false); } QString IMAPHandler::iLsub(const QString &reference, const QString &mailbox) { doLogin(); _ibase->sendCommand(QString("%1 LSUB \"%2\" \"%3\"\r\n") .arg(tag()) .arg(escape(reference)) .arg(escape(mailbox))); return tag(false); } QString IMAPHandler::iStatus(const QString &mailbox, const QString &items) { doLogin(); _ibase->sendCommand(QString("%1 STATUS \"%2\" (%3)\r\n") .arg(tag()) .arg(escape(mailbox)) .arg(escape(items))); return tag(false); } -QString IMAPHandler::iAppend(const QString &mailbox, const QString &literal, const QString &flags, const QString &datetime = 0) +QString IMAPHandler::iAppend(const QString &mailbox, const QString &literal, const QString &flags, const QString &datetime) { doLogin(); _ibase->sendCommand(QString("%1 APPEND \"%2\" (%3) \"%4\" {%5}\r\n%6\r\n") .arg(tag()) .arg(escape(mailbox)) .arg(flags) .arg(escape(datetime)) .arg(literal.length()) .arg(literal)); return tag(false); } QString IMAPHandler::iCheck() { doLogin(); _ibase->sendCommand(QString("%1 CHECK\r\n") .arg(tag())); return tag(false); } QString IMAPHandler::iClose() { doLogin(); _ibase->sendCommand(QString("%1 CLOSE\r\n") .arg(tag())); return tag(false); } QString IMAPHandler::iExpunge() diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 7df1d6b..05f2f06 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp @@ -2,65 +2,65 @@ #include "mainwindow.h" #include <qpe/qpemenubar.h> #include <qpe/qpemessagebox.h> #include <qpe/resource.h> #include <qpe/config.h> #include <qpe/qpetoolbar.h> #include <qpe/qcopenvelope_qws.h> #include <qaction.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qtoolbutton.h> #include <qstring.h> #include <qlabel.h> #include <qfile.h> #include <qlistview.h> #include <qtextview.h> #include <qcheckbox.h> #include <qlineedit.h> #include <qtabwidget.h> #include <qcombobox.h> #include <qmessagebox.h> #include <qpushbutton.h> #include <qlayout.h> #include "pksettingsbase.h" #include "utils.h" #include "packagelistitem.h" -MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : +MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : QMainWindow( parent, name, f ) // packageListServers( QObject(parent), name ), // packageListSearch( parent, name ), // packageListDocLnk( parent, name ) { setCaption( tr("Package Manager") ); settings = new PackageManagerSettings(this,0,TRUE); listViewPackages = new PackageListView( this,"listViewPackages",settings ); setCentralWidget( listViewPackages ); listViewPackages->addList( tr("feeds"), &packageListServers ); listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); //listViewPackages->addList( tr("documents"), &packageListDocLnk ); ipkg = new PmIpkg( settings, this ); packageListServers.setSettings( settings ); packageListSearch.setSettings( settings ); packageListDocLnk.setSettings( settings ); pvDebug(9,"packageListServers.update"); packageListServers.update(); pvDebug(9,"packageListDocLnk.update"); pvDebug(0,"no UPDATE of DocLnk"); // packageListDocLnk.update(); pvDebug(9,"makeMenu"); makeMenu(); makeChannel(); //opie is hardcoded default ;) // pvDebug(9,"section->setCurrentItem"); // for (int i=0;i<section->count();i++) // if (section->text(i)=="opie") // section->setCurrentItem(i); // sectionChanged(); connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 97f7813..517b37a 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp @@ -1,101 +1,101 @@ #include "package.h" #include <qpe/process.h> #include <qpe/stringutil.h> #include <qfile.h> #include <qtextstream.h> #include <stdlib.h> #include <unistd.h> #include "debug.h" -Package::Package( QObject *parent=0, const char *name=0 ) +Package::Package( QObject *parent, const char *name ) : QObject(parent,name) { } Package::~Package() { } -Package::Package( PackageManagerSettings *s, QObject *parent=0, const char *name=0 ) +Package::Package( PackageManagerSettings *s, QObject *parent, const char *name ) : QObject(parent,name) { Package(parent,name); init(s); } void Package::init( PackageManagerSettings *s ) { settings = s; _size = ""; _section = ""; _subsection = ""; _shortDesc = ""; _desc = ""; _name = ""; _toProcess = false; _useFileName = false; _old = false; _status = ""; _dest = settings->getDestinationName(); _link = settings->createLinks(); _versions=0; _version=""; } -Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent=0, const char *name=0 ) +Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) : QObject(parent,name) { init(s); parsePackage( pack ); } -Package::Package( QString n, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ) +Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) { init(s); if ( !QFile::exists( n ) ) { _name = QString( n ); }else{ pvDebug(4,"remote file: "+n); parseIpkgFile( n ); _useFileName = true; _fileName = QString( n ); } } -Package::Package( Package *pi, QObject *parent=0, const char *name=0 ) +Package::Package( Package *pi, QObject *parent, const char *name ) { init(pi->settings); copyValues( pi ); } void Package::setValue( QString n, QString t ) { if ( n == "Package" ) { _name = QString( t ); }else if ( n == "Installed-Size" ) { _size = t; // }else if ( n == "Priority") // { }else if ( n == "Section") { setSection( t ); // }else if ( n == "Maintainer") // { // // }else if ( n == "Architecture") // { }else if ( n == "Version") { _version = t; // }else if ( n == "Pre-Depends") // { // diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 3cc0443..e445570 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp @@ -1,45 +1,45 @@ #include "packagelist.h" #include <assert.h> #include <qfile.h> #include <qfileinfo.h> #include <qtextstream.h> #include "debug.h" static QDict<Package> *packageListAll; static int packageListAllRefCount = 0; -PackageList::PackageList(QObject *parent=0, const char *name=0) +PackageList::PackageList(QObject *parent, const char *name) : QObject(parent,name), packageIter( packageList ) { empty=true; if (!packageListAll) packageListAll = new QDict<Package>(); packageListAllRefCount++; sections << "All"; subSections.insert("All", new QStringList() ); QStringList *ss = subSections["All"]; *ss << "All"; aktSection = "All"; aktSubSection = "All"; } PackageList::PackageList( PackageManagerSettings* s, QObject *parent, const char *name) : QObject(parent,name), packageIter( packageList ) { settings = s; PackageList(parent, name); } PackageList::~PackageList() { if (--packageListAllRefCount < 1 ) delete packageListAll; } /** Inserts a package into the list */ void PackageList::insertPackage( Package* pack ) { if (!pack) return; Package* p = packageListAll->find( pack->name() ); if ( p ) { @@ -168,54 +168,54 @@ void PackageList::readFileEntries( QString filename, QString dest ) QTextStream *statusStream = new QTextStream( &f ); while ( !statusStream ->eof() ) { QString line = statusStream->readLine(); if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) { //end of package if ( ! packEntry.isEmpty() ) { Package *p = new Package( packEntry, settings ); if ( p ) { p->setDest( dest ); insertPackage( p ); packEntry.clear(); } } }else{ packEntry << line; }; } delete statusStream; return; } void PackageList::setSettings( PackageManagerSettings *s ) { settings = s; } Package* PackageList::getByName( QString n ) { - origPackageList[n]; + return origPackageList[n]; } void PackageList::clear() { origPackageList.clear(); packageList.clear(); } void PackageList::allPackages() { packageList.clear(); QDictIterator<Package> filterIter( origPackageList ); filterIter.toFirst(); Package *pack= filterIter.current() ; while ( pack ) { packageList.insert( pack->name(), pack ); ++filterIter; pack = filterIter.current(); } } diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp index b42cfdd..deb8a6d 100644 --- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp +++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp @@ -1,45 +1,45 @@ #include "packagelistdoclnk.h" #include <qpe/applnk.h> #include <qpe/config.h> #include <qlist.h> #include "package.h" #include "pksettings.h" -PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent=0, const char *name=0) +PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent, const char *name) : PackageList(s) { PackageListDocLnk(parent, name); } -PackageListDocLnk::PackageListDocLnk(QObject *parent=0, const char *name=0) +PackageListDocLnk::PackageListDocLnk(QObject *parent, const char *name) : PackageList(parent, name) { Config cfg( "oipkg", Config::User ); cfg.setGroup( "Common" ); docLnkDir = cfg.readEntry( "docLnkDir", "/root/" ); pvDebug(2,"opening DocLnkSet "+docLnkDir); doclnkset = new DocLnkSet(docLnkDir,"application/ipkg"); } PackageListDocLnk::~PackageListDocLnk() { Config cfg( "oipkg", Config::User ); cfg.setGroup( "Common" ); cfg.writeEntry( "docLnkDir", docLnkDir ); delete doclnkset; } void PackageListDocLnk::update() { pvDebug(2,"PackageListDocLnk::update "); QList<DocLnk> packlist = doclnkset->children(); for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) { insertPackage( new Package(pack->file(), settings ) ); } } diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 0c9c676..7c54441 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp @@ -130,37 +130,37 @@ QPixmap PackageListItem::statePixmap() const QString PackageListItem::key( int column, bool ascending ) const { if ( column == 2 ) { QString t = text(2); double bytes=t.toDouble(); if ( t.contains('M') ) bytes*=1024*1024; else if ( t.contains('K') || t.contains('k') ) bytes*=1024; if ( !ascending ) bytes=999999999-bytes; return QString().sprintf("%09d",(int)bytes); } else { return QListViewItem::key(column,ascending); } } void PackageListItem::setOn( bool b ) { QCheckListItem::setOn( b ); package->toggleProcess(); package->setLink( settings->createLinks() ); displayDetails(); } void PackageListItem::displayDetails() { QString sod; sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits()); //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest()); sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); sod = sod.isEmpty()?QString(""):QString(" ("+sod+")"); setText(0, package->name()+sod ); nameItem->setText( 0, QObject::tr("Name: ")+package->name()); - linkItem->setText( 0, QObject::tr("Link: ")+package->link()?QObject::tr("Yes"):QObject::tr("No")); + linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No"))); destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); statusItem->setText( 0, QObject::tr("Status: ")+package->status() ); repaint(); } diff --git a/noncore/unsupported/qpdf/fixed.h b/noncore/unsupported/qpdf/fixed.h index d073421..ec0e696 100644 --- a/noncore/unsupported/qpdf/fixed.h +++ b/noncore/unsupported/qpdf/fixed.h @@ -140,52 +140,52 @@ template <unsigned int SH> inline fixed<SH> operator * ( double d, const fixed<S template <unsigned int SH> inline fixed<SH> operator / ( double d, const fixed<SH> &f ) { return fixed<SH> ( fixed<SH>::mul ( fixed<SH>::d2f( d ), f. m_f ), true ); } template <unsigned int SH> inline bool operator < ( double d, const fixed<SH> &f ) { return fixed<SH>::d2f( d ) < f. m_f; } template <unsigned int SH> inline bool operator > ( double d, const fixed<SH> &f ) { return fixed<SH>::d2f( d ) > f. m_f; } template <unsigned int SH> inline bool operator <= ( double d, const fixed<SH> &f ) { return fixed<SH>::d2f( d ) <= f. m_f; } template <unsigned int SH> inline bool operator >= ( double d, const fixed<SH> &f ) { return fixed<SH>::d2f( d ) >= f. m_f; } template <unsigned int SH> inline bool operator == ( double d, const fixed<SH> &f ) { return fixed<SH>::d2f( d ) == f. m_f; } template <unsigned int SH> inline bool operator != ( double d, const fixed<SH> &f ) { return fixed<SH>::d2f( d ) != f. m_f; } template <unsigned int SH> inline bool operator < ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) < f. m_f; } template <unsigned int SH> inline bool operator > ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) > f. m_f; } template <unsigned int SH> inline bool operator <= ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) <= f. m_f; } template <unsigned int SH> inline bool operator >= ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) >= f. m_f; } template <unsigned int SH> inline bool operator == ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) == f. m_f; } template <unsigned int SH> inline bool operator != ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) != f. m_f; } template <unsigned int SH> inline long int lrint ( const fixed<SH> &f ) { return fixed<SH>::f2i (( f. m_f < 0 ) ? f. m_f - ( 1 << ( SH - 1 )) : f. m_f + ( 1 << ( SH - 1 ))); } template <unsigned int SH> inline fixed<SH> fabs ( const fixed<SH> &f ) { return ( f. m_f < 0 ) ? fixed<SH> ( -f. m_f, true ) : f; } // roughly from QPE / qmath.h template <unsigned int SH> inline fixed<SH> sqrt ( const fixed<SH> &f ) { if ( f. m_f <= 0 ) return fixed<SH> ( 0, true ); - fixed<SH>::fix_t a0 = 0; - fixed<SH>::fix_t a1 = f. m_f; // take value as first approximation + typename fixed<SH>::fix_t a0 = 0; + typename fixed<SH>::fix_t a1 = f. m_f; // take value as first approximation do { a0 = a1; a1 = ( a0 + fixed<SH>::div ( f. m_f, a0 )) >> 1; } while ( abs ( fixed<SH>::div ( a1 - a0, a1 )) > 1 ); return fixed<SH> ( a1, true ); } #if 0 // no std::ostream needed in OPIE template <unsigned int SH> inline std::ostream &operator << ( std::ostream &o, const fixed<SH> &f ) { o << double( f ); return o; } #endif #endif |