Mercurial > retraceit
comparison src/mainwindow.cpp @ 92:faece2c21229 1.1
Remove dead Drag&Drop code
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 19 Jun 2015 14:28:36 +0200 |
parents | c3000fa6ca56 |
children | ad78dc946ed3 |
comparison
equal
deleted
inserted
replaced
91:bbc3772fe877 | 92:faece2c21229 |
---|---|
97 if (mSettings.contains("geometry")) { | 97 if (mSettings.contains("geometry")) { |
98 restoreGeometry(mSettings.value("geometry").toByteArray()); | 98 restoreGeometry(mSettings.value("geometry").toByteArray()); |
99 restoreState(mSettings.value("windowState").toByteArray()); | 99 restoreState(mSettings.value("windowState").toByteArray()); |
100 } | 100 } |
101 } | 101 } |
102 /* | |
103 void MainWindow::dragEnterEvent(QDragEnterEvent *event) | |
104 { | |
105 if (event->mimeData()->hasUrls()) { | |
106 foreach (const QUrl & url, event->mimeData()->urls()) { | |
107 if (url.isLocalFile()) { | |
108 event->acceptProposedAction(); | |
109 return; | |
110 } | |
111 } | |
112 } | |
113 } | |
114 | 102 |
115 void MainWindow::dragMoveEvent(QDragMoveEvent *event) | |
116 { | |
117 if (event->mimeData()->hasUrls()) { | |
118 foreach (const QUrl & url, event->mimeData()->urls()) { | |
119 if (url.isLocalFile()) { | |
120 event->acceptProposedAction(); | |
121 return; | |
122 } | |
123 } | |
124 } | |
125 } | |
126 | |
127 void MainWindow::dropEvent(QDropEvent *event) | |
128 { | |
129 const QMimeData *mimeData = event->mimeData(); | |
130 | |
131 if (mimeData->hasUrls()) { | |
132 foreach (const QUrl & url, mimeData->urls()) { | |
133 if (!url.isLocalFile()) { | |
134 qDebug() << "Ignoring drop of " << url; | |
135 continue; | |
136 } | |
137 } | |
138 } | |
139 } | |
140 | |
141 void MainWindow::dragLeaveEvent(QDragLeaveEvent *event) | |
142 { | |
143 event->accept(); | |
144 } | |
145 */ | |
146 void MainWindow::setFolder(const QString& folder) | 103 void MainWindow::setFolder(const QString& folder) |
147 { | 104 { |
148 QFileInfo fi(folder); | 105 QFileInfo fi(folder); |
149 mSettings.setValue(SUB_FOLDER_KEY, folder); | 106 mSettings.setValue(SUB_FOLDER_KEY, folder); |
150 if (!fi.isDir() || !fi.isReadable()) { | 107 if (!fi.isDir() || !fi.isReadable()) { |
204 connect(fsDialog, &FolderSelectDialog::backClicked, | 161 connect(fsDialog, &FolderSelectDialog::backClicked, |
205 this, &MainWindow::showWithFolderSelect); | 162 this, &MainWindow::showWithFolderSelect); |
206 connect(fsDialog, &FolderSelectDialog::backClicked, | 163 connect(fsDialog, &FolderSelectDialog::backClicked, |
207 fsDialog, &QDialog::close); | 164 fsDialog, &QDialog::close); |
208 fsDialog->show(); | 165 fsDialog->show(); |
209 // connect(fsDialog, &QDialog::closeEvent, fsDialog, &QObject::deleteLater); | |
210 } | 166 } |
211 | 167 |
212 void MainWindow::showWithFolderSelect() { | 168 void MainWindow::showWithFolderSelect() { |
213 const QString startFolder = mSettings.value(ROOT_FOLDER_KEY, | 169 const QString startFolder = mSettings.value(ROOT_FOLDER_KEY, |
214 QString()).toString(); | 170 QString()).toString(); |