src/gui/dialogs/qfiledialog_mac.mm
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   397 }
   397 }
   398 
   398 
   399 - (void)panelSelectionDidChange:(id)sender
   399 - (void)panelSelectionDidChange:(id)sender
   400 {
   400 {
   401     Q_UNUSED(sender);
   401     Q_UNUSED(sender);
   402     *mCurrentSelection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename]));
   402     if (mPriv) {
   403     if (mPriv)
   403         QString selection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename]));
   404         mPriv->QNSOpenSavePanelDelegate_selectionChanged(*mCurrentSelection);
   404         if (selection != mCurrentSelection) {
       
   405             *mCurrentSelection = selection;
       
   406             mPriv->QNSOpenSavePanelDelegate_selectionChanged(selection);
       
   407         }
       
   408     }
   405 }
   409 }
   406 
   410 
   407 - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode  contextInfo:(void *)contextInfo
   411 - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode  contextInfo:(void *)contextInfo
   408 {
   412 {
   409     Q_UNUSED(panel);
   413     Q_UNUSED(panel);
   824             QFileDialog::FileMode mode = fileDialogPrivate->fileMode;
   828             QFileDialog::FileMode mode = fileDialogPrivate->fileMode;
   825             if (mode == QFileDialog::AnyFile || mode == QFileDialog::ExistingFile
   829             if (mode == QFileDialog::AnyFile || mode == QFileDialog::ExistingFile
   826                     || mode == QFileDialog::ExistingFiles){
   830                     || mode == QFileDialog::ExistingFiles){
   827                 // When changing directory, the current selection is cleared if
   831                 // When changing directory, the current selection is cleared if
   828                 // we are supposed to be selecting files only:
   832                 // we are supposed to be selecting files only:
   829                 fileDialogPrivate->mCurrentSelectionList.clear();
       
   830                 if (!fileDialogPrivate->mCurrentSelection.isEmpty()){
   833                 if (!fileDialogPrivate->mCurrentSelection.isEmpty()){
       
   834                     fileDialogPrivate->mCurrentSelectionList.clear();
   831                     fileDialogPrivate->mCurrentSelection.clear();
   835                     fileDialogPrivate->mCurrentSelection.clear();
   832                     emit fileDialogPrivate->q_func()->currentChanged(fileDialogPrivate->mCurrentSelection);
   836                     emit fileDialogPrivate->q_func()->currentChanged(fileDialogPrivate->mCurrentSelection);
   833                 }
   837                 }
   834             }
   838             }
   835             fileDialogPrivate->setLastVisitedDirectory(newLocation);
   839             fileDialogPrivate->setLastVisitedDirectory(newLocation);