You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(98) |
Sep
(138) |
Oct
(100) |
Nov
(49) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(94) |
Feb
(65) |
Mar
(100) |
Apr
(83) |
May
(72) |
Jun
(29) |
Jul
(167) |
Aug
(127) |
Sep
(131) |
Oct
(269) |
Nov
(122) |
Dec
(100) |
2005 |
Jan
(228) |
Feb
(266) |
Mar
(63) |
Apr
(135) |
May
(157) |
Jun
(52) |
Jul
(25) |
Aug
(49) |
Sep
(184) |
Oct
(159) |
Nov
(75) |
Dec
(37) |
2006 |
Jan
(60) |
Feb
(129) |
Mar
(110) |
Apr
(34) |
May
(31) |
Jun
(42) |
Jul
(72) |
Aug
(90) |
Sep
(57) |
Oct
(66) |
Nov
(42) |
Dec
(90) |
2007 |
Jan
(106) |
Feb
(54) |
Mar
(93) |
Apr
(27) |
May
(21) |
Jun
(17) |
Jul
(19) |
Aug
(22) |
Sep
(25) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2008 |
Jan
(65) |
Feb
(70) |
Mar
(29) |
Apr
(45) |
May
(91) |
Jun
(20) |
Jul
(11) |
Aug
(24) |
Sep
(23) |
Oct
(13) |
Nov
(23) |
Dec
(39) |
2009 |
Jan
(23) |
Feb
(39) |
Mar
(15) |
Apr
(56) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Shie E. <er...@us...> - 2004-09-19 11:47:54
|
Update of /cvsroot/krusader/krusader_kde3/krusader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19742/krusader Modified Files: krusader.cpp Log Message: BSD fixes Index: krusader.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/krusader.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** krusader.cpp 17 Sep 2004 13:02:50 -0000 1.88 --- krusader.cpp 19 Sep 2004 11:47:45 -0000 1.89 *************** *** 30,33 **** --- 30,38 ---- #include <sys/types.h> #include <sys/stat.h> + #include <sys/param.h> + #ifdef BSD + #include <unistd.h> + #include <sys/types.h> + #endif // KDE includes #include <kmessagebox.h> |
From: Shie E. <er...@us...> - 2004-09-19 11:47:54
|
Update of /cvsroot/krusader/krusader_kde3/krusader/VFS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19742/krusader/VFS Modified Files: ftp_vfs.cpp Log Message: BSD fixes Index: ftp_vfs.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/VFS/ftp_vfs.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ftp_vfs.cpp 28 Aug 2004 20:28:16 -0000 1.35 --- ftp_vfs.cpp 19 Sep 2004 11:47:44 -0000 1.36 *************** *** 31,34 **** --- 31,39 ---- // Sys includes #include <time.h> + #include <sys/param.h> + #ifdef BSD + #include <unistd.h> + #include <sys/types.h> + #endif // QT includes #include <qdir.h> |
From: Shie E. <er...@us...> - 2004-09-19 11:47:54
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Panel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19742/krusader/Panel Modified Files: listpanel.cpp Log Message: BSD fixes Index: listpanel.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/listpanel.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** listpanel.cpp 17 Sep 2004 17:31:13 -0000 1.88 --- listpanel.cpp 19 Sep 2004 11:47:45 -0000 1.89 *************** *** 29,32 **** --- 29,33 ---- ***************************************************************************/ + #include <sys/param.h> // QT includes #include <qbitmap.h> |
From: Shie E. <er...@us...> - 2004-09-17 17:43:04
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/krusader/MountMan Modified Files: kmountman.cpp Log Message: error handling was missing Index: kmountman.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountman.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** kmountman.cpp 17 Sep 2004 17:35:09 -0000 1.34 --- kmountman.cpp 17 Sep 2004 17:42:49 -0000 1.35 *************** *** 35,40 **** #include <kprocess.h> //#include <kprocctrl.h> - #include <kio/jobclasses.h> - #include <kio/job.h> #include <klocale.h> #include <kpopupmenu.h> --- 35,38 ---- *************** *** 84,87 **** --- 82,90 ---- } + void KMountMan::jobResult(KIO::Job *job) { + if ( job->error() ) + job->showErrorDialog( 0 ); + } + void KMountMan::mount( QString mntPoint ) { KMountPoint::List possible = KMountPoint::possibleMountPoints(KMountPoint::NeedMountOptions); *************** *** 89,96 **** --- 92,101 ---- if (!m) return; KIO::SimpleJob *job = KIO::mount(false, m->mountType().local8Bit(), m->mountedFrom(), m->mountPoint()); + connect(job, SIGNAL(result(KIO::Job* )), this, SLOT(jobResult(KIO::Job* ))); } void KMountMan::unmount( QString mntPoint ) { KIO::SimpleJob *job = KIO::unmount(mntPoint); + connect(job, SIGNAL(result(KIO::Job* )), this, SLOT(jobResult(KIO::Job* ))); } |
From: Shie E. <er...@us...> - 2004-09-17 17:42:21
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14468/krusader/MountMan Modified Files: kmountman.h Log Message: error handling was missing Index: kmountman.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountman.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** kmountman.h 17 Sep 2004 17:36:08 -0000 1.14 --- kmountman.h 17 Sep 2004 17:42:12 -0000 1.15 *************** *** 37,40 **** --- 37,42 ---- // KDE includes #include <kdeversion.h> + #include <kio/jobclasses.h> + #include <kio/job.h> #include <kio/global.h> #include <kmountpoint.h> *************** *** 71,74 **** --- 73,79 ---- void quickList(); + protected slots: + void jobResult(KIO::Job *job); + protected: // used internally |
From: Shie E. <er...@us...> - 2004-09-17 17:37:14
|
Update of /cvsroot/krusader/krusader_kde3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13344 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/ChangeLog,v retrieving revision 1.302 retrieving revision 1.303 diff -C2 -d -r1.302 -r1.303 *** ChangeLog 16 Sep 2004 17:18:35 -0000 1.302 --- ChangeLog 17 Sep 2004 17:37:04 -0000 1.303 *************** *** 1,3 **** --- 1,4 ---- ====================== + ADDED: mountman got a big nose-job ;-) plz test ADDED: dropping on the tree panel (copy,move,link) ADDED: packing / unpacking to/from remote URL-s |
From: Shie E. <er...@us...> - 2004-09-17 17:36:44
|
Update of /cvsroot/krusader/krusader_kde3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13238 Modified Files: CVSNEWS Log Message: Index: CVSNEWS =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/CVSNEWS,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CVSNEWS 14 Sep 2004 22:15:20 -0000 1.13 --- CVSNEWS 17 Sep 2004 17:36:35 -0000 1.14 *************** *** 3,6 **** --- 3,8 ---- in some way an extension to the changelog. ------------------------------------------------------ + Mountman got a big nose-job ;-) plz test it well. + you can now drag'n'drop to the new tree view |
From: Shie E. <er...@us...> - 2004-09-17 17:36:18
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13114/krusader/MountMan Modified Files: kmountman.h Log Message: new mountman Index: kmountman.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountman.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** kmountman.h 17 Sep 2004 13:05:41 -0000 1.13 --- kmountman.h 17 Sep 2004 17:36:08 -0000 1.14 *************** *** 34,54 **** #include <qobject.h> #include <qstring.h> ! #include <qframe.h> ! #include <qptrlist.h> // KDE includes - #include <kdiskfreesp.h> #include <kdeversion.h> - #include <kprocess.h> - #include <kjanuswidget.h> - #include <kio/jobclasses.h> #include <kio/global.h> ! #include <ktempfile.h> // krusader includes #include <stdlib.h> #include <math.h> - // forward definitions - class fsData; - class KMountMan : public QObject { Q_OBJECT --- 34,47 ---- #include <qobject.h> #include <qstring.h> ! // KDE includes #include <kdeversion.h> #include <kio/global.h> ! #include <kmountpoint.h> ! // krusader includes #include <stdlib.h> #include <math.h> class KMountMan : public QObject { Q_OBJECT *************** *** 61,68 **** return Operational; } // check this 1st ! inline bool ready() { ! return Ready; ! } // poll on this until true ! void mainWindow(); // opens up the GUI void mount( QString mntPoint ); // this is probably what you need for mount void unmount( QString mntPoint ); // this is probably what you need for unmount --- 54,59 ---- return Operational; } // check this 1st ! ! void mainWindow(); // opens up the GUI void mount( QString mntPoint ); // this is probably what you need for mount void unmount( QString mntPoint ); // this is probably what you need for unmount *************** *** 73,83 **** QString convertSize( KIO::filesize_t size ); - QString getMtab(); // reads the mount table - bool checkMtabChanged(); // checks whether mtab was changed - - - //////////////////////////// service functions ///////////////////////////////// - static QString nextWord( QString &s ); - static QString nextWord( QString &s, char c ); KMountMan(); ~KMountMan(); --- 64,67 ---- *************** *** 87,218 **** void quickList(); - private: - QString *_actions; - - protected slots: - void parseDfData( QString filename ); // parse a FULL list of filesystems - void forceUpdate(); - void collectOutput( KProcess *p, char *buffer, int buflen ); - void collectMtab( KProcess *p, char *buffer, int buflen ); - void finishUpdateFilesystems(); - void killMountMan(); // called when df never finished (error) - - signals: - void updated(); - protected: ! void mount( fsData *p ); // you don't want to call this one ! ! void unmount( fsData *p ); // you don't want to call this one ! ! void toggleMount( QString mntPoint ); // you don't want to call this one ! ! QString followLink( QString source ); // internal to mountman/gui ! bool createFilesystems(); // potential filesystems from /etc/fstab ! void updateFilesystems(); // actually mounted systems using DF -T -P ! QString getDevice( QString mntPoint ); // mntPoint ==> device ! fsData* location( QString name ); // device ==> mntPoint ! QString pointFromMtab( QString device ); // returns mountPoint for a device ! QString devFromMtab( QString mntPoint ); // returns device for a mountPoint ! private: ! void clearOutput(); ! inline QString getOutput() { ! return QString( ( !outputBuffer ? ! QString::null : *outputBuffer ) ); ! } private: - QStringList mountPoints; // all mountPoints excluding SUPERMOUNTED ones - QList<fsData> filesystems; - int noOfFilesystems; - bool Ready; // true if MountMan finished all preprocessing bool Operational; // if false, something went terribly wrong on startup - fsData *localDf; // used for moving around information - QString *outputBuffer; // all processes output their data here - KTempFile *tempFile; - KShellProcess dfProc; KMountManGUI *mountManGui; - - QString mtab; // the mount table - }; - - // Data container for a single-filesystem data - // maximum size supported is 2GB of 1kb blocks == 2048GB, enough. - ///////////////////////////////////////////////////////////////// - class fsData { - public: - fsData() : Name( 0 ), Type( 0 ), MntPoint( 0 ), TotalBlks( 0 ), - FreeBlks( 0 ), Mounted( false ) {} - - // get information - inline QString name() { - return Name; - } - inline QString shortName() { - return Name.right( Name.length() - Name.find( "/", 1 ) - 1 ); - } - inline QString type() { - return Type; - } - inline QString mntPoint() { - return MntPoint; - } - inline long totalBlks() { - return TotalBlks; - } - inline long freeBlks() { - return FreeBlks; - } - inline KIO::filesize_t totalBytes() { - return TotalBlks * 1024; - } - inline KIO::filesize_t freeBytes() { - return FreeBlks * 1024; - } - //////////////////// insert a good round function here ///////////////// - int usedPerct() { - if ( TotalBlks == 0 ) - return 0; - float res = ( ( float ) ( TotalBlks - FreeBlks ) ) / ( ( float ) TotalBlks ) * 100; - if ( ( res - ( int ) res ) > 0.5 ) - return ( int ) res + 1; - else - return ( int ) res; - } - inline bool mounted() { - return Mounted; - } - - // set information - inline void setName( QString n_ ) { - Name = n_; - } - inline void setType( QString t_ ) { - Type = t_; - } - inline void setMntPoint( QString m_ ) { - MntPoint = m_; - } - inline void setTotalBlks( long t_ ) { - TotalBlks = t_; - } - inline void setFreeBlks( long f_ ) { - FreeBlks = f_; - } - inline void setMounted( bool m_ ) { - Mounted = m_; - } - - private: - QString Name; // i.e: /dev/cdrom - QString Type; // i.e: iso9600 - QString MntPoint; // i.e: /mnt/cdrom - long TotalBlks; // measured in 1024bytes per block - long FreeBlks; - bool Mounted; // true if filesystem is mounted - - // additional attributes of a filesystem, parsed from fstab - public: - bool supermount; // is the filesystem supermounted ? - QString options; // additional fstab options - }; --- 71,85 ---- void quickList(); protected: ! // used internally ! static KMountPoint *findInListByMntPoint(KMountPoint::List &lst, QString value); ! void toggleMount( QString mntPoint ); ! private: ! QString *_actions; private: bool Operational; // if false, something went terribly wrong on startup KMountManGUI *mountManGui; }; |
From: Shie E. <er...@us...> - 2004-09-17 17:35:20
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12942/krusader/MountMan Modified Files: kmountman.cpp Log Message: new mountman Index: kmountman.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountman.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** kmountman.cpp 17 Sep 2004 13:05:19 -0000 1.33 --- kmountman.cpp 17 Sep 2004 17:35:09 -0000 1.34 *************** *** 31,55 **** #include <time.h> #include "kmountman.h" - // QT incldues - #include <qcstring.h> - #include <qfileinfo.h> - #include <qtextstream.h> - #include <qfile.h> - #include <qtimer.h> - #include <qdir.h> // KDE includes #include <kmessagebox.h> #include <kprocess.h> ! #include <kprocctrl.h> #include <kio/job.h> #include <klocale.h> #include <kpopupmenu.h> - #if KDE_IS_VERSION(3,2,0) - #include <kmountpoint.h> - #endif - // Krusader includes - #include "../resources.h" #include "../krusader.h" #include "../Dialogs/krdialogs.h" --- 31,44 ---- #include <time.h> #include "kmountman.h" // KDE includes #include <kmessagebox.h> #include <kprocess.h> ! //#include <kprocctrl.h> ! #include <kio/jobclasses.h> #include <kio/job.h> #include <klocale.h> #include <kpopupmenu.h> // Krusader includes #include "../krusader.h" #include "../Dialogs/krdialogs.h" *************** *** 64,98 **** #endif ! #define DF_WAIT_TIME 60 ! ! bool dfStartFailed = false; ! ! KMountMan::KMountMan() : QObject(), Ready( false ), Operational( false ), ! outputBuffer( 0 ), tempFile( 0 ), mountManGui( 0 ), mtab( "" ) { ! #if KDE_IS_VERSION(3,2,0) _actions = 0L; - #endif /* KDE 3.2 */ ! filesystems.setAutoDelete( true ); ! localDf = new fsData(); // will be used to move around information ! forceUpdate(); } KMountMan::~KMountMan() {} - // find the next word delimited by 'c' - QString KMountMan::nextWord( QString &s, char c ) { - s = s.stripWhiteSpace(); - int j = s.find( c, 0 ); - if ( j == -1 ) { // if the delimiter wasn't found, return the entire - QString tmp = s; // input, clearing the original string, to indicate - s = ""; // that the whole input was taken - return tmp; - } - QString temp = s.left( j ); // find the leftmost word. - s.remove( 0, j ); - return temp; - } - void KMountMan::mainWindow() { mountManGui = new KMountManGUI(); --- 53,70 ---- #endif ! KMountMan::KMountMan() : QObject(), Operational( false ), mountManGui( 0 ) { _actions = 0L; ! // added as a precaution, although we use kde services now ! if( !KrServices::cmdExist( "df" ) || !KrServices::cmdExist( "mount" ) ) { ! Operational = false; ! } else { ! Operational = true; ! } ! } KMountMan::~KMountMan() {} void KMountMan::mainWindow() { mountManGui = new KMountManGUI(); *************** *** 101,450 **** } ! // this version find the next word, delimeted by anything from ! // comma, space, tab or newline, in this order ! QString KMountMan::nextWord( QString &s ) { ! s = s.stripWhiteSpace(); ! int j; ! j = s.find( ',', 0 ); ! if ( j == -1 ) ! j = s.find( ' ', 0 ); ! if ( j == -1 ) ! j = s.find( '\t', 0 ); ! if ( j == -1 ) ! j = s.find( '\n', 0 ); ! // one of the above must have made j>0, if something went wrong, ! // we return the entire input, clearing the original string ! if ( j == -1 ) { ! QString tmp = s; ! s = ""; ! return tmp; ! } ! QString temp = s.left( j ); // find the leftmost word. ! s.remove( 0, j ); ! ! return temp; ! } ! ! QString KMountMan::followLink( QString source ) { ! // ugly hack - disable link following because of devfs ! return source; ! ! QFileInfo temp( source ); ! // if the file doesn't exist and it contains //, it's probably a samba share ! // <patch> thanks to Cristi Dumitrescu ! if ( !temp.exists() && temp.filePath().contains( "//" ) > 0 ) ! return source; ! while ( temp.isSymLink() ) ! temp.setFile( temp.readLink() ); ! return temp.fileName(); ! } ! ! bool KMountMan::createFilesystems() { ! QString temp[ 5 ][ 100 ]; // a temporary array which allows parsing of upto 100 fs ! QString dumb; // my very-own dumb pipe: nothing goes out of it :-) ! QString s; ! int i = 0, j = 0; ! ! noOfFilesystems = 0; ! // if |filesystems|>0, than we are re-creating, delete the old list ! if ( filesystems.count() > 0 ) ! while ( filesystems.removeLast() ) ! ; ! // open the /etc/fstab file... ! QFile fstab( FSTAB ); ! if ( !fstab.open( IO_ReadOnly ) ) { ! kdWarning() << "Mt.Man: Unable to read " << QString( FSTAB ) << " !!! Shutting down. (sorry)" << endl; ! return false; ! } ! // and read it into the temporary array ! QTextStream t( &fstab ); ! //kdWarning() << "debug: createFilesystems" << endl; ! while ( !fstab.atEnd() ) { ! s = t.readLine(); ! s = s.simplifyWhiteSpace(); // remove TABs ! if ( s == QString::null || s == "" ) ! continue; // skip empty lines in fstab ! // temp[0]==name, temp[1]==type, temp[2]==mount point, temp[3]==options ! // temp[4] is reserved for special cases, right now, only for supermount ! //kdWarning() << "debug: " << s << endl; ! bool remark = false; ! ( temp[ 0 ][ i ] ) = nextWord( s, ' ' ); ! #if defined(_OS_SOLARIS_) ! ! nextWord( s, ' ' ); ! #endif ! ! ( temp[ 2 ][ i ] ) = nextWord( s, ' ' ); ! ( temp[ 1 ][ i ] ) = nextWord( s, ' ' ); ! #if !defined(_OS_SOLARIS_) ! ! ( temp[ 3 ][ i ] ) = nextWord( s, ' ' ); ! #endif ! // now, we check if a remark was inserted in the line ! for ( int cnt = 0; cnt < 3; ++cnt ) ! if ( temp[ cnt ][ i ] == "#" || temp[ cnt ][ i ].left( 1 ) == "#" ) { ! //kdDebug() << "MountMan: found a remark in fstab, skipping the line." << endl; ! remark = true; ! break; ! } ! // if the filesystem is supermount, then the whole fstab is not like ! // we expected, so alterations must be made... mucho work... ! if ( temp[ 1 ][ i ] == "supermount" ) { ! temp[ 4 ][ i ] = "supermount"; // mark the filesystem ! // temp[3][i] holds the entire 'options' string ! QString t = ( temp[ 3 ][ i ] ).mid( ( temp[ 3 ][ i ] ).find( "fs=", 0 ) + 3 ); ! temp[ 1 ][ i ] = nextWord( t ); ! t = ( temp[ 3 ][ i ] ).mid( ( temp[ 3 ][ i ] ).find( "dev=", 0 ) + 4 ); ! temp[ 0 ][ i ] = nextWord( t ); ! // now we have to cut temp[3][i] down to remove supermount info from it ! int i1 = ( temp[ 3 ][ i ] ).find( "fs=", 0 ) + 3; ! int i2 = ( temp[ 3 ][ i ] ).find( "dev=", 0 ) + 4; ! // find where the supermount info ends and the other options begin ! int i3 = ( temp[ 3 ][ i ] ).find( ',', ( i1 > i2 ? i1 : i2 ) ); ! t = ( temp[ 3 ][ i ] ).mid( i3 + 1 ); // got the entire line ... all we need to do ! ( temp[ 3 ][ i ] ) = nextWord( t, ' ' ); // is remove the '0 0' or '0 1' at the end ! ( temp[ 3 ][ i ] ).simplifyWhiteSpace(); // make sure an empty string is empty! ! } ! if ( !remark ) ! ++i; // count this as a filesystem, only if it's not a remark ! } ! --i; ! fstab.close(); // finished with it ! for ( j = 0; j <= i; ++j ) { ! if ( temp[ 0 ][ j ] == "" || temp[ 0 ][ j ] == "tmpfs" || temp[ 0 ][ j ] == "none" || temp[ 0 ][ j ] == "proc" || ! #if defined(BSD) ! temp[ 0 ][ j ] == "swap" || temp[ 1 ][ j ] == "procfs" || temp[ 1 ][ j ] == "/dev/pts" || // FreeBSD: procfs instead of proc ! #else ! temp[ 0 ][ j ] == "swap" || temp[ 1 ][ j ] == "proc" || temp[ 1 ][ j ] == "/dev/pts" || ! #endif ! temp[ 1 ][ j ] == "swap" || temp[ 4 ][ j ] == "supermount" ) ! continue; ! ++noOfFilesystems; ! } ! // now, create the main list ! QString forDebugOnly = ""; ! i = 0; ! j = 0; ! while ( i < noOfFilesystems ) { ! if ( temp[ 0 ][ j ] == "" || temp[ 1 ][ j ] == "proc" || temp[ 1 ][ j ] == "/dev/pts" || temp[ 0 ][ j ] == "tmpfs" || ! temp[ 1 ][ j ] == "swap" || temp[ 0 ][ j ] == "none" || temp[ 0 ][ j ] == "proc" || ! temp[ 0 ][ j ] == "swap" || temp[ 4 ][ j ] == "supermount" ) ! ++j; ! else { ! fsData* system = new fsData(); ! system->setName( temp[ 0 ][ j ] ); ! system->setType( temp[ 1 ][ j ] ); ! system->setMntPoint( temp[ 2 ][ j ] ); ! // remove trailing spaces (since mtab removes them) ! if ( system->mntPoint() [ system->mntPoint().length() - 1 ] == '/' && system->mntPoint() != "/" ) // also skip root! ! system->setMntPoint( system->mntPoint().left( system->mntPoint().length() - 1 ) ); ! system->supermount = ( temp[ 4 ][ j ] == "supermount" ? true : false ); ! system->options = temp[ 3 ][ j ]; ! filesystems.append( system ); ! forDebugOnly = forDebugOnly + "[" + system->name() + "] on [" + system->mntPoint() + ! "] (" + temp[ 3 ][ j ] + ")" + '\n'; ! ++i; ! ++j; ! // if not supermounted, we add the mount point to our list ! if ( !system->supermount ) ! mountPoints += system->mntPoint(); ! } ! } ! kdDebug() << "Mt.Man: found the following:\n" << forDebugOnly << "Trying DF..." << endl; ! ! #if defined(BSD) || defined(_OS_SOLARIS_) ! // FreeBSD problem: df does not retrive fs type. ! // Workaround: execute mount -p and merge result. ! ! KShellProcess proc; ! proc << KrServices::fullPathName( "mount" ) + " -p"; ! ! // connect all outputs to collectOutput, to be displayed later ! connect( &proc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), ! this, SLOT( collectOutput( KProcess*, char*, int ) ) ); ! // launch ! clearOutput(); ! if ( !proc.start( KProcess::Block, KProcess::Stdout ) ) { ! kdDebug() << "Unable to execute 'mount -p' !!!" << endl; ! return true; ! } ! ! QString str = getOutput(); ! QTextStream t2( str, IO_ReadOnly ); ! //kdWarning() << "debug: mount -p" << endl; ! while ( !t2.atEnd() ) { ! s = t2.readLine(); ! s = s.simplifyWhiteSpace(); // remove TABs ! if ( s == QString::null || s == "" ) ! continue; // skip empty lines in fstab ! // temp[0]==name, temp[1]==type, temp[2]==mount point, temp[3]==options ! // temp[4] is reserved for special cases, right now, only for supermount ! //kdWarning() << "debug: " << s << endl; ! QString temp0 = nextWord( s, ' ' ); ! #ifdef _OS_SOLARIS_ ! QString temp4 = nextWord( s, ' ' ); // skip '-' column ! #endif ! ! QString temp2 = nextWord( s, ' ' ); ! QString temp1 = nextWord( s, ' ' ); ! QString temp3 = nextWord( s, ' ' ); ! if ( temp0 == "" || temp2 == "/proc" || temp2 == "/dev/pts" || ! temp2 == "swap" || temp0 == "none" || temp0 == "procfs" || ! temp0 == "swap" || location( temp0 ) ) ! continue; ! else { ! fsData* system = new fsData(); ! system->setName( temp0 ); ! system->setType( temp1 ); ! system->setMntPoint( temp2 ); ! system->supermount = false; ! #ifndef _OS_SOLARIS_ ! ! system->options = temp3; // unknown column on solaris ! #endif ! ! filesystems.append( system ); ! ++noOfFilesystems; ! kdWarning() << "Mt.Man: filesystem [" << temp0 << "] found by mount -p is unlisted in " << QString( FSTAB ) << endl; ! } ! } ! #endif ! return true; ! } ! ! // run DF process and when it finishes, catch output with "parseDfData" ! /////////////////////////////////////////////////////////////////////// ! void KMountMan::updateFilesystems() { ! getMtab(); // here we get the current state of mtab for watching it later ! // create the "df -P -T" process ! ! if ( dfStartFailed ) { ! Operational = Ready = false; // stop mountman ! return ; ! } ! ! tempFile = new KTempFile(); ! tempFile->setAutoDelete( true ); ! dfProc.clearArguments(); ! dfProc << KrServices::fullPathName( "df" ); ! #if defined(BSD) ! ! dfProc << ">" << tempFile->name(); // FreeBSD: df instead of df -T -P ! #elif defined(_OS_SOLARIS_) ! ! dfProc << "-k" << ">" << tempFile->name(); // Solaris: df -k instead of df -T -P ! #else ! ! dfProc << "-T" << "-P" << ">" << tempFile->name(); ! #endif ! ! connect( &dfProc, SIGNAL( processExited( KProcess * ) ), this, ! SLOT( finishUpdateFilesystems() ) ); ! dfProc.start( KProcess::NotifyOnExit ); ! // if 'df' doesn't return in DF_WAIT_TIME seconds, stop mountman ! QTimer::singleShot( DF_WAIT_TIME * 1000, this, SLOT( killMountMan() ) ); ! } ! ! // if df didn't return, stop mountman ! void KMountMan::killMountMan() { ! // if Operational and !Ready, than df didn't return (yet) ! if ( Operational && !Ready ) { ! dfProc.kill( SIGKILL ); // kill the process ! Operational = Ready = false; // stop mountman ! dfStartFailed = true; // problems at starting df ! } ! } ! ! // gets notified when df is finished. ! void KMountMan::finishUpdateFilesystems() { ! // call parseDfData to work on the data ! parseDfData( tempFile->name() ); ! disconnect( &dfProc, 0, 0, 0 ); ! delete tempFile; ! tempFile = 0; ! emit updated(); ! } ! ! fsData* KMountMan::location( QString name ) { ! fsData * it; ! for ( it = filesystems.first() ; ( it != 0 ) ; it = filesystems.next() ) { ! if ( followLink( it->name() ) == followLink( name ) ) ! break; ! #if defined(BSD) || defined(_OS_SOLARIS_) ! ! if ( name.left( 2 ) == "//" && !strcasecmp( followLink( it->name() ).local8Bit(), followLink( name ).local8Bit() ) ) ! break; // FreeBSD: ignore case due to smbfs mounts ! #endif ! ! } ! return it; ! } ! ! /* we cannot use collectOutput as other processes may connected to it */ ! void KMountMan::collectMtab( KProcess*, char *buffer, int buflen ) { ! // add new buffer to mtab ! for ( int i = 0; i < buflen; ++i ) ! mtab += buffer[ i ]; ! } ! ! QString KMountMan::getMtab() { ! KShellProcess proc; ! proc << KrServices::fullPathName( "mount" ); ! ! // connect all outputs by collectMtab ( collectOutput can not be used because of the watcher ) ! connect( &proc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), ! this, SLOT( collectMtab( KProcess*, char*, int ) ) ); ! // launch ! mtab = ""; ! if ( !proc.start( KProcess::Block, KProcess::Stdout ) ) { ! kdDebug() << "Unable to execute 'mount' !!!" << endl; ! return ""; ! } ! ! return mtab; ! } ! ! bool KMountMan::checkMtabChanged() { ! QString LastMtab = mtab; ! return getMtab() != LastMtab; } ! QString KMountMan::devFromMtab( QString mntPoint ) { ! QString mtab = getMtab(); ! ! // and read it into the temporary array ! QTextStream t( &mtab, IO_ReadOnly ); ! while ( !t.atEnd() ) { ! QString dev, point; ! QString s = t.readLine().simplifyWhiteSpace(); ! dev = nextWord( s, ' ' ); /* device */ ! nextWord( s, ' ' ); /* on */ ! point = nextWord( s, ' ' ); /* mountpoint */ ! if ( point == mntPoint ) { ! return dev; ! } ! } ! return QString::null; } ! QString KMountMan::pointFromMtab( QString device ) { ! QString mtab = getMtab(); ! ! // and read it into the temporary array ! QTextStream t( &mtab, IO_ReadOnly ); ! while ( !t.atEnd() ) { ! QString dev, mntPoint; ! QString s = t.readLine().simplifyWhiteSpace(); ! dev = nextWord( s, ' ' ); /* device */ ! nextWord( s, ' ' ); /* on */ ! mntPoint = nextWord( s, ' ' ); /* mountpoint */ ! if ( dev == device ) { ! return mntPoint; ! } ! } ! return QString::null; } ! KMountMan::mntStatus KMountMan::getStatus( QString mntPoint ) { KMountPoint::List::iterator it; KMountPoint *m; --- 73,99 ---- } ! KMountPoint *KMountMan::findInListByMntPoint(KMountPoint::List &lst, QString value) { ! KMountPoint *m; ! for (KMountPoint::List::iterator it = lst.begin(); it != lst.end(); ++it) { ! m = *it; ! if (m->mountPoint() == value) ! return m; ! } ! ! return 0; } ! void KMountMan::mount( QString mntPoint ) { ! KMountPoint::List possible = KMountPoint::possibleMountPoints(KMountPoint::NeedMountOptions); ! KMountPoint *m = findInListByMntPoint(possible, mntPoint); ! if (!m) return; ! KIO::SimpleJob *job = KIO::mount(false, m->mountType().local8Bit(), m->mountedFrom(), m->mountPoint()); } ! void KMountMan::unmount( QString mntPoint ) { ! KIO::SimpleJob *job = KIO::unmount(mntPoint); } ! KMountMan::mntStatus KMountMan::getStatus( QString mntPoint ) { KMountPoint::List::iterator it; KMountPoint *m; *************** *** 452,469 **** // 1: is it already mounted KMountPoint::List current = KMountPoint::currentMountPoints(); ! for ( it = current.begin(); it != current.end(); ++it ) { ! m = *it; ! if (m->mountPoint() == mntPoint) ! return MOUNTED; ! } // 2: is it a mount point but not mounted? KMountPoint::List possible = KMountPoint::possibleMountPoints(); ! for ( it = possible.begin(); it != possible.end(); ++it ) { ! m = *it; ! if (m->mountPoint() == mntPoint) { ! return NOT_MOUNTED; ! } ! } // 3: unknown --- 101,113 ---- // 1: is it already mounted KMountPoint::List current = KMountPoint::currentMountPoints(); ! m = findInListByMntPoint(current, mntPoint); ! if (m) ! return MOUNTED; // 2: is it a mount point but not mounted? KMountPoint::List possible = KMountPoint::possibleMountPoints(); ! m = findInListByMntPoint(possible, mntPoint); ! if (m) ! return NOT_MOUNTED; // 3: unknown *************** *** 471,740 **** } - QString KMountMan::getDevice( QString mntPoint ) { - fsData * it; - for ( it = filesystems.first() ; ( it != 0 ) ; it = filesystems.next() ) - if ( it->mntPoint() == mntPoint ) - return it->name(); - // if we got here, the mntPoint doesn't exist in the database - return QString::null; - } - - // parseDfData assumes that DF always knows better than FSTAB about currently - // mounted filesystems. - ///////////////////////////////////////////////////////////////////////////// - void KMountMan::parseDfData( QString filename ) { - QString temp; - QFile f( filename ); - if ( !f.open( IO_ReadOnly ) || dfStartFailed ) { // error reading temp file - Operational = false; - Ready = false; - return ; // make mt.man non-operational - } - QTextStream t( &f ); // use a text stream - QString s, s2; - s = t.readLine(); // read the 1st line - it's trash for us - // now that we have a QString containing all the output of DF, let's get to work. - int countFilesystems = 0; // sucessfully found filesystems - //kdWarning() << "debug: parseDfData" << endl; - while ( !t.eof() ) { - bool newFS = false; - s2 = s = t.readLine(); // this is the important one! - //kdWarning() << "debug: " << s << endl; - temp = nextWord( s, ' ' ); - // avoid adding unwanted filesystems to the list - if ( temp == "tmpfs" ) - continue; - #if defined(BSD) - - if ( temp == "procfs" ) - continue; // FreeBSD: ignore procfs too - #elif defined(_OS_SOLARIS_) - - if ( temp == "proc" || temp == "swap" ) - continue; // Solaris: ignore procfs too - #endif - - temp = followLink( temp ); // make sure DF gives us the true device and not a link - fsData* loc = location( temp ); // where is the filesystem located in our list? - if ( loc == 0 ) { - kdWarning() << "Mt.Man: filesystem [" << temp << "] found by DF is unlisted in " << QString( FSTAB ) << endl; - loc = new fsData(); - loc->supermount = false; - filesystems.append( loc ); - if ( temp.contains( "//" ) > 0 || // if it contains '//', it's a smb share - temp.contains( ":" ) > 0 || // if it contains ':' , it's an nfs share - temp.startsWith( "/" ) ) // if it is a fullpath device name - loc->setName( temp ); // <patch> thanks to Cristi Dumitrescu - else - loc->setName( "/dev/" + temp ); - newFS = true; - } - #if !defined(BSD) && !defined(_OS_SOLARIS_) - temp = nextWord( s, ' ' ); // catch the TYPE - // is it supermounted ? - if ( temp == "supermount" ) - loc->supermount = true; - loc->setType( temp ); - if ( loc->type() != temp ) { - kdWarning() << "Mt.Man: according to DF, filesystem [" << loc->name() << - "] has a different type from what's stated in " << QString( FSTAB ) << endl; - loc->setType( temp ); // DF knows best - } - #endif - temp = nextWord( s, ' ' ); - loc->setTotalBlks( temp.toLong() ); - temp = nextWord( s, ' ' ); - temp = nextWord( s, ' ' ); // get rid of the next 2 words - loc->setFreeBlks( temp.toLong() ); - temp = nextWord( s, ' ' ); - temp = nextWord( s, '\n' ); // read the "mounted on" thing - if ( loc->mntPoint() != temp ) { - if ( !newFS ) - kdWarning() << "Mt.Man: according to DF, filesystem [" << loc->name() << - "] is mounted on " << temp << " and not on " << loc->mntPoint() << endl; - loc->setMntPoint( temp ); // DF knows best - } - loc->setMounted( true ); - ++countFilesystems; - } - - Operational = Ready = true; // we are finished here - if ( countFilesystems > 0 ) - kdDebug() << "Mt.Man: Alive and kicking. " << endl; - else { - kdWarning() << "Mt.Man: failed running DF. Shutting down (sorry)." << endl; - Operational = Ready = false; - } - } - - void KMountMan::forceUpdate() { - kdWarning() << "Mt.Man: Born, looking around to get familiar." << endl; - mountPoints.clear(); - // first create our list from /etc/fstab - if ( !createFilesystems() ) { // create the potential fs from /etc/fstab - Operational = Ready = false; - return ; // if something went wrong, bail out! - } else - Operational = true; // mountman is alive but not yet ready - updateFilesystems(); // use the output of "DF -T -P" to update data - } - - void KMountMan::collectOutput( KProcess *p, char *buffer, int buflen ) { - if ( !p ) - return ; // don't collect data from unknown/undefined processes - if ( outputBuffer == 0 ) - outputBuffer = new QString(); // create buffer if needed - - // add new buffer to the main output buffer - for ( int i = 0; i < buflen; ++i ) - ( *outputBuffer ) += buffer[ i ]; - } - - void KMountMan::clearOutput() { - if ( outputBuffer != 0 ) { - delete outputBuffer; - outputBuffer = 0; - } - } - - // this is the generic version of mount - it receives a mntPoint and try to - // mount it the usual way - via /etc/fstab - void KMountMan::mount( QString mntPoint ) { - if ( mountPoints.findIndex( mntPoint ) == -1 ) - return ; // safety measure - - if ( !KrServices::cmdExist( "mount" ) ) { - KMessageBox::error( 0, - i18n( "Can't start 'mount'! Check the 'Dependencies' page in konfigurator." ) ); - return ; - } - - KProcess mountProc; - mountProc << KrServices::fullPathName( "mount" ) << mntPoint.local8Bit(); - // connect all outputs to collectOutput, to be displayed later - connect( &mountProc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), - this, SLOT( collectOutput( KProcess*, char*, int ) ) ); - // launch - clearOutput(); - if ( !mountProc.start( KProcess::Block, KProcess::Stderr ) ) { - KMessageBox::error( 0, - i18n( "Unable to execute 'mount' !!!\ncheck that /bin/mount or /sbin/mount are availble" ) ); - return ; - } - if ( mountProc.normalExit() ) - if ( mountProc.exitStatus() == 0 ) - return ; // incase of a normal exit - // on any other case,report an error - KMessageBox::sorry( 0, i18n( "Unable to complete the mount." ) + - i18n( "The error reported was:\n\n" ) + getOutput() ); - } - - // this version of mount is used strictly by the GUI - // don't call it explicitly ! - void KMountMan::mount( fsData *p ) { - // first, if the user isn't ROOT, he won't be able to mount it, unless - // the option states 'user'. if so, we'll mount the mntPoint - if ( p->options.contains( "user" ) && getuid() != 0 ) { - mount( p->mntPoint() ); // call the alternative method - return ; - } - - if ( !KrServices::cmdExist( "mount" ) ) { - KMessageBox::error( 0, - i18n( "Can't start 'mount'! Check the 'Dependencies' page in konfigurator." ) ); - return ; - } - - bool ro = ( p->type() == "iso9660" ); - KProcess mountProc; - mountProc << KrServices::fullPathName( "mount" ); - if ( ro ) - mountProc << "-r"; // read only - mountProc << "-t" << p->type().local8Bit(); // local8Bit == normal ascii - if ( !p->options.isEmpty() ) - mountProc << "-o" << p->options; // -o options - mountProc << p->name().local8Bit() << p->mntPoint().local8Bit(); - - // don't allow mounting 'supermount' filesystems - if ( p->supermount ) { - KMessageBox::information( mountManGui, i18n( "Warning: you're trying to mount a 'supermount' filesystem. Supermount filesystems are (un)mounted automatically by linux upon insert/eject. This is usually a Linux-Mandrake feature.Krusader will not allow this, as it creates unpredictable behaviour." ), i18n( "Error" ), "SupermountWarning" ); - return ; - } - // connect all outputs to collectOutput, to be displayed later - connect( &mountProc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), - this, SLOT( collectOutput( KProcess*, char*, int ) ) ); - // launch - clearOutput(); - if ( !mountProc.start( KProcess::Block, KProcess::Stderr ) ) { - KMessageBox::error( 0, - i18n( "Unable to execute 'mount' !!! check that /bin/mount or /sbin/mount are availble" ) ); - return ; - } - if ( mountProc.normalExit() ) - if ( mountProc.exitStatus() == 0 ) - return ; // incase of a normal exit - // on any other case,report an error - KMessageBox::sorry( 0, i18n( "Unable to complete the mount." ) + - i18n( "The error reported was:\n\n" ) + getOutput() ); - } - - // this version of unmount is generic - it doesn't care which device is mounted - // on the mntPoint, it simply unmounts it --- used with externally mounted systems - void KMountMan::unmount( QString mntPoint ) { - fsData * tmp = new fsData(); - tmp->setMntPoint( mntPoint ); // mount-point and supermount=false is all that's - tmp->supermount = false; // needed to normally unmount - unmount( tmp ); - delete tmp; // no memory-leaks here ! - } - - // this version is used strictly by the GUI or by the unmount(QString) version - // you've got no need to call it explicitly - void KMountMan::unmount( fsData *p ) { - if ( !KrServices::cmdExist( "umount" ) ) { - KMessageBox::error( 0, - i18n( "Can't start 'umount'! Check the 'Dependencies' page in konfigurator." ) ); - return ; - } - - KProcess umountProc; - umountProc << KrServices::fullPathName( "umount" ); - umountProc << p->mntPoint().local8Bit(); - - // don't allow unmounting 'supermount' filesystems - if ( p->supermount ) { - KMessageBox::information( mountManGui, i18n( "Warning: you're trying to unmount a 'supermount' filesystem. Supermount filesystems are (un)mounted automatically by linux upon insert/eject. This is usually a Linux-Mandrake feature. Krusader will not allow this, as it creates unpredictable behaviour." ), i18n( "Error" ), "SupermountWarning" ); - return ; - } - // connect outputs to collectOutput, to be displayed later - connect( &umountProc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), - this, SLOT( collectOutput( KProcess*, char*, int ) ) ); - // launch - krApp->startWaiting( i18n( "Unmounting device, please wait ..." ), 0, false ); - - clearOutput(); - if ( !umountProc.start( KProcess::Block, KProcess::Stderr ) ) { - KMessageBox::error( 0, - i18n( "Unable to execute 'umount' !!! check that /bin/umount or /sbin/umount are availble" ) ); - return ; - } else - while ( umountProc.isRunning() ) - qApp->processEvents(); - krApp->stopWait(); - if ( umountProc.normalExit() ) - if ( umountProc.exitStatus() == 0 ) - return ; // incase of a normal exit - // on any other case,report an error - KMessageBox::sorry( 0, i18n( "Unable to complete the un-mount." ) + - i18n( "The error reported was:\n\n" ) + getOutput() ); - } void KMountMan::toggleMount( QString mntPoint ) { - #if 0 - fsData * p = location( device ); - // request mountMan to (un)mount something, if he does his job (and he does) - // we will be notified by signal - ( p->mounted() ? unmount( p ) : mount( p ) ); - #endif mntStatus status = getStatus(mntPoint); switch (status) { --- 115,120 ---- *************** *** 745,757 **** mount(mntPoint); break; } } - - - //////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////// - void KMountMan::autoMount( QString path ) { if ( getStatus( path ) == NOT_MOUNTED ) --- 125,134 ---- mount(mntPoint); break; + case DOESNT_EXIST: + // do nothing: no-op to make the compiler quiet ;-) + break; } } void KMountMan::autoMount( QString path ) { if ( getStatus( path ) == NOT_MOUNTED ) *************** *** 771,781 **** #if !defined(BSD) && !defined(_OS_SOLARIS_) KMountPoint::List possible = KMountPoint::possibleMountPoints(); ! KMountPoint *m; ! for ( KMountPoint::List::iterator it = possible.begin(); it != possible.end(); ++it ) { ! m = *it; ! if (m->mountPoint() == path && ! (m->mountType()=="iso9660" || m->mountedFrom().left(7)=="/dev/cd")) return KrServices::cmdExist( "eject" ); - } #endif --- 148,154 ---- #if !defined(BSD) && !defined(_OS_SOLARIS_) KMountPoint::List possible = KMountPoint::possibleMountPoints(); ! KMountPoint *m = findInListByMntPoint(possible, path); ! if (m && (m->mountType()=="iso9660" || m->mountedFrom().left(7)=="/dev/cd")) return KrServices::cmdExist( "eject" ); #endif *************** *** 825,830 **** } - #if KDE_IS_VERSION(3,2,0) - // clear the popup menu ( ( KToolBarPopupAction* ) krMountMan ) ->popupMenu() ->clear(); --- 198,201 ---- *************** *** 866,877 **** this, SLOT( performAction( int ) ) ); - #endif /* KDE 3.2 */ - } void KMountMan::performAction( int idx ) { - - #if KDE_IS_VERSION(3,2,0) - while ( qApp->hasPendingEvents() ) qApp->processEvents(); --- 237,243 ---- *************** *** 891,898 **** _actions = 0L; disconnect( ( ( KToolBarPopupAction* ) krMountMan ) ->popupMenu(), SIGNAL( activated( int ) ), 0, 0 ); - - #endif /* KDE 3.2 */ - } - - --- 257,259 ---- |
From: Shie E. <er...@us...> - 2004-09-17 17:34:52
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12840/krusader/MountMan Modified Files: kmountmangui.h Log Message: new mountman Index: kmountmangui.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountmangui.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kmountmangui.h 17 Sep 2004 13:03:50 -0000 1.5 --- kmountmangui.h 17 Sep 2004 17:34:40 -0000 1.6 *************** *** 1,32 **** /*************************************************************************** ! kmountmangui.h ! ------------------- ! begin : Thu May 4 2000 ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net ! --------------------------------------------------------------------------- ! Description ! *************************************************************************** ! A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! H e a d e r F i l e ! *************************************************************************** ! * * ! * This program is free software; you can redistribute it and/or modify * ! * it under the terms of the GNU General Public License as published by * ! * the Free Software Foundation; either version 2 of the License, or * ! * (at your option) any later version. * ! * * ! ***************************************************************************/ --- 1,32 ---- /*************************************************************************** ! kmountmangui.h ! ------------------- ! begin : Thu May 4 2000 ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net ! --------------------------------------------------------------------------- ! Description ! *************************************************************************** ! A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! H e a d e r F i l e ! *************************************************************************** ! * * ! * This program is free software; you can redistribute it and/or modify * ! * it under the terms of the GNU General Public License as published by * ! * the Free Software Foundation; either version 2 of the License, or * ! * (at your option) any later version. * ! * * ! ***************************************************************************/ *************** *** 35,81 **** #include <kdialogbase.h> - #include <kjanuswidget.h> - #include <qframe.h> #include <qlistview.h> - #include <qcheckbox.h> #include <kjanuswidget.h> #include <qtimer.h> #include <kurl.h> ! #define WATCHER_DELAY 500 class KRFSDisplay; class KRdirWatch; class KMountManGUI : public KDialogBase { ! Q_OBJECT ! enum Pages { ! Filesystems = 0 ! }; public: ! KMountManGUI(); ! ~KMountManGUI(); ! void createLayout(); // calls the various tab layout-creators ! void createMainPage(); // creator of the main page - filesystems ! ! public slots: ! void updateList(); // fill-up the filesystems list ! void doubleClicked(QListViewItem *); ! void clicked(QListViewItem *); ! void changeActive(QListViewItem *); ! void checkMountChange(); // check whether the mount table was changed signals: ! void refreshPanel(const KURL &); private: ! KRFSDisplay *info; ! QFrame *mainPage; ! KJanusWidget *widget; ! QListView *mountList; ! QTimer *watcher; }; #endif --- 35,185 ---- #include <kdialogbase.h> #include <qlistview.h> #include <kjanuswidget.h> #include <qtimer.h> #include <kurl.h> + #include <qvaluelist.h> + #include <kmountpoint.h> + #include <qdatetime.h> + #include "kmountman.h" ! #define WATCHER_DELAY 3000 class KRFSDisplay; class KRdirWatch; + + // forward definitions + class fsData; + class KMountManGUI : public KDialogBase { ! Q_OBJECT ! enum Pages { ! Filesystems = 0 ! }; public: ! KMountManGUI(); ! ~KMountManGUI(); ! void createLayout(); // calls the various tab layout-creators ! void createMainPage(); // creator of the main page - filesystems + protected slots: + void doubleClicked( QListViewItem * ); + void clicked( QListViewItem * ); + void changeActive( QListViewItem * ); + void checkMountChange(); // check whether the mount table was changed + + void updateList(); // fill-up the filesystems list + void getSpaceData(); + void gettingSpaceData(); + void gettingSpaceData(const QString &mountPoint, unsigned long kBSize, + unsigned long kBUsed, unsigned long kBAvail); + + protected: + void addItemToMountList( QListView *lst, fsData &fs ); + signals: ! void refreshPanel( const KURL & ); ! void finishedGettingSpaceData(); private: ! KRFSDisplay *info; ! QFrame *mainPage; ! KJanusWidget *widget; ! QListView *mountList; ! QTimer *watcher; ! QStringList invalid_fs; ! QDateTime lastMtab; ! // used for the getSpace - gotSpace functions ! KMountPoint::List possible, mounted; ! QValueList<fsData> fileSystems; ! int numOfMountPoints; ! }; ! ! ! // Data container for a single-filesystem data ! // maximum size supported is 2GB of 1kb blocks == 2048GB, enough. ! // not really needed, but kept for backward compatiblity ! ///////////////////////////////////////////////////////////////// ! class fsData { ! public: ! fsData() : Name( 0 ), Type( 0 ), MntPoint( 0 ), TotalBlks( 0 ), ! FreeBlks( 0 ), Mounted( false ) {} ! ! // get information ! inline QString name() { ! return Name; ! } ! inline QString shortName() { ! return Name.right( Name.length() - Name.find( "/", 1 ) - 1 ); ! } ! inline QString type() { ! return Type; ! } ! inline QString mntPoint() { ! return MntPoint; ! } ! inline long totalBlks() { ! return TotalBlks; ! } ! inline long freeBlks() { ! return FreeBlks; ! } ! inline KIO::filesize_t totalBytes() { ! return TotalBlks * 1024; ! } ! inline KIO::filesize_t freeBytes() { ! return FreeBlks * 1024; ! } ! //////////////////// insert a good round function here ///////////////// ! int usedPerct() { ! if ( TotalBlks == 0 ) ! return 0; ! float res = ( ( float ) ( TotalBlks - FreeBlks ) ) / ( ( float ) TotalBlks ) * 100; ! if ( ( res - ( int ) res ) > 0.5 ) ! return ( int ) res + 1; ! else ! return ( int ) res; ! } ! inline bool mounted() { ! return Mounted; ! } ! ! // set information ! inline void setName( QString n_ ) { ! Name = n_; ! } ! inline void setType( QString t_ ) { ! Type = t_; ! } ! inline void setMntPoint( QString m_ ) { ! MntPoint = m_; ! } ! inline void setTotalBlks( long t_ ) { ! TotalBlks = t_; ! } ! inline void setFreeBlks( long f_ ) { ! FreeBlks = f_; ! } ! inline void setMounted( bool m_ ) { ! Mounted = m_; ! } ! ! private: ! QString Name; // i.e: /dev/cdrom ! QString Type; // i.e: iso9600 ! QString MntPoint; // i.e: /mnt/cdrom ! long TotalBlks; // measured in 1024bytes per block ! long FreeBlks; ! bool Mounted; // true if filesystem is mounted ! ! // additional attributes of a filesystem, parsed from fstab ! public: ! QString options; // additional fstab options ! }; + #endif |
From: Shie E. <er...@us...> - 2004-09-17 17:34:25
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12770/krusader/MountMan Modified Files: kmountmangui.cpp Log Message: new mountman Index: kmountmangui.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountmangui.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** kmountmangui.cpp 17 Sep 2004 13:04:27 -0000 1.10 --- kmountmangui.cpp 17 Sep 2004 17:34:15 -0000 1.11 *************** *** 1,31 **** /*************************************************************************** ! kmountmangui.cpp ! ------------------- ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net ! --------------------------------------------------------------------------- ! Description ! *************************************************************************** ! A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! S o u r c e F i l e ! *************************************************************************** ! * * ! * This program is free software; you can redistribute it and/or modify * ! * it under the terms of the GNU General Public License as published by * ! * the Free Software Foundation; either version 2 of the License, or * ! * (at your option) any later version. * ! * * ! ***************************************************************************/ --- 1,31 ---- /*************************************************************************** ! kmountmangui.cpp ! ------------------- ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net ! --------------------------------------------------------------------------- ! Description ! *************************************************************************** ! A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! S o u r c e F i l e ! *************************************************************************** ! * * ! * This program is free software; you can redistribute it and/or modify * ! * it under the terms of the GNU General Public License as published by * ! * the Free Software Foundation; either version 2 of the License, or * ! * (at your option) any later version. * ! * * ! ***************************************************************************/ *************** *** 46,250 **** #include <qgroupbox.h> #include <kprocess.h> - #include <kdebug.h> #include <qcursor.h> #include <kguiitem.h> ! KMountManGUI::KMountManGUI() : KDialogBase(krApp, 0,true,"Mount.Man"), ! info(0), mountList(0) { ! watcher = new QTimer(this); ! connect(watcher,SIGNAL(timeout()), this, SLOT(checkMountChange())); //<> ! connect((QObject*)&krMtMan,SIGNAL(updated()),this,SLOT(updateList())); // <> ! setButtonOK(i18n("&Close")); ! showButtonApply(false); showButtonCancel(false); ! setPlainCaption(i18n("MountMan - Your Mount-Manager")); ! widget=new KJanusWidget(this,0,KJanusWidget::Tabbed); ! createLayout(); ! setMainWidget(widget); ! widget->setMinimumSize(widget->sizeHint().width()+mountList->columnWidth(5), ! widget->sizeHint().height()); ! setMinimumSize(widget->minimumSize().width(), widget->minimumSize().height()); ! resize(minimumSize()); ! // connections ! connect(mountList,SIGNAL(doubleClicked(QListViewItem *)),this, ! SLOT(doubleClicked(QListViewItem*))); ! connect(mountList,SIGNAL(rightButtonPressed(QListViewItem *, const QPoint &, int)), ! this, SLOT(clicked(QListViewItem*))); ! connect(mountList,SIGNAL(clicked(QListViewItem *)), this, ! SLOT(changeActive(QListViewItem *))); ! connect(mountList,SIGNAL(selectionChanged(QListViewItem *)), this, ! SLOT(changeActive(QListViewItem *))); ! exec(); } ! KMountManGUI::~KMountManGUI() ! { ! watcher->stop(); ! delete watcher; } void KMountManGUI::createLayout() { ! mainPage=widget->addPage(i18n("Filesystems"),0); ! createMainPage(); ! widget->showPage(Filesystems); } void KMountManGUI::createMainPage() { ! // check if we need to clean up first! ! if (mountList!=0) { ! mountList->hide(); ! delete mountList; ! mountList=0; ! } ! // clean up is finished... ! QGridLayout *layout=new QGridLayout(mainPage,1,1); ! mountList=new QListView(mainPage); // create the main container ! krConfig->setGroup("Look&Feel"); ! mountList->setFont(krConfig->readFontEntry("Filelist Font",_FilelistFont)); ! mountList->setAllColumnsShowFocus(true); ! mountList->setMultiSelection(false); ! mountList->setSelectionMode(QListView::Single); ! mountList->setVScrollBarMode(QScrollView::AlwaysOn); ! mountList->setHScrollBarMode(QScrollView::Auto); ! mountList->setShowSortIndicator(true); ! int i=QFontMetrics(mountList->font()).width("W"); ! int j=QFontMetrics(mountList->font()).width("0"); ! j=(i>j ? i : j); ! mountList->addColumn(i18n("Name"),j*8); ! mountList->addColumn(i18n("Type"),j*4); ! mountList->addColumn(i18n("Mnt.Point"),j*6); ! mountList->addColumn(i18n("Total Size"),j*6); ! mountList->addColumn(i18n("Free Size"),j*6); ! mountList->addColumn(i18n("Free %"),j*5); ! mountList->setColumnWidthMode(0,QListView::Maximum); ! mountList->setColumnWidthMode(1,QListView::Maximum); ! mountList->setColumnWidthMode(2,QListView::Maximum); ! mountList->setColumnWidthMode(3,QListView::Maximum); ! mountList->setColumnWidthMode(4,QListView::Maximum); ! mountList->setColumnWidthMode(5,QListView::Maximum); ! // now the list is created, time to fill it with data. ! krMtMan.forceUpdate(); ! QGroupBox *box=new QGroupBox("MountMan.Info",mainPage); ! box->setAlignment(Qt::AlignHCenter); ! info=new KRFSDisplay(box); ! info->resize(info->width(),height()); ! layout->addWidget(box,0,0); ! layout->addWidget(mountList,0,1); } void KMountManGUI::updateList() { ! fsData *it; ! mountList->clear(); ! for (it=krMtMan.filesystems.first(); it!=0 ; it=krMtMan.filesystems.next()) { ! bool mtd=it->mounted(); ! QString tSize=QString("%1").arg(KIO::convertSizeFromKB(it->totalBlks())); ! QString fSize=QString("%1").arg(KIO::convertSizeFromKB(it->freeBlks())); ! QString sPrct=QString("%1%").arg(100-(it->usedPerct())); ! QListViewItem *item=new QListViewItem(mountList,it->name(), ! it->type(),it->mntPoint(), ! (mtd ? tSize : QString("N/A")),(mtd ? fSize : QString("N/A")), ! (mtd ? sPrct : QString("N/A"))); ! QString id=krMtMan.followLink(it->name()).left(2); ! QPixmap *icon=0; ! if (id=="fd" || krMtMan.followLink(it->name())=="floppy") ! icon=new QPixmap(LOADICON(mtd ? "3floppy_mount" : "3floppy_unmount")); ! else ! if (id=="cd" || it->type()=="iso9660") icon=new QPixmap(LOADICON(mtd ? "cdrom_mount" : "cdrom_unmount")); ! else ! if (it->type()=="nfs" || it->type()=="smbfs") ! icon=new QPixmap(LOADICON(mtd ? "nfs_mount" : "nfs_unmount")); ! else ! if (id=="hd") icon=new QPixmap(LOADICON(mtd ? "hdd_mount" : "hdd_unmount")); ! else ! icon=new QPixmap(LOADICON(mtd ? "hdd_mount" : "hdd_unmount")); // our default ! ! item->setPixmap(0,*icon); ! delete icon; ! } ! mountList->clearSelection(); ! if (info) { ! info->setEmpty(true); ! info->repaint(); ! } ! watcher->start( WATCHER_DELAY, true); // starting the watch timer ( single shot ) } ! void KMountManGUI::checkMountChange() ! { ! if( krMtMan.checkMtabChanged() ) ! krMtMan.forceUpdate(); ! watcher->start( WATCHER_DELAY, true); // starting the watch timer ( single shot ) } ! void KMountManGUI::doubleClicked(QListViewItem *i) { ! if (!i) return; ! // change the active panel to this mountpoint ! fsData *system=krMtMan.location(i->text(0)); ! connect((QObject*)this,SIGNAL(refreshPanel(const KURL &)), (QObject*)SLOTS, ! SLOT(refresh(const KURL &))); ! emit refreshPanel( vfs::fromPathOrURL( system->mntPoint() ) ); ! disconnect(this,SIGNAL(refreshPanel(const KURL &)),0,0); ! slotClose(); } // when user clicks on a filesystem, change information ! void KMountManGUI::changeActive(QListViewItem *i) { ! if (!i) return; ! fsData *system=krMtMan.location(i->text(0)); ! info->setAlias(system->mntPoint()); ! info->setRealName(system->name()); ! info->setMounted(system->mounted()); ! info->setEmpty(false); ! info->setTotalSpace(system->totalBlks()); ! info->setFreeSpace(system->freeBlks()); ! info->setSupermount(system->supermount); ! info->repaint(); } // called when right-clicked on a filesystem ! void KMountManGUI::clicked(QListViewItem *item) { ! // these are the values that will exist in the menu ! #define MOUNT_ID 90 ! #define UNMOUNT_ID 91 ! #define FORMAT_ID 93 ! #define EJECT_ID 94 ! ////////////////////////////////////////////////////////// ! if (!item) return; ! fsData *system=krMtMan.location(item->text(0)); ! if (!system) { ! KMessageBox::error(0, i18n("MountMan has an internal error. Please notify the developers. Thank you.")); ! exit(0); ! } ! // create the menu ! KPopupMenu popup; ! popup.insertTitle(i18n("MountMan")); ! if (!system->mounted()) ! popup.insertItem(i18n("Mount"),MOUNT_ID); ! else popup.insertItem(i18n("Unmount"),UNMOUNT_ID); ! if (krMtMan.ejectable(system->mntPoint())) ! // if (system->type()=="iso9660" || krMtMan.followLink(system->name()).left(2)=="cd") ! popup.insertItem(i18n("Eject"),EJECT_ID); ! else { ! popup.insertItem(i18n("Format"),FORMAT_ID); ! popup.setItemEnabled(FORMAT_ID,false); ! } ! int result=popup.exec(QCursor::pos()); ! // check out the user's option ! switch (result) { ! case -1 : return; // the user clicked outside of the menu ! case MOUNT_ID : ! case UNMOUNT_ID : ! krMtMan.toggleMount(system->mntPoint()); ! break; ! case FORMAT_ID : ! break; ! case EJECT_ID : ! KMountMan::eject(system->mntPoint()); ! break; ! } } --- 46,354 ---- #include <qgroupbox.h> #include <kprocess.h> #include <qcursor.h> #include <kguiitem.h> + #include <kdiskfreesp.h> + #include <qfileinfo.h> + #define MTAB "/etc/mtab" ! KMountManGUI::KMountManGUI() : KDialogBase( krApp, 0, true, "Mount.Man" ), ! info( 0 ), mountList( 0 ) { ! // list of file systems we don't want to touch ---------------- ! invalid_fs << "swap" << "/dev/pts" << "tmpfs" << "supermount"; ! #if defined(BSD) ! invalid_fs << "procfs"; ! #else ! invalid_fs << "proc"; ! #endif ! ! // ------------------------------------------------------------- ! ! watcher = new QTimer( this ); ! connect( watcher, SIGNAL( timeout() ), this, SLOT( checkMountChange() ) ); ! connect( this, SIGNAL( finishedGettingSpaceData() ), this, SLOT( updateList() ) ); ! setButtonOK( i18n( "&Close" ) ); ! showButtonApply( false ); showButtonCancel( false ); ! setPlainCaption( i18n( "MountMan - Your Mount-Manager" ) ); ! widget = new KJanusWidget( this, 0, KJanusWidget::Tabbed ); ! createLayout(); ! setMainWidget( widget ); ! widget->setMinimumSize( widget->sizeHint().width() + mountList->columnWidth( 5 ), ! widget->sizeHint().height() ); ! setMinimumSize( widget->minimumSize().width(), widget->minimumSize().height() ); ! resize( minimumSize() ); ! // connections ! connect( mountList, SIGNAL( doubleClicked( QListViewItem * ) ), this, ! SLOT( doubleClicked( QListViewItem* ) ) ); ! connect( mountList, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), ! this, SLOT( clicked( QListViewItem* ) ) ); ! connect( mountList, SIGNAL( clicked( QListViewItem * ) ), this, ! SLOT( changeActive( QListViewItem * ) ) ); ! connect( mountList, SIGNAL( selectionChanged( QListViewItem * ) ), this, ! SLOT( changeActive( QListViewItem * ) ) ); ! getSpaceData(); ! exec(); } ! KMountManGUI::~KMountManGUI() { ! watcher->stop(); ! delete watcher; } void KMountManGUI::createLayout() { ! mainPage = widget->addPage( i18n( "Filesystems" ), 0 ); ! createMainPage(); ! widget->showPage( Filesystems ); } void KMountManGUI::createMainPage() { ! // check if we need to clean up first! ! if ( mountList != 0 ) { ! mountList->hide(); ! delete mountList; ! mountList = 0; ! } ! // clean up is finished... ! QGridLayout *layout = new QGridLayout( mainPage, 1, 1 ); ! mountList = new QListView( mainPage ); // create the main container ! krConfig->setGroup( "Look&Feel" ); ! mountList->setFont( krConfig->readFontEntry( "Filelist Font", _FilelistFont ) ); ! mountList->setAllColumnsShowFocus( true ); ! mountList->setMultiSelection( false ); ! mountList->setSelectionMode( QListView::Single ); ! mountList->setVScrollBarMode( QScrollView::AlwaysOn ); ! mountList->setHScrollBarMode( QScrollView::Auto ); ! mountList->setShowSortIndicator( true ); ! int i = QFontMetrics( mountList->font() ).width( "W" ); ! int j = QFontMetrics( mountList->font() ).width( "0" ); ! j = ( i > j ? i : j ); ! mountList->addColumn( i18n( "Name" ), j * 8 ); ! mountList->addColumn( i18n( "Type" ), j * 4 ); ! mountList->addColumn( i18n( "Mnt.Point" ), j * 6 ); ! mountList->addColumn( i18n( "Total Size" ), j * 6 ); ! mountList->addColumn( i18n( "Free Size" ), j * 6 ); ! mountList->addColumn( i18n( "Free %" ), j * 5 ); ! mountList->setColumnWidthMode( 0, QListView::Maximum ); ! mountList->setColumnWidthMode( 1, QListView::Maximum ); ! mountList->setColumnWidthMode( 2, QListView::Maximum ); ! mountList->setColumnWidthMode( 3, QListView::Maximum ); ! mountList->setColumnWidthMode( 4, QListView::Maximum ); ! mountList->setColumnWidthMode( 5, QListView::Maximum ); ! // now the list is created, time to fill it with data. ! //=>krMtMan.forceUpdate(); ! QGroupBox *box = new QGroupBox( "MountMan.Info", mainPage ); ! box->setAlignment( Qt::AlignHCenter ); ! info = new KRFSDisplay( box ); ! info->resize( info->width(), height() ); ! layout->addWidget( box, 0, 0 ); ! layout->addWidget( mountList, 0, 1 ); ! } ! ! void KMountManGUI::getSpaceData() { ! fileSystems.clear(); ! lastMtab = QFileInfo(MTAB).lastModified(); ! ! mounted = KMountPoint::currentMountPoints(); ! possible = KMountPoint::possibleMountPoints(); ! if ( mounted.size() == 0 ) { // nothing is mounted ! updateList(); // let's continue ! return ; ! } ! ! numOfMountPoints = mounted.size(); ! for ( KMountPoint::List::iterator it = mounted.begin(); it != mounted.end(); ++it ) { ! KDiskFreeSp *sp = KDiskFreeSp::findUsageInfo( ( *it ) ->mountPoint() ); ! connect( sp, SIGNAL( foundMountPoint( const QString &, unsigned long, unsigned long, unsigned long ) ), ! this, SLOT( gettingSpaceData( const QString&, unsigned long, unsigned long, unsigned long ) ) ); ! connect( sp, SIGNAL( done() ), this, SLOT( gettingSpaceData() ) ); ! } ! } ! ! // this decrements the counter, while the following uses the data ! // used when certain filesystem (/dev, /sys) can't have the needed stats ! void KMountManGUI::gettingSpaceData() { ! if ( --numOfMountPoints == 0 ) { ! emit finishedGettingSpaceData(); ! } ! } ! ! void KMountManGUI::gettingSpaceData( const QString &mountPoint, unsigned long kBSize, ! unsigned long kBUsed, unsigned long kBAvail ) { ! KMountPoint *m = KMountMan::findInListByMntPoint( mounted, mountPoint ); ! if ( !m ) { // this should never never never happen! ! KMessageBox::error( 0, i18n( "Critical Error" ), ! i18n( "Internal error in MountMan\nPlease email the developers" ) ); ! exit( 1 ); ! } ! fsData data; ! data.setMntPoint( mountPoint ); ! data.setMounted( true ); ! data.setTotalBlks( kBSize ); ! data.setFreeBlks( kBAvail ); ! data.setName( m->mountedFrom() ); ! data.setType( m->mountType() ); ! ! fileSystems.append( data ); ! } ! ! void KMountManGUI::addItemToMountList( QListView *lst, fsData &fs ) { ! bool mtd = fs.mounted(); ! ! QString tSize = QString( "%1" ).arg( KIO::convertSizeFromKB( fs.totalBlks() ) ); ! QString fSize = QString( "%1" ).arg( KIO::convertSizeFromKB( fs.freeBlks() ) ); ! QString sPrct = QString( "%1%" ).arg( 100 - ( fs.usedPerct() ) ); ! QListViewItem *item = new QListViewItem( lst, fs.name(), ! fs.type(), fs.mntPoint(), ! ( mtd ? tSize : QString( "N/A" ) ), ( mtd ? fSize : QString( "N/A" ) ), ! ( mtd ? sPrct : QString( "N/A" ) ) ); ! ! QString id = fs.name().left(7); // only works assuming devices start with "/dev/XX" ! QPixmap *icon = 0; ! if ( id == "/dev/fd") { ! icon = new QPixmap( LOADICON( mtd ? "3floppy_mount" : "3floppy_unmount" ) ); ! } else if ( id == "/dev/cd" || fs.type() == "iso9660" ) { ! icon = new QPixmap( LOADICON( mtd ? "cdrom_mount" : "cdrom_unmount" ) ); ! } else if ( fs.type() == "nfs" || fs.type() == "smbfs" ) { ! icon = new QPixmap( LOADICON( mtd ? "nfs_mount" : "nfs_unmount" ) ); ! } else icon = new QPixmap( LOADICON( mtd ? "hdd_mount" : "hdd_unmount" ) ); ! ! item->setPixmap( 0, *icon ); ! delete icon; } void KMountManGUI::updateList() { ! #define INVALID_FS(TYPE) (invalid_fs.contains(TYPE) > 0) ! ! mountList->clear(); ! // this handles the mounted ones ! for ( QValueList<fsData>::iterator it = fileSystems.begin(); it != fileSystems.end() ; ++it ) { ! if (INVALID_FS((*it).type())) continue; ! addItemToMountList( mountList, *it ); ! } ! ! // now, handle the non-mounted ones ! for (KMountPoint::List::iterator it = possible.begin(); it != possible.end(); ++it) { ! // make sure we don't add things we've already added ! if (KMountMan::findInListByMntPoint(mounted, (*it)->mountPoint())) { ! continue; ! } else { ! fsData data; ! data.setMntPoint((*it)->mountPoint()); ! data.setMounted(false); ! data.setType((*it)->mountType()); ! data.setName((*it)->mountedFrom()); ! fileSystems.append(data); ! ! if (INVALID_FS(data.type())) continue; ! addItemToMountList(mountList, data); ! } ! } ! ! mountList->clearSelection(); ! if ( info ) { ! info->setEmpty( true ); ! info->repaint(); ! } ! watcher->start( WATCHER_DELAY, true ); // starting the watch timer ( single shot ) } ! void KMountManGUI::checkMountChange() { ! if (QFileInfo(MTAB).lastModified() != lastMtab) ! getSpaceData(); ! watcher->start( WATCHER_DELAY, true ); // starting the watch timer ( single shot ) } ! void KMountManGUI::doubleClicked( QListViewItem *i ) { ! if ( !i ) ! return; // we don't want to refresh to swap, do we ? ! ! // change the active panel to this mountpoint ! connect( ( QObject* ) this, SIGNAL( refreshPanel( const KURL & ) ), ( QObject* ) SLOTS, ! SLOT( refresh( const KURL & ) ) ); ! emit refreshPanel( vfs::fromPathOrURL( i->text(2) ) ); // text(2) ? so ugly ... ! disconnect( this, SIGNAL( refreshPanel( const KURL & ) ), 0, 0 ); ! slotClose(); } // when user clicks on a filesystem, change information ! void KMountManGUI::changeActive( QListViewItem *i ) { ! if ( !i ) return ; ! fsData *system = 0; ! ! for (QValueList<fsData>::Iterator it = fileSystems.begin(); it != fileSystems.end(); ++it) { ! // the only thing which is unique is the mount point ! if ((*it).mntPoint() == i->text(2)) { // text(2) ? ugly ugly ugly ! system = &(*it); ! break; ! } ! } ! ! if (system == 0) { ! KMessageBox::error(0, i18n("Critical Error"), i18n("Internal error in MountMan\nCall the developers")); ! exit(1); ! } ! info->setAlias( system->mntPoint() ); ! info->setRealName( system->name() ); ! info->setMounted( system->mounted() ); ! info->setEmpty( false ); ! info->setTotalSpace( system->totalBlks() ); ! info->setFreeSpace( system->freeBlks() ); ! info->repaint(); } // called when right-clicked on a filesystem ! void KMountManGUI::clicked( QListViewItem *item ) { ! // these are the values that will exist in the menu ! #define MOUNT_ID 90 ! #define UNMOUNT_ID 91 ! #define FORMAT_ID 93 ! #define EJECT_ID 94 ! ////////////////////////////////////////////////////////// ! if ( !item ) return ; ! ! fsData *system = 0; ! for (QValueList<fsData>::Iterator it = fileSystems.begin(); it != fileSystems.end(); ++it) { ! // the only thing which is unique is the mount point ! if ((*it).mntPoint() == item->text(2)) { // text(2) ? ugly ugly ugly ! system = &(*it); ! break; ! } ! } ! ! if ( !system ) { ! KMessageBox::error( 0, i18n( "MountMan has an internal error. Please notify the developers. Thank you." ) ); ! exit( 0 ); ! } ! // create the menu ! KPopupMenu popup; ! popup.insertTitle( i18n( "MountMan" ) ); ! if ( !system->mounted() ) ! popup.insertItem( i18n( "Mount" ), MOUNT_ID ); ! else popup.insertItem( i18n( "Unmount" ), UNMOUNT_ID ); ! if ( krMtMan.ejectable( system->mntPoint() ) ) ! // if (system->type()=="iso9660" || krMtMan.followLink(system->name()).left(2)=="cd") ! popup.insertItem( i18n( "Eject" ), EJECT_ID ); ! else { ! popup.insertItem( i18n( "Format" ), FORMAT_ID ); ! popup.setItemEnabled( FORMAT_ID, false ); ! } ! int result = popup.exec( QCursor::pos() ); ! // check out the user's option ! switch ( result ) { ! case - 1 : return ; // the user clicked outside of the menu ! case MOUNT_ID : ! case UNMOUNT_ID : ! krMtMan.toggleMount( system->mntPoint() ); ! break; ! case FORMAT_ID : ! break; ! case EJECT_ID : ! KMountMan::eject( system->mntPoint() ); ! break; ! } } |
From: Shie E. <er...@us...> - 2004-09-17 17:33:10
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12577/krusader/Dialogs Modified Files: krspecialwidgets.cpp Log Message: new mountman Index: krspecialwidgets.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Dialogs/krspecialwidgets.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** krspecialwidgets.cpp 7 Feb 2004 11:50:20 -0000 1.9 --- krspecialwidgets.cpp 17 Sep 2004 17:33:01 -0000 1.10 *************** *** 1,8 **** /*************************************************************************** ! krspecialwidgets.cpp ! ------------------- ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net --------------------------------------------------------------------------- Description --- 1,8 ---- /*************************************************************************** ! krspecialwidgets.cpp ! ------------------- ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net --------------------------------------------------------------------------- Description *************** *** 11,22 **** A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! S o u r c e F i l e *************************************************************************** --- 11,22 ---- A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! S o u r c e F i l e *************************************************************************** *************** *** 67,213 **** KRFSDisplay::KRFSDisplay( QWidget *parent, QString _alias, QString _realName, KIO::filesize_t _total, KIO::filesize_t _free ) : QWidget( parent ), totalSpace( _total ), ! freeSpace( _free ), alias( _alias ), realName( _realName ), mounted( true ), empty( false ), supermount( false ) { ! resize( 150, 200 ); ! show(); ! } // Use this one for an unmounted filesystem KRFSDisplay::KRFSDisplay( QWidget *parent, QString _alias, QString _realName, bool sm ) : ! QWidget( parent ), alias( _alias ), realName( _realName ), mounted( false ), empty( false ), supermount( sm ) { ! resize( 150, 200 ); ! show(); ! } // This is used only when an empty widget needs to be displayed (for example: // when filesystem statistics haven't been calculated yet) KRFSDisplay::KRFSDisplay( QWidget *parent ) : QWidget( parent ), empty( true ) { ! resize( 150, 200 ); ! show(); ! } // The main painter! void KRFSDisplay::paintEvent( QPaintEvent * ) { ! QPainter paint( this ); ! if ( !empty ) { ! // create the text ! // first, name and location ! paint.setFont( QFont( "helvetica", 12, QFont::Bold ) ); ! paint.drawText( 10, 20, alias ); ! paint.setFont( QFont( "helvetica", 12, QFont::Normal ) ); ! paint.drawText( 10, 37, "(" + realName + ")" ); ! if ( supermount ) { // we don't support supermount anymore paint.setFont( QFont( "helvetica", 12, QFont::Bold ) ); ! paint.drawText( 10, 60, i18n( "Supermount device." ) ); ! paint.setFont( QFont( "helvetica", 10, QFont::Bold ) ); ! paint.drawText( 10, 80, i18n( "Unable to get information" ) ); ! paint.drawText( 10, 90, i18n( "on a supermounted device." ) ); ! paint.drawText( 10, 100, i18n( "For details, please read" ) ); ! paint.drawText( 10, 110, i18n( "the Krusader FAQ." ) ); ! } else if ( mounted ) { // incase the filesystem is already mounted ! // second, the capacity ! paint.drawText( 10, 70, i18n( "Capacity: " ) + KIO::convertSizeFromKB( totalSpace ) ); ! // third, the 2 boxes (used, free) ! QPen systemPen = paint.pen(); ! paint.setPen( Qt::black ); ! paint.drawRect( 10, 90, 10, 10 ); ! paint.fillRect( 11, 91, 8, 8, QBrush( Qt::gray ) ); ! paint.drawRect( 10, 110, 10, 10 ); ! paint.fillRect( 11, 111, 8, 8, QBrush( Qt::white ) ); ! // now, the text for the boxes ! paint.setPen( systemPen ); ! paint.drawText( 25, 100, i18n( "Used: " ) + KIO::convertSizeFromKB( totalSpace - freeSpace ) ); ! paint.drawText( 25, 120, i18n( "Free: " ) + KIO::convertSizeFromKB( freeSpace ) ); ! // first, create the empty pie ! // bottom... ! paint.setPen( Qt::black ); ! paint.setBrush( Qt::white ); ! paint.drawPie( LEFT, BOTTOM, WIDTH, HEIGHT, STARTANGLE, DEG( 360 ) ); ! // body... ! paint.setPen( Qt::lightGray ); ! for ( int i = 1; i < Z_HEIGHT; ++i ) ! paint.drawPie( LEFT, BOTTOM - i, WIDTH, HEIGHT, STARTANGLE, DEG( 360 ) ); ! // side lines... ! paint.setPen( Qt::black ); ! paint.drawLine( LEFT, BOTTOM + HEIGHT / 2, LEFT, BOTTOM + HEIGHT / 2 - Z_HEIGHT ); ! paint.drawLine( LEFT + WIDTH, BOTTOM + HEIGHT / 2, LEFT + WIDTH, BOTTOM + HEIGHT / 2 - Z_HEIGHT ); ! // top of the pie ! paint.drawPie( LEFT, BOTTOM - Z_HEIGHT, WIDTH, HEIGHT, STARTANGLE, DEG( 360 ) ); ! // the "used space" slice ! float i = ( ( float ) ( totalSpace - freeSpace ) / ( totalSpace ) ) * 360.0; ! paint.setBrush( Qt::gray ); ! paint.drawPie( LEFT, BOTTOM - Z_HEIGHT, WIDTH, HEIGHT, STARTANGLE, ( int ) DEG( i ) ); ! // if we need to draw a 3d stripe ... ! if ( i > 180.0 ) { ! for ( int j = 1; j < Z_HEIGHT; ++j ) ! paint.drawArc( LEFT, BOTTOM - j, WIDTH, HEIGHT, STARTANGLE - 16 * 180, ( int ) ( DEG( i - 180.0 ) ) ); ! } ! } else { // if the filesystem is unmounted... ! paint.setFont( QFont( "helvetica", 12, QFont::Bold ) ); ! paint.drawText( 10, 60, i18n( "Not mounted." ) ); ! } ! } else { // if the widget is in empty situation... ! } ! } //////////////////////////////////////////////////////////////////////////////// KRPie::KRPie( KIO::filesize_t _totalSize, QWidget *parent ) : QWidget( parent, 0 ), totalSize( _totalSize ) { ! slices.setAutoDelete( true ); // kill items when they are removed ! slices.append( new KRPieSlice( 100, Qt::yellow, "DEFAULT" ) ); ! sizeLeft = totalSize; ! resize( 300, 300 ); ! } void KRPie::paintEvent( QPaintEvent * ) { ! QPainter paint( this ); ! // now create the slices ! KRPieSlice *slice; ! float sAngle = STARTANGLE; ! for ( slice = slices.first(); slice != 0; slice = slices.next() ) { ! paint.setBrush( slice->getColor() ); ! paint.setPen( slice->getColor() ); ! // angles are negative to create a clock-wise drawing of slices ! float angle = -( slice->getPerct() / 100 * 360 ) * 16; ! for ( int i = 1; i < Z_HEIGHT; ++i ) ! paint.drawPie( LEFT, BOTTOM + i, WIDTH, HEIGHT, ( int ) sAngle, ( int ) angle ); ! sAngle += angle; ! } ! paint.setPen( Qt::yellow ); // pen ! paint.setBrush( Qt::yellow ); // fill ! // for (int i=1; i<Z_HEIGHT; ++i) ! // paint.drawPie(LEFT,BOTTOM+i,WIDTH,HEIGHT,sAngle,360*16-(STARTANGLE-sAngle)); ! sAngle = STARTANGLE; ! for ( slice = slices.first(); slice != 0; slice = slices.next() ) { ! paint.setBrush( slice->getColor() ); ! paint.setPen( slice->getColor() ); ! // angles are negative to create a clock-wise drawing of slices ! float angle = -( slice->getPerct() / 100 * 360 ) * 16; ! paint.drawPie( LEFT, BOTTOM, WIDTH, HEIGHT, ( int ) sAngle, ( int ) angle ); ! sAngle += angle; ! } ! paint.setPen( Qt::black ); ! // the pie ! // paint.drawPie(LEFT,BOTTOM,WIDTH,HEIGHT,STARTANGLE,360*16); ! ///////////////////////// end of empty pie ///////////////////////// ! // now, the pie is ready to draw slices on... ! // to make a good look on the perimiter, draw another black circle ! paint.setPen( Qt::black ); ! paint.drawArc( LEFT, BOTTOM, WIDTH, HEIGHT, STARTANGLE, 360 * 16 ); ! } void KRPie::addSlice( KIO::filesize_t size, QString label ) { ! int i = ( slices.count() % 12 ); ! slices.removeLast(); ! slices.append( new KRPieSlice( size * 100 / totalSize, colors[ i ], label ) ); ! sizeLeft -= size; ! slices.append( new KRPieSlice( sizeLeft * 100 / totalSize, Qt::yellow, "DEFAULT" ) ); ! } //////////////////////////////////////////////////// --- 67,204 ---- KRFSDisplay::KRFSDisplay( QWidget *parent, QString _alias, QString _realName, KIO::filesize_t _total, KIO::filesize_t _free ) : QWidget( parent ), totalSpace( _total ), ! freeSpace( _free ), alias( _alias ), realName( _realName ), mounted( true ), empty( false ), supermount( false ) { ! resize( 150, 200 ); ! show(); ! } // Use this one for an unmounted filesystem KRFSDisplay::KRFSDisplay( QWidget *parent, QString _alias, QString _realName, bool sm ) : ! QWidget( parent ), alias( _alias ), realName( _realName ), mounted( false ), empty( false ), supermount( sm ) { ! resize( 150, 200 ); ! show(); ! } // This is used only when an empty widget needs to be displayed (for example: // when filesystem statistics haven't been calculated yet) KRFSDisplay::KRFSDisplay( QWidget *parent ) : QWidget( parent ), empty( true ) { ! resize( 150, 200 ); ! show(); ! } // The main painter! void KRFSDisplay::paintEvent( QPaintEvent * ) { ! QPainter paint( this ); ! if ( !empty ) { ! // create the text ! // first, name and location paint.setFont( QFont( "helvetica", 12, QFont::Bold ) ); ! paint.drawText( 10, 20, alias ); ! paint.setFont( QFont( "helvetica", 12, QFont::Normal ) ); ! paint.drawText( 10, 37, "(" + realName + ")" ); if ( mounted ) { // incase the filesystem is already mounted ! // second, the capacity ! paint.drawText( 10, 70, i18n( "Capacity: " ) + KIO::convertSizeFromKB( totalSpace ) ); ! // third, the 2 boxes (used, free) ! QPen systemPen = paint.pen(); ! paint.setPen( Qt::black ); ! paint.drawRect( 10, 90, 10, 10 ); ! paint.fillRect( 11, 91, 8, 8, QBrush( Qt::gray ) ); ! paint.drawRect( 10, 110, 10, 10 ); ! paint.fillRect( 11, 111, 8, 8, QBrush( Qt::white ) ); ! // now, the text for the boxes ! paint.setPen( systemPen ); ! paint.drawText( 25, 100, i18n( "Used: " ) + KIO::convertSizeFromKB( totalSpace - freeSpace ) ); ! paint.drawText( 25, 120, i18n( "Free: " ) + KIO::convertSizeFromKB( freeSpace ) ); ! // first, create the empty pie ! // bottom... ! paint.setPen( Qt::black ); ! paint.setBrush( Qt::white ); ! paint.drawPie( LEFT, BOTTOM, WIDTH, HEIGHT, STARTANGLE, DEG( 360 ) ); ! // body... ! paint.setPen( Qt::lightGray ); ! for ( int i = 1; i < Z_HEIGHT; ++i ) ! paint.drawPie( LEFT, BOTTOM - i, WIDTH, HEIGHT, STARTANGLE, DEG( 360 ) ); ! // side lines... ! paint.setPen( Qt::black ); ! paint.drawLine( LEFT, BOTTOM + HEIGHT / 2, LEFT, BOTTOM + HEIGHT / 2 - Z_HEIGHT ); ! paint.drawLine( LEFT + WIDTH, BOTTOM + HEIGHT / 2, LEFT + WIDTH, BOTTOM + HEIGHT / 2 - Z_HEIGHT ); ! // top of the pie ! paint.drawPie( LEFT, BOTTOM - Z_HEIGHT, WIDTH, HEIGHT, STARTANGLE, DEG( 360 ) ); ! // the "used space" slice ! float i = ( ( float ) ( totalSpace - freeSpace ) / ( totalSpace ) ) * 360.0; ! paint.setBrush( Qt::gray ); ! paint.drawPie( LEFT, BOTTOM - Z_HEIGHT, WIDTH, HEIGHT, STARTANGLE, ( int ) DEG( i ) ); ! // if we need to draw a 3d stripe ... ! if ( i > 180.0 ) { ! for ( int j = 1; j < Z_HEIGHT; ++j ) ! paint.drawArc( LEFT, BOTTOM - j, WIDTH, HEIGHT, STARTANGLE - 16 * 180, ( int ) ( DEG( i - 180.0 ) ) ); ! } ! } else { // if the filesystem is unmounted... ! paint.setFont( QFont( "helvetica", 12, QFont::Bold ) ); ! paint.drawText( 10, 60, i18n( "Not mounted." ) ); ! } ! } else { // if the widget is in empty situation... ! } ! } //////////////////////////////////////////////////////////////////////////////// KRPie::KRPie( KIO::filesize_t _totalSize, QWidget *parent ) : QWidget( parent, 0 ), totalSize( _totalSize ) { ! slices.setAutoDelete( true ); // kill items when they are removed ! slices.append( new KRPieSlice( 100, Qt::yellow, "DEFAULT" ) ); ! sizeLeft = totalSize; ! resize( 300, 300 ); ! } void KRPie::paintEvent( QPaintEvent * ) { ! QPainter paint( this ); ! // now create the slices ! KRPieSlice *slice; ! float sAngle = STARTANGLE; ! for ( slice = slices.first(); slice != 0; slice = slices.next() ) { ! paint.setBrush( slice->getColor() ); ! paint.setPen( slice->getColor() ); ! // angles are negative to create a clock-wise drawing of slices ! float angle = -( slice->getPerct() / 100 * 360 ) * 16; ! for ( int i = 1; i < Z_HEIGHT; ++i ) ! paint.drawPie( LEFT, BOTTOM + i, WIDTH, HEIGHT, ( int ) sAngle, ( int ) angle ); ! sAngle += angle; ! } ! paint.setPen( Qt::yellow ); // pen ! paint.setBrush( Qt::yellow ); // fill ! // for (int i=1; i<Z_HEIGHT; ++i) ! // paint.drawPie(LEFT,BOTTOM+i,WIDTH,HEIGHT,sAngle,360*16-(STARTANGLE-sAngle)); ! sAngle = STARTANGLE; ! for ( slice = slices.first(); slice != 0; slice = slices.next() ) { ! paint.setBrush( slice->getColor() ); ! paint.setPen( slice->getColor() ); ! // angles are negative to create a clock-wise drawing of slices ! float angle = -( slice->getPerct() / 100 * 360 ) * 16; ! paint.drawPie( LEFT, BOTTOM, WIDTH, HEIGHT, ( int ) sAngle, ( int ) angle ); ! sAngle += angle; ! } ! paint.setPen( Qt::black ); ! // the pie ! // paint.drawPie(LEFT,BOTTOM,WIDTH,HEIGHT,STARTANGLE,360*16); ! ///////////////////////// end of empty pie ///////////////////////// ! // now, the pie is ready to draw slices on... ! // to make a good look on the perimiter, draw another black circle ! paint.setPen( Qt::black ); ! paint.drawArc( LEFT, BOTTOM, WIDTH, HEIGHT, STARTANGLE, 360 * 16 ); ! } void KRPie::addSlice( KIO::filesize_t size, QString label ) { ! int i = ( slices.count() % 12 ); ! slices.removeLast(); ! slices.append( new KRPieSlice( size * 100 / totalSize, colors[ i ], label ) ); ! sizeLeft -= size; ! slices.append( new KRPieSlice( sizeLeft * 100 / totalSize, Qt::yellow, "DEFAULT" ) ); ! } //////////////////////////////////////////////////// *************** *** 217,246 **** void KrQuickSearch::myKeyPressEvent( QKeyEvent *e ) { ! switch ( e->key() ) { ! case Key_Escape: ! emit stop( 0 ); ! break; ! case Key_Return: ! case Key_Enter: ! case Key_Tab: ! case Key_Right: ! case Key_Left: ! emit stop( e ); ! break; ! case Key_Down: ! otherMatching( text(), 1 ); ! break; ! case Key_Up: ! otherMatching( text(), -1 ); ! break; ! case Key_Insert: ! case Key_Home: ! case Key_End: ! process( e ); ! break; ! default: ! keyPressEvent( e ); ! } ! } --- 208,237 ---- void KrQuickSearch::myKeyPressEvent( QKeyEvent *e ) { ! switch ( e->key() ) { ! case Key_Escape: ! emit stop( 0 ); ! break; ! case Key_Return: ! case Key_Enter: ! case Key_Tab: ! case Key_Right: ! case Key_Left: ! emit stop( e ); ! break; ! case Key_Down: ! otherMatching( text(), 1 ); ! break; ! case Key_Up: ! otherMatching( text(), -1 ); ! break; ! case Key_Insert: ! case Key_Home: ! case Key_End: ! process( e ); ! break; ! default: ! keyPressEvent( e ); ! } ! } |
From: Shie E. <er...@us...> - 2004-09-17 17:31:29
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Panel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12261/krusader/Panel Modified Files: listpanel.cpp Log Message: missing #include Index: listpanel.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/listpanel.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** listpanel.cpp 17 Sep 2004 13:02:17 -0000 1.87 --- listpanel.cpp 17 Sep 2004 17:31:13 -0000 1.88 *************** *** 41,44 **** --- 41,45 ---- // KDE includes #include <kpopupmenu.h> + #include <kprocess.h> #include <kmessagebox.h> #include <klocale.h> |
From: Shie E. <er...@us...> - 2004-09-17 17:10:26
|
Update of /cvsroot/krusader/krusader_kde3/krusader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8400/krusader Modified Files: krslots.cpp Log Message: new mountman changes Index: krslots.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/krslots.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** krslots.cpp 15 Sep 2004 12:11:16 -0000 1.62 --- krslots.cpp 17 Sep 2004 17:10:15 -0000 1.63 *************** *** 363,366 **** --- 363,367 ---- void KRslots::runMountMan() { + // left as a precaution, although we use kde's services now if( !KrServices::cmdExist( "df" ) || !KrServices::cmdExist( "mount" ) ) { *************** *** 370,383 **** } ! if (krApp->mountMan->operational()) { ! while (!krApp->mountMan->ready()) ! usleep( 200000 ); ! krApp->mountMan->mainWindow(); ! } ! else ! { ! KMessageBox::error(0, i18n( "Failed to run 'df', MountMan cannot be started." ) ); ! return; ! } } --- 371,375 ---- } ! krApp->mountMan->mainWindow(); } |
From: Shie E. <er...@us...> - 2004-09-17 16:53:31
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Panel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5264/krusader/Panel Modified Files: panelfunc.cpp Log Message: unneeded #include Index: panelfunc.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/panelfunc.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** panelfunc.cpp 15 Sep 2004 05:26:34 -0000 1.87 --- panelfunc.cpp 17 Sep 2004 16:53:21 -0000 1.88 *************** *** 66,70 **** #include "../Dialogs/krspwidgets.h" #include "../KViewer/krviewer.h" - #include "../MountMan/kmountman.h" #include "../resources.h" #include "../krservices.h" --- 66,69 ---- |
From: Shie E. <er...@us...> - 2004-09-17 13:05:52
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22456/krusader/MountMan Modified Files: kmountman.h Log Message: code cleanup removing unneeded namespace moving to use kdelibs codebase Index: kmountman.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountman.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** kmountman.h 22 Jul 2004 09:09:45 -0000 1.12 --- kmountman.h 17 Sep 2004 13:05:41 -0000 1.13 *************** *** 1,9 **** /*************************************************************************** ! kmountman.h ! ------------------- ! begin : Thu May 4 2000 ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net --------------------------------------------------------------------------- *************************************************************************** --- 1,9 ---- /*************************************************************************** ! kmountman.h ! ------------------- ! begin : Thu May 4 2000 ! copyright : (C) 2000 by Shie Erlich & Rafi Yanai ! e-mail : kru...@us... ! web site : http://krusader.sourceforge.net --------------------------------------------------------------------------- *************************************************************************** *************** *** 11,22 **** A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! H e a d e r F i l e *************************************************************************** --- 11,22 ---- A ! db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. ! 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D ! 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' ! 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b ! 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. ! YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD ! H e a d e r F i l e *************************************************************************** *************** *** 48,221 **** #include <math.h> ! namespace MountMan { ! ! // forward definitions ! class fsData; ! ! class KMountMan : public QObject { ! Q_OBJECT ! friend class KMountManGUI; ! public: ! enum mntStatus {DOESNT_EXIST, NOT_MOUNTED, MOUNTED}; ! inline bool operational() { ! return Operational; ! } // check this 1st ! inline bool ready() { ! return Ready; ! } // poll on this until true ! void mainWindow(); // opens up the GUI ! void mount( QString mntPoint ); // this is probably what you need for mount ! void unmount( QString mntPoint ); // this is probably what you need for unmount ! mntStatus getStatus( QString mntPoint ); // return the status of a mntPoint (if any) ! void autoMount( QString path ); // just call it before refreshing into a dir ! static void eject( QString mntPoint ); ! bool ejectable( QString path ); ! QString convertSize( KIO::filesize_t size ); ! QString getMtab(); // reads the mount table ! bool checkMtabChanged(); // checks whether mtab was changed - //////////////////////////// service functions ///////////////////////////////// - static QString nextWord( QString &s ); - static QString nextWord( QString &s, char c ); - KMountMan(); - ~KMountMan(); ! public slots: ! void performAction( int idx ); ! void quickList(); ! private: ! QString *_actions; ! protected slots: ! void parseDfData( QString filename ); // parse a FULL list of filesystems ! void forceUpdate(); ! void collectOutput( KProcess *p, char *buffer, int buflen ); ! void collectMtab( KProcess *p, char *buffer, int buflen ); ! void finishUpdateFilesystems(); ! void killMountMan(); // called when df never finished (error) ! signals: ! void updated(); ! protected: ! void mount( fsData *p ); // you don't want to call this one ! ! void unmount( fsData *p ); // you don't want to call this one ! ! void toggleMount( QString device ); // you don't want to call this one ! ! QString followLink( QString source ); // internal to mountman/gui ! bool createFilesystems(); // potential filesystems from /etc/fstab ! void updateFilesystems(); // actually mounted systems using DF -T -P ! QString getDevice( QString mntPoint ); // mntPoint ==> device ! fsData* location( QString name ); // device ==> mntPoint ! QString pointFromMtab( QString device ); // returns mountPoint for a device ! QString devFromMtab( QString mntPoint ); // returns device for a mountPoint ! private: ! void clearOutput(); ! inline QString getOutput() { ! return QString( ( !outputBuffer ? ! QString::null : *outputBuffer ) ); ! } ! private: ! QStringList mountPoints; // all mountPoints excluding SUPERMOUNTED ones ! QList<fsData> filesystems; ! int noOfFilesystems; ! bool Ready; // true if MountMan finished all preprocessing ! bool Operational; // if false, something went terribly wrong on startup ! fsData *localDf; // used for moving around information ! QString *outputBuffer; // all processes output their data here ! KTempFile *tempFile; ! KShellProcess dfProc; ! KMountManGUI *mountManGui; ! QString mtab; // the mount table ! }; ! // Data container for a single-filesystem data ! // maximum size supported is 2GB of 1kb blocks == 2048GB, enough. ! ///////////////////////////////////////////////////////////////// ! class fsData { ! public: ! fsData() : Name( 0 ), Type( 0 ), MntPoint( 0 ), TotalBlks( 0 ), ! FreeBlks( 0 ), Mounted( false ) {} ! // get information ! inline QString name() { ! return Name; ! } ! inline QString shortName() { ! return Name.right( Name.length() - Name.find( "/", 1 ) - 1 ); ! } ! inline QString type() { ! return Type; ! } ! inline QString mntPoint() { ! return MntPoint; ! } ! inline long totalBlks() { ! return TotalBlks; ! } ! inline long freeBlks() { ! return FreeBlks; ! } ! inline KIO::filesize_t totalBytes() { ! return TotalBlks * 1024; ! } ! inline KIO::filesize_t freeBytes() { ! return FreeBlks * 1024; ! } ! //////////////////// insert a good round function here ///////////////// ! int usedPerct() { ! if ( TotalBlks == 0 ) ! return 0; ! float res = ( ( float ) ( TotalBlks - FreeBlks ) ) / ( ( float ) TotalBlks ) * 100; ! if ( ( res - ( int ) res ) > 0.5 ) ! return ( int ) res + 1; ! else ! return ( int ) res; ! } ! inline bool mounted() { ! return Mounted; ! } ! // set information ! inline void setName( QString n_ ) { ! Name = n_; ! } ! inline void setType( QString t_ ) { ! Type = t_; ! } ! inline void setMntPoint( QString m_ ) { ! MntPoint = m_; ! } ! inline void setTotalBlks( long t_ ) { ! TotalBlks = t_; ! } ! inline void setFreeBlks( long f_ ) { ! FreeBlks = f_; ! } ! inline void setMounted( bool m_ ) { ! Mounted = m_; ! } ! private: ! QString Name; // i.e: /dev/cdrom ! QString Type; // i.e: iso9600 ! QString MntPoint; // i.e: /mnt/cdrom ! long TotalBlks; // measured in 1024bytes per block ! long FreeBlks; ! bool Mounted; // true if filesystem is mounted ! // additional attributes of a filesystem, parsed from fstab ! public: ! bool supermount; // is the filesystem supermounted ? ! QString options; // additional fstab options ! }; }; --- 48,217 ---- #include <math.h> ! // forward definitions ! class fsData; ! class KMountMan : public QObject { ! Q_OBJECT ! friend class KMountManGUI; ! public: ! enum mntStatus {DOESNT_EXIST, NOT_MOUNTED, MOUNTED}; ! inline bool operational() { ! return Operational; ! } // check this 1st ! inline bool ready() { ! return Ready; ! } // poll on this until true ! void mainWindow(); // opens up the GUI ! void mount( QString mntPoint ); // this is probably what you need for mount ! void unmount( QString mntPoint ); // this is probably what you need for unmount ! mntStatus getStatus( QString mntPoint ); // return the status of a mntPoint (if any) ! void autoMount( QString path ); // just call it before refreshing into a dir ! static void eject( QString mntPoint ); ! bool ejectable( QString path ); ! QString convertSize( KIO::filesize_t size ); + QString getMtab(); // reads the mount table + bool checkMtabChanged(); // checks whether mtab was changed ! //////////////////////////// service functions ///////////////////////////////// ! static QString nextWord( QString &s ); ! static QString nextWord( QString &s, char c ); ! KMountMan(); ! ~KMountMan(); ! public slots: ! void performAction( int idx ); ! void quickList(); ! private: ! QString *_actions; ! protected slots: ! void parseDfData( QString filename ); // parse a FULL list of filesystems ! void forceUpdate(); ! void collectOutput( KProcess *p, char *buffer, int buflen ); ! void collectMtab( KProcess *p, char *buffer, int buflen ); ! void finishUpdateFilesystems(); ! void killMountMan(); // called when df never finished (error) ! signals: ! void updated(); ! protected: ! void mount( fsData *p ); // you don't want to call this one ! ! void unmount( fsData *p ); // you don't want to call this one ! ! void toggleMount( QString mntPoint ); // you don't want to call this one ! ! QString followLink( QString source ); // internal to mountman/gui ! bool createFilesystems(); // potential filesystems from /etc/fstab ! void updateFilesystems(); // actually mounted systems using DF -T -P ! QString getDevice( QString mntPoint ); // mntPoint ==> device ! fsData* location( QString name ); // device ==> mntPoint ! QString pointFromMtab( QString device ); // returns mountPoint for a device ! QString devFromMtab( QString mntPoint ); // returns device for a mountPoint ! private: ! void clearOutput(); ! inline QString getOutput() { ! return QString( ( !outputBuffer ? ! QString::null : *outputBuffer ) ); ! } ! private: ! QStringList mountPoints; // all mountPoints excluding SUPERMOUNTED ones ! QList<fsData> filesystems; ! int noOfFilesystems; ! bool Ready; // true if MountMan finished all preprocessing ! bool Operational; // if false, something went terribly wrong on startup ! fsData *localDf; // used for moving around information ! QString *outputBuffer; // all processes output their data here ! KTempFile *tempFile; ! KShellProcess dfProc; ! KMountManGUI *mountManGui; ! QString mtab; // the mount table ! }; ! // Data container for a single-filesystem data ! // maximum size supported is 2GB of 1kb blocks == 2048GB, enough. ! ///////////////////////////////////////////////////////////////// ! class fsData { ! public: ! fsData() : Name( 0 ), Type( 0 ), MntPoint( 0 ), TotalBlks( 0 ), ! FreeBlks( 0 ), Mounted( false ) {} ! // get information ! inline QString name() { ! return Name; ! } ! inline QString shortName() { ! return Name.right( Name.length() - Name.find( "/", 1 ) - 1 ); ! } ! inline QString type() { ! return Type; ! } ! inline QString mntPoint() { ! return MntPoint; ! } ! inline long totalBlks() { ! return TotalBlks; ! } ! inline long freeBlks() { ! return FreeBlks; ! } ! inline KIO::filesize_t totalBytes() { ! return TotalBlks * 1024; ! } ! inline KIO::filesize_t freeBytes() { ! return FreeBlks * 1024; ! } ! //////////////////// insert a good round function here ///////////////// ! int usedPerct() { ! if ( TotalBlks == 0 ) ! return 0; ! float res = ( ( float ) ( TotalBlks - FreeBlks ) ) / ( ( float ) TotalBlks ) * 100; ! if ( ( res - ( int ) res ) > 0.5 ) ! return ( int ) res + 1; ! else ! return ( int ) res; ! } ! inline bool mounted() { ! return Mounted; ! } ! // set information ! inline void setName( QString n_ ) { ! Name = n_; ! } ! inline void setType( QString t_ ) { ! Type = t_; ! } ! inline void setMntPoint( QString m_ ) { ! MntPoint = m_; ! } ! inline void setTotalBlks( long t_ ) { ! TotalBlks = t_; ! } ! inline void setFreeBlks( long f_ ) { ! FreeBlks = f_; ! } ! inline void setMounted( bool m_ ) { ! Mounted = m_; ! } ! private: ! QString Name; // i.e: /dev/cdrom ! QString Type; // i.e: iso9600 ! QString MntPoint; // i.e: /mnt/cdrom ! long TotalBlks; // measured in 1024bytes per block ! long FreeBlks; ! bool Mounted; // true if filesystem is mounted ! // additional attributes of a filesystem, parsed from fstab ! public: ! bool supermount; // is the filesystem supermounted ? ! QString options; // additional fstab options }; |
From: Shie E. <er...@us...> - 2004-09-17 13:05:28
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22300/krusader/MountMan Modified Files: kmountman.cpp Log Message: code cleanup removing unneeded namespace moving to use kdelibs codebase Index: kmountman.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountman.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** kmountman.cpp 17 Sep 2004 12:21:13 -0000 1.32 --- kmountman.cpp 17 Sep 2004 13:05:19 -0000 1.33 *************** *** 68,73 **** bool dfStartFailed = false; - using namespace MountMan; - KMountMan::KMountMan() : QObject(), Ready( false ), Operational( false ), outputBuffer( 0 ), tempFile( 0 ), mountManGui( 0 ), mtab( "" ) { --- 68,71 ---- *************** *** 457,461 **** m = *it; if (m->mountPoint() == mntPoint) ! return KMountMan::MOUNTED; } --- 455,459 ---- m = *it; if (m->mountPoint() == mntPoint) ! return MOUNTED; } *************** *** 465,474 **** m = *it; if (m->mountPoint() == mntPoint) { ! return KMountMan::NOT_MOUNTED; } } // 3: unknown ! return KMountMan::DOESNT_EXIST; } --- 463,472 ---- m = *it; if (m->mountPoint() == mntPoint) { ! return NOT_MOUNTED; } } // 3: unknown ! return DOESNT_EXIST; } *************** *** 732,742 **** } ! void KMountMan::toggleMount( QString device ) { ! fsData * p = location( device ); // request mountMan to (un)mount something, if he does his job (and he does) // we will be notified by signal ( p->mounted() ? unmount( p ) : mount( p ) ); } void KMountMan::autoMount( QString path ) { if ( getStatus( path ) == NOT_MOUNTED ) --- 730,757 ---- } ! void KMountMan::toggleMount( QString mntPoint ) { ! #if 0 ! fsData * p = location( device ); // request mountMan to (un)mount something, if he does his job (and he does) // we will be notified by signal ( p->mounted() ? unmount( p ) : mount( p ) ); + #endif + mntStatus status = getStatus(mntPoint); + switch (status) { + case MOUNTED: + unmount(mntPoint); + break; + case NOT_MOUNTED: + mount(mntPoint); + break; + } } + + + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + void KMountMan::autoMount( QString path ) { if ( getStatus( path ) == NOT_MOUNTED ) *************** *** 752,756 **** } - // returns true if the path is an ejectable mount point (at the moment CDROM) bool KMountMan::ejectable( QString path ) { --- 767,770 ---- *************** *** 769,772 **** --- 783,787 ---- } + // a mountMan special version of KIO::convertSize, which deals // with large filesystems ==> >4GB, it actually recieve size in *************** *** 802,805 **** --- 817,821 ---- } + // populate the pop-up menu of the mountman tool-button with actions void KMountMan::quickList() { *************** *** 880,881 **** --- 896,898 ---- } + |
From: Shie E. <er...@us...> - 2004-09-17 13:04:37
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22096/krusader/MountMan Modified Files: kmountmangui.cpp Log Message: code cleanup because of mountman changes Index: kmountmangui.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountmangui.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** kmountmangui.cpp 27 Jul 2004 22:32:53 -0000 1.9 --- kmountmangui.cpp 17 Sep 2004 13:04:27 -0000 1.10 *************** *** 50,54 **** #include <kguiitem.h> - using namespace MountMan; KMountManGUI::KMountManGUI() : KDialogBase(krApp, 0,true,"Mount.Man"), --- 50,53 ---- *************** *** 240,244 **** case MOUNT_ID : case UNMOUNT_ID : ! krMtMan.toggleMount(system->name()); break; case FORMAT_ID : --- 239,243 ---- case MOUNT_ID : case UNMOUNT_ID : ! krMtMan.toggleMount(system->mntPoint()); break; case FORMAT_ID : |
From: Shie E. <er...@us...> - 2004-09-17 13:04:14
|
Update of /cvsroot/krusader/krusader_kde3/krusader/MountMan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21989/krusader/MountMan Modified Files: kmountmangui.h Log Message: code cleanup because of mountman changes Index: kmountmangui.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/MountMan/kmountmangui.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kmountmangui.h 30 Dec 2003 20:39:32 -0000 1.4 --- kmountmangui.h 17 Sep 2004 13:03:50 -0000 1.5 *************** *** 48,53 **** class KRdirWatch; - namespace MountMan { - class KMountManGUI : public KDialogBase { Q_OBJECT --- 48,51 ---- *************** *** 81,84 **** }; - }; #endif --- 79,81 ---- |
From: Shie E. <er...@us...> - 2004-09-17 13:03:24
|
Update of /cvsroot/krusader/krusader_kde3/krusader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21901/krusader Modified Files: krusader.h Log Message: code cleanup because of mountman changes Index: krusader.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/krusader.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** krusader.h 15 Sep 2004 12:11:16 -0000 1.27 --- krusader.h 17 Sep 2004 13:03:16 -0000 1.28 *************** *** 46,50 **** #include <kaccel.h> #include <qstringlist.h> - #include "MountMan/kmountman.h" class KrusaderStatus; --- 46,49 ---- *************** *** 57,60 **** --- 56,60 ---- class UserMenu; class UserAction; + class KMountMan; class Krusader : public KParts::MainWindow { *************** *** 92,96 **** public: static Krusader *App; // a kApp style pointer ! MountMan::KMountMan *mountMan; // krusader's Mount Manager KrusaderView *mainView; // The GUI KConfig *config; // allow everyone to access the config --- 92,96 ---- public: static Krusader *App; // a kApp style pointer ! KMountMan *mountMan; // krusader's Mount Manager KrusaderView *mainView; // The GUI KConfig *config; // allow everyone to access the config |
From: Shie E. <er...@us...> - 2004-09-17 13:02:59
|
Update of /cvsroot/krusader/krusader_kde3/krusader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21788/krusader Modified Files: krusader.cpp Log Message: code cleanup because of mountman changes Index: krusader.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/krusader.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** krusader.cpp 15 Sep 2004 12:11:16 -0000 1.87 --- krusader.cpp 17 Sep 2004 13:02:50 -0000 1.88 *************** *** 80,83 **** --- 80,84 ---- #include "UserMenu/usermenu.h" #include "panelmanager.h" + #include "MountMan/kmountman.h" // define the static members *************** *** 196,200 **** // create MountMan ! mountMan = new MountMan::KMountMan(); // setup all the krusader's actions --- 197,201 ---- // create MountMan ! mountMan = new KMountMan(); // setup all the krusader's actions |
From: Shie E. <er...@us...> - 2004-09-17 13:02:27
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Panel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21722/krusader/Panel Modified Files: listpanel.cpp Log Message: code cleanup because of mountman changes Index: listpanel.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/listpanel.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** listpanel.cpp 30 Aug 2004 20:37:38 -0000 1.86 --- listpanel.cpp 17 Sep 2004 13:02:17 -0000 1.87 *************** *** 833,839 **** krCalculate->plug( &popup ); if ( func->files() ->vfs_getType() == vfs::NORMAL && item->isDir() && !multipleSelections ) { ! if ( krMtMan.getStatus( func->files() ->vfs_getFile( item->name() ).path( -1 ) ) == MountMan::KMountMan::MOUNTED ) popup.insertItem( i18n( "Unmount" ), UNMOUNT_ID ); ! else if ( krMtMan.getStatus( func->files() ->vfs_getFile( item->name() ).path( -1 ) ) == MountMan::KMountMan::NOT_MOUNTED ) popup.insertItem( i18n( "Mount" ), MOUNT_ID ); if ( krMtMan.ejectable( func->files() ->vfs_getFile( item->name() ).path( -1 ) ) ) --- 833,839 ---- krCalculate->plug( &popup ); if ( func->files() ->vfs_getType() == vfs::NORMAL && item->isDir() && !multipleSelections ) { ! if ( krMtMan.getStatus( func->files() ->vfs_getFile( item->name() ).path( -1 ) ) == KMountMan::MOUNTED ) popup.insertItem( i18n( "Unmount" ), UNMOUNT_ID ); ! else if ( krMtMan.getStatus( func->files() ->vfs_getFile( item->name() ).path( -1 ) ) == KMountMan::NOT_MOUNTED ) popup.insertItem( i18n( "Mount" ), MOUNT_ID ); if ( krMtMan.ejectable( func->files() ->vfs_getFile( item->name() ).path( -1 ) ) ) *************** *** 881,885 **** break; case EJECT_ID : ! MountMan::KMountMan::eject( func->files() ->vfs_getFile( item->name() ).path( -1 ) ); break; case SHRED_ID : --- 881,885 ---- break; case EJECT_ID : ! KMountMan::eject( func->files() ->vfs_getFile( item->name() ).path( -1 ) ); break; case SHRED_ID : |
From: Shie E. <er...@us...> - 2004-09-17 13:01:44
|
Update of /cvsroot/krusader/krusader_kde3/krusader/GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21571/krusader/GUI Modified Files: kcmdline.cpp Log Message: missing #include Index: kcmdline.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/GUI/kcmdline.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** kcmdline.cpp 29 Jul 2004 20:31:04 -0000 1.22 --- kcmdline.cpp 17 Sep 2004 13:01:35 -0000 1.23 *************** *** 53,56 **** --- 53,57 ---- #include <qstringlist.h> #include <qsizepolicy.h> + #include <ktempfile.h> KCMDLine::KCMDLine( QWidget *parent, const char *name ) : QWidget( parent, name ) { |
From: Shie E. <er...@us...> - 2004-09-17 13:00:39
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Panel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21358/krusader/Panel Modified Files: krview.h Log Message: code cleanup Index: krview.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/krview.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** krview.h 25 Jul 2004 22:57:29 -0000 1.14 --- krview.h 17 Sep 2004 13:00:31 -0000 1.15 *************** *** 144,151 **** inline void setWidget(QWidget *w) { _widget = w; } - /////////////////remove///////////////// - virtual QString itemToFilename(QListViewItem *it) = 0; - - // todo: what about selection modes ??? virtual ~KrView() {} --- 144,147 ---- |
From: Shie E. <er...@us...> - 2004-09-17 13:00:06
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Panel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21142/krusader/Panel Modified Files: krdetailedview.h Log Message: code cleanup Index: krdetailedview.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/krdetailedview.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** krdetailedview.h 9 Sep 2004 16:52:52 -0000 1.33 --- krdetailedview.h 17 Sep 2004 12:59:56 -0000 1.34 *************** *** 86,90 **** virtual void restoreSettings() { KListView::restoreLayout( _config, nameInKConfig() ); } virtual QString nameInKConfig() { return _nameInKConfig; } - virtual QString itemToFilename( QListViewItem *it ) { return dynamic_cast<KrViewItem*>( it ) ->name(); } //remove inline bool isCaseSensitiveSort() {return caseSensitiveSort;} --- 86,89 ---- |