Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/dialogs/qfiledialog_mac.mm

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6363#include <qdesktopwidget.h>
    6464#include <stdlib.h>
     65
    6566#include "ui_qfiledialog.h"
    6667
     
    246247        runModalForDirectory:mCurrentDir
    247248        file:selectable ? filename : @"untitled"];
     249
     250
    248251    return (mReturnCode == NSOKButton);
    249252}
     
    278281{
    279282    Q_UNUSED(sender);
     283
     284
     285
     286
    280287    QString qtFileName = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString)(filename);
    281288    QFileInfo info(qtFileName.normalized(QT_PREPEND_NAMESPACE(QString::NormalizationForm_C)));
     
    393400{
    394401    Q_UNUSED(sender);
    395     *mCurrentSelection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename]));
    396     if (mPriv)
    397         mPriv->QNSOpenSavePanelDelegate_selectionChanged(*mCurrentSelection);
     402    if (mPriv) {
     403        QString selection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename]));
     404        if (selection != mCurrentSelection) {
     405            *mCurrentSelection = selection;
     406            mPriv->QNSOpenSavePanelDelegate_selectionChanged(selection);
     407        }
     408    }
    398409}
    399410
     
    820831                // When changing directory, the current selection is cleared if
    821832                // we are supposed to be selecting files only:
    822                 fileDialogPrivate->mCurrentSelectionList.clear();
    823833                if (!fileDialogPrivate->mCurrentSelection.isEmpty()){
     834
    824835                    fileDialogPrivate->mCurrentSelection.clear();
    825836                    emit fileDialogPrivate->q_func()->currentChanged(fileDialogPrivate->mCurrentSelection);
     
    912923    navOptions.windowTitle = QCFString::toCFStringRef(q->windowTitle());
    913924
    914     static const int w = 450, h = 350;
    915     navOptions.location.h = navOptions.location.v = -1;
     925    navOptions.location.h = -1;
     926    navOptions.location.v = -1;
     927
    916928    QWidget *parent = q->parentWidget();
    917929    if (parent && parent->isVisible()) {
     
    921933        QString s = parent->windowTitle();
    922934        navOptions.clientName = QCFString::toCFStringRef(s);
    923         navOptions.location.h = (parent->x() + (parent->width() / 2)) - (w / 2);
    924         navOptions.location.v = (parent->y() + (parent->height() / 2)) - (h / 2);
    925 
    926         QRect r = QApplication::desktop()->screenGeometry(
    927                 QApplication::desktop()->screenNumber(parent));
    928         const int border = 10;
    929         if (navOptions.location.h + w > r.right())
    930             navOptions.location.h -= (navOptions.location.h + w) - r.right() + border;
    931         if (navOptions.location.v + h > r.bottom())
    932             navOptions.location.v -= (navOptions.location.v + h) - r.bottom() + border;
    933         if (navOptions.location.h < r.left())
    934             navOptions.location.h = r.left() + border;
    935         if (navOptions.location.v < r.top())
    936             navOptions.location.v = r.top() + border;
    937935    }
    938936
Note: See TracChangeset for help on using the changeset viewer.