]> source.dussan.org Git - tigervnc.git/commitdiff
Small code improvements.
authorDennis Syrovatsky <dennis@tightvnc.com>
Mon, 22 May 2006 08:14:52 +0000 (08:14 +0000)
committerDennis Syrovatsky <dennis@tightvnc.com>
Mon, 22 May 2006 08:14:52 +0000 (08:14 +0000)
Fixed bug with it - the server didn't send message FileListData when the requested folder is unavailable for any reasons.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@574 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfb/SFileTransfer.cxx
vncviewer/FTDialog.cxx
vncviewer/FileTransfer.cxx

index fe4e9afcf4ca889deba4b08ce5b479286f36fb01..6f444e9bd5c7fb8ca3569eb50ccc3bb87ba26f3a 100644 (file)
@@ -83,8 +83,9 @@ SFileTransfer::processFileListRequest()
   if (flags & 0x10) bDirOnly = true;
 
   FileInfo fi;
-  if (!makeFileList(szDirName, &fi, bDirOnly)) return false;
-
+  if (!makeFileList(szDirName, &fi, bDirOnly)) {
+    flags = (flags | 0x80);  
+  }
   return m_writer.writeFileListData((unsigned char)flags, &fi);
 }
 
index 409d3b17ff372fa805e4c012c7dddcc7d7e77714..5f71f7dd83b679faa1eeaf6ebc3dfc4bb11e3626 100644 (file)
@@ -403,9 +403,12 @@ FTDialog::onRemoteBrowse()
   m_bLocalBrowsing = false;
 
   m_pBrowseDlg = new FTBrowseDlg(this);
-  m_pBrowseDlg->create();
-
-  m_pFileTransfer->requestFileList("", FT_FLR_DEST_BROWSE, true);
+  if (m_pBrowseDlg->create()) {
+    m_pFileTransfer->requestFileList("", FT_FLR_DEST_BROWSE, true);
+  } else {
+    delete m_pBrowseDlg;
+    m_pBrowseDlg = NULL;
+  }
 }
 
 void 
@@ -439,7 +442,7 @@ FTDialog::showLocalLVItems()
 void
 FTDialog::showRemoteLVItems()
 {
-  m_pFileTransfer->requestFileList(m_szRemotePathTmp, FT_FLR_DEST_MAIN, 0);
+  m_pFileTransfer->requestFileList(m_szRemotePathTmp, FT_FLR_DEST_MAIN, false);
 }
 
 void 
@@ -473,6 +476,8 @@ void
 FTDialog::reqFolderUnavailable()
 {
   strcpy(m_szRemotePathTmp, m_szRemotePath);
+  SetWindowText(m_hwndRemotePath, m_szRemotePath);
+  UpdateWindow(m_hwndFTDialog);
 }
 
 int
index 46d4799adfd6310bfad4ceabf1c44d70e46d28a6..cf57072f39317d82b8b1ee72fe67a0ff2602e3da 100644 (file)
@@ -382,8 +382,7 @@ FileTransfer::createRemoteFolder(char *pPath, char *pName)
   sprintf(fullPath, "%s\\%s", pPath, pName);
   m_pFTDialog->setStatusText("Creating Remote Folder: %s", fullPath);
   writeFileCreateDirRqst(strlen(fullPath), fullPath);
-  m_queueFileListRqst.add(pPath, 0, 0, FT_FLR_DEST_MAIN);
-  writeFileListRqst(strlen(pPath), pPath, false);
+  requestFileList(pPath, FT_FLR_DEST_MAIN, false);
 }
 
 void 
@@ -397,8 +396,7 @@ FileTransfer::renameRemote(char *pPath, char *pOldName, char *pNewName)
 
   writeFileRenameRqst(strlen(fullOldName), strlen(fullNewName),
                       fullOldName, fullNewName);
-  m_queueFileListRqst.add(pPath, 0, 0, FT_FLR_DEST_MAIN);
-  writeFileListRqst(strlen(pPath), pPath, false);
+  requestFileList(pPath, FT_FLR_DEST_MAIN, false);
 }
 
 bool