author | llornkcor <llornkcor> | 2002-10-18 00:07:20 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-18 00:07:20 (UTC) |
commit | e7e36afd3685c7fab146ebd0078d7f1a60f8c5e6 (patch) (side-by-side diff) | |
tree | 4c8e6cec21577de93127658b730d3685d5f62b90 | |
parent | e688f02fa2d750eca01c92435d8793ba17aa050a (diff) | |
download | opie-e7e36afd3685c7fab146ebd0078d7f1a60f8c5e6.zip opie-e7e36afd3685c7fab146ebd0078d7f1a60f8c5e6.tar.gz opie-e7e36afd3685c7fab146ebd0078d7f1a60f8c5e6.tar.bz2 |
patch by Ben Jackson, and changed listview alignment
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 21 |
1 files changed, 12 insertions, 9 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,12 +730,14 @@ 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) { @@ -753,3 +757,2 @@ bool OpieFtp::populateRemoteView( ) } - } QListViewItem * item1 = new QListViewItem( Remote_View, "../"); |