author | llornkcor <llornkcor> | 2004-07-07 21:05:21 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-07-07 21:05:21 (UTC) |
commit | 8ff360bd5e136aba5a9c1b340040ecaf0fc6e0d4 (patch) (unidiff) | |
tree | 6fb3a67204a063e5031d1b4d98707b960ca2d806 | |
parent | 30d8a50aba298e26a3d3cc1d5b6a0c69c1d2783d (diff) | |
download | opie-8ff360bd5e136aba5a9c1b340040ecaf0fc6e0d4.zip opie-8ff360bd5e136aba5a9c1b340040ecaf0fc6e0d4.tar.gz opie-8ff360bd5e136aba5a9c1b340040ecaf0fc6e0d4.tar.bz2 |
fix combo filling with real QString instead of QDir object
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 817943b..58ffe3a 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -684,65 +684,65 @@ void OpieFtp::populateLocalView() | |||
684 | 684 | ||
685 | if(isDir || fileL.find("/",0,TRUE) != -1) { | 685 | if(isDir || fileL.find("/",0,TRUE) != -1) { |
686 | if( !QDir( fi->filePath() ).isReadable()) | 686 | if( !QDir( fi->filePath() ).isReadable()) |
687 | pm = Resource::loadPixmap( "lockedfolder" ); | 687 | pm = Resource::loadPixmap( "lockedfolder" ); |
688 | else | 688 | else |
689 | pm= Resource::loadPixmap( "folder" ); | 689 | pm= Resource::loadPixmap( "folder" ); |
690 | item->setPixmap( 0,pm ); | 690 | item->setPixmap( 0,pm ); |
691 | } else { | 691 | } else { |
692 | if( !fi->isReadable() ) | 692 | if( !fi->isReadable() ) |
693 | pm = Resource::loadPixmap( "locked" ); | 693 | pm = Resource::loadPixmap( "locked" ); |
694 | else { | 694 | else { |
695 | MimeType mt(fi->filePath()); | 695 | MimeType mt(fi->filePath()); |
696 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | 696 | pm=mt.pixmap(); //sets the correct pixmap for mimetype |
697 | if(pm.isNull()) | 697 | if(pm.isNull()) |
698 | pm = unknownXpm; | 698 | pm = unknownXpm; |
699 | } | 699 | } |
700 | } | 700 | } |
701 | if( fileL.find("->",0,TRUE) != -1) { | 701 | if( fileL.find("->",0,TRUE) != -1) { |
702 | // overlay link image | 702 | // overlay link image |
703 | pm= Resource::loadPixmap( "folder" ); | 703 | pm= Resource::loadPixmap( "folder" ); |
704 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 704 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
705 | QPainter painter( &pm ); | 705 | QPainter painter( &pm ); |
706 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 706 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
707 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | 707 | pm.setMask( pm.createHeuristicMask( FALSE ) ); |
708 | } | 708 | } |
709 | item->setPixmap( 0,pm); | 709 | item->setPixmap( 0,pm); |
710 | } | 710 | } |
711 | isDir=FALSE; | 711 | isDir=FALSE; |
712 | ++it; | 712 | ++it; |
713 | } | 713 | } |
714 | Local_View->setSorting( 3,FALSE); | 714 | Local_View->setSorting( 3,FALSE); |
715 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); | 715 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); |
716 | // fillCombo( (const QString &)currentDir); | 716 | fillCombo( (const QString &)currentDir.canonicalPath()); |
717 | } | 717 | } |
718 | 718 | ||
719 | bool OpieFtp::populateRemoteView( ) | 719 | bool OpieFtp::populateRemoteView( ) |
720 | { | 720 | { |
721 | // odebug << "populate remoteview" << oendl; | 721 | // odebug << "populate remoteview" << oendl; |
722 | QString sfile=QDir::homeDirPath(); | 722 | QString sfile=QDir::homeDirPath(); |
723 | if(sfile.right(1) != "/") | 723 | if(sfile.right(1) != "/") |
724 | sfile+="/._temp"; | 724 | sfile+="/._temp"; |
725 | else | 725 | else |
726 | sfile+="._temp"; | 726 | sfile+="._temp"; |
727 | QFile file( sfile); | 727 | QFile file( sfile); |
728 | Remote_View->clear(); | 728 | Remote_View->clear(); |
729 | QString s, File_Name; | 729 | QString s, File_Name; |
730 | QListViewItem *itemDir=NULL, *itemFile=NULL; | 730 | QListViewItem *itemDir=NULL, *itemFile=NULL; |
731 | QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] "); | 731 | QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] "); |
732 | QString fileL, fileS, fileDate; | 732 | QString fileL, fileS, fileDate; |
733 | if ( file.open(IO_ReadOnly)) { | 733 | if ( file.open(IO_ReadOnly)) { |
734 | QTextStream t( &file ); // use a text stream | 734 | QTextStream t( &file ); // use a text stream |
735 | while ( !t.eof()) { | 735 | while ( !t.eof()) { |
736 | s = t.readLine(); | 736 | s = t.readLine(); |
737 | 737 | ||
738 | if(s.find("total",0,TRUE) == 0) | 738 | if(s.find("total",0,TRUE) == 0) |
739 | continue; | 739 | continue; |
740 | 740 | ||
741 | int len, month = monthRe.match(s, 0, &len); | 741 | int len, month = monthRe.match(s, 0, &len); |
742 | fileDate = s.mid(month + 1, len - 2); // minus spaces | 742 | fileDate = s.mid(month + 1, len - 2); // minus spaces |
743 | fileL = s.right(s.length() - month - len); | 743 | fileL = s.right(s.length() - month - len); |
744 | if(s.left(1) == "d") | 744 | if(s.left(1) == "d") |
745 | fileL = fileL+"/"; | 745 | fileL = fileL+"/"; |
746 | fileS = s.mid(month - 8, 8); // FIXME | 746 | fileS = s.mid(month - 8, 8); // FIXME |
747 | fileS = fileS.stripWhiteSpace(); | 747 | fileS = fileS.stripWhiteSpace(); |
748 | 748 | ||
@@ -1111,65 +1111,64 @@ void OpieFtp::remoteRename() | |||
1111 | void OpieFtp::localRename() | 1111 | void OpieFtp::localRename() |
1112 | { | 1112 | { |
1113 | QString curFile = Local_View->currentItem()->text(0); | 1113 | QString curFile = Local_View->currentItem()->text(0); |
1114 | InputDialog *fileDlg; | 1114 | InputDialog *fileDlg; |
1115 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); | 1115 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); |
1116 | fileDlg->setTextEdit((const QString &)curFile); | 1116 | fileDlg->setTextEdit((const QString &)curFile); |
1117 | fileDlg->exec(); | 1117 | fileDlg->exec(); |
1118 | if( fileDlg->result() == 1 ) { | 1118 | if( fileDlg->result() == 1 ) { |
1119 | QString oldname = currentDir.canonicalPath() + "/" + curFile; | 1119 | QString oldname = currentDir.canonicalPath() + "/" + curFile; |
1120 | QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; | 1120 | QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; |
1121 | if( rename(oldname.latin1(), newName.latin1())== -1) | 1121 | if( rename(oldname.latin1(), newName.latin1())== -1) |
1122 | QMessageBox::message(tr("Note"),tr("Could not rename")); | 1122 | QMessageBox::message(tr("Note"),tr("Could not rename")); |
1123 | } | 1123 | } |
1124 | populateLocalView(); | 1124 | populateLocalView(); |
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | void OpieFtp::currentPathComboActivated(const QString & currentPath) { | 1127 | void OpieFtp::currentPathComboActivated(const QString & currentPath) { |
1128 | if (TabWidget->currentPageIndex() == 0) { | 1128 | if (TabWidget->currentPageIndex() == 0) { |
1129 | chdir( currentPath.latin1() ); | 1129 | chdir( currentPath.latin1() ); |
1130 | currentDir.cd( currentPath, TRUE); | 1130 | currentDir.cd( currentPath, TRUE); |
1131 | populateLocalView(); | 1131 | populateLocalView(); |
1132 | update(); | 1132 | update(); |
1133 | } else { | 1133 | } else { |
1134 | // chdir( currentPath.latin1() ); | 1134 | // chdir( currentPath.latin1() ); |
1135 | // currentDir.cd( currentPath, TRUE); | 1135 | // currentDir.cd( currentPath, TRUE); |
1136 | // populateList(); | 1136 | // populateList(); |
1137 | // update(); | 1137 | // update(); |
1138 | 1138 | ||
1139 | } | 1139 | } |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | void OpieFtp::fillCombo(const QString ¤tPath) { | 1142 | void OpieFtp::fillCombo(const QString ¤tPath) { |
1143 | qDebug("Fill Combo "+currentPath); | ||
1144 | currentPathCombo->lineEdit()->setText(currentPath); | 1143 | currentPathCombo->lineEdit()->setText(currentPath); |
1145 | 1144 | ||
1146 | if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { | 1145 | if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { |
1147 | qDebug("Clearing local"); | 1146 | qDebug("Clearing local"); |
1148 | currentPathCombo->clear(); | 1147 | currentPathCombo->clear(); |
1149 | localDirPathStringList.prepend(currentPath ); | 1148 | localDirPathStringList.prepend(currentPath ); |
1150 | currentPathCombo->insertStringList( localDirPathStringList,-1); | 1149 | currentPathCombo->insertStringList( localDirPathStringList,-1); |
1151 | } | 1150 | } |
1152 | 1151 | ||
1153 | currentPathCombo->lineEdit()->setText(currentPath); | 1152 | currentPathCombo->lineEdit()->setText(currentPath); |
1154 | 1153 | ||
1155 | if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { | 1154 | if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { |
1156 | qDebug("Clearing remote"); | 1155 | qDebug("Clearing remote"); |
1157 | currentPathCombo->clear(); | 1156 | currentPathCombo->clear(); |
1158 | remoteDirPathStringList.prepend(currentPath ); | 1157 | remoteDirPathStringList.prepend(currentPath ); |
1159 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); | 1158 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); |
1160 | } | 1159 | } |
1161 | } | 1160 | } |
1162 | 1161 | ||
1163 | void OpieFtp::fillRemoteCombo(const QString ¤tPath) { | 1162 | void OpieFtp::fillRemoteCombo(const QString ¤tPath) { |
1164 | 1163 | ||
1165 | currentPathCombo->lineEdit()->setText(currentPath); | 1164 | currentPathCombo->lineEdit()->setText(currentPath); |
1166 | if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { | 1165 | if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { |
1167 | currentPathCombo->clear(); | 1166 | currentPathCombo->clear(); |
1168 | remoteDirPathStringList.prepend(currentPath ); | 1167 | remoteDirPathStringList.prepend(currentPath ); |
1169 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); | 1168 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); |
1170 | } | 1169 | } |
1171 | } | 1170 | } |
1172 | 1171 | ||
1173 | void OpieFtp::currentPathComboChanged() | 1172 | void OpieFtp::currentPathComboChanged() |
1174 | { | 1173 | { |
1175 | QString oldRemoteCurrentDir = currentRemoteDir; | 1174 | QString oldRemoteCurrentDir = currentRemoteDir; |