summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp45
1 files changed, 24 insertions, 21 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 4e14946..3d97ecb 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -192,5 +192,6 @@ OpieFtp::OpieFtp( )
Remote_View->addColumn( tr("Date"),-1);
- Remote_View->setColumnAlignment(1,QListView::AlignRight);
+// Remote_View->setColumnAlignment(1,QListView::AlignRight);
Remote_View->addColumn( tr("Size"),-1);
Remote_View->setColumnAlignment(2,QListView::AlignRight);
+ Remote_View->setColumnAlignment(3,QListView::AlignCenter);
Remote_View->addColumn( tr("Dir"),-1);
@@ -723,2 +724,3 @@ bool OpieFtp::populateRemoteView( )
QListViewItem *itemDir=NULL, *itemFile=NULL;
+ QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] ");
QString fileL, fileS, fileDate;
@@ -728,27 +730,28 @@ bool OpieFtp::populateRemoteView( )
s = t.readLine();
- fileL = s.right(s.length()-55);
- fileL = fileL.stripWhiteSpace();
+
+ if(s.find("total",0,TRUE) == 0)
+ continue;
+
+ int len, month = monthRe.match(s, 0, &len);
+ fileDate = s.mid(month + 1, len - 2); // minus spaces
+ fileL = s.right(s.length() - month - len);
if(s.left(1) == "d")
fileL = fileL+"/";
-// fileL = "/"+fileL+"/";
- fileS = s.mid( 30, 42-30);
+ fileS = s.mid(month - 8, 8); // FIXME
fileS = fileS.stripWhiteSpace();
- fileDate = s.mid( 42, 55-42);
- fileDate = fileDate.stripWhiteSpace();
- if(fileL.find("total",0,TRUE) == -1) {
- if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
- QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d");
- item->setPixmap( 0, Resource::loadPixmap( "folder" ));
+
+ if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
+ QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d");
+ item->setPixmap( 0, Resource::loadPixmap( "folder" ));
// if(itemDir)
- item->moveItem(itemDir);
- itemDir=item;
- } else {
- QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f");
- item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
+ item->moveItem(itemDir);
+ itemDir=item;
+ } else {
+ QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f");
+ item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
// if(itemFile)
- item->moveItem(itemDir);
- item->moveItem(itemFile);
- itemFile=item;
- }
- }
+ item->moveItem(itemDir);
+ item->moveItem(itemFile);
+ itemFile=item;
+ }
}