Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kfilewidget.cpp
Show First 20 Lines • Show All 1151 Lines • ▼ Show 20 Line(s) | 1139 | if (!(ops->mode() & KFile::Files)) { | |||
---|---|---|---|---|---|
1152 | 1152 | | |||
1153 | emit q->fileHighlighted(url); | 1153 | emit q->fileHighlighted(url); | ||
1154 | } else { | 1154 | } else { | ||
1155 | multiSelectionChanged(); | 1155 | multiSelectionChanged(); | ||
1156 | emit q->selectionChanged(); | 1156 | emit q->selectionChanged(); | ||
1157 | } | 1157 | } | ||
1158 | 1158 | | |||
1159 | locationEdit->lineEdit()->setModified(false); | 1159 | locationEdit->lineEdit()->setModified(false); | ||
1160 | | ||||
1161 | // When saving, and when double-click mode is being used, highlight the | ||||
1162 | // filename after a file is single-clicked so the user has a chance to quickly | ||||
1163 | // rename it if desired | ||||
1164 | // Note that double-clicking will override this and overwrite regardless of | ||||
1165 | // single/double click mouse setting (see _k_slotViewDoubleClicked() ) | ||||
1166 | if (operationMode == KFileWidget::Saving) { | ||||
1167 | locationEdit->setFocus(); | ||||
1168 | } | ||||
1160 | } | 1169 | } | ||
1161 | 1170 | | |||
1162 | void KFileWidgetPrivate::_k_fileSelected(const KFileItem &i) | 1171 | void KFileWidgetPrivate::_k_fileSelected(const KFileItem &i) | ||
1163 | { | 1172 | { | ||
1164 | if (!i.isNull() && i.isDir()) { | 1173 | if (!i.isNull() && i.isDir()) { | ||
1165 | return; | 1174 | return; | ||
1166 | } | 1175 | } | ||
1167 | 1176 | | |||
1168 | if (!(ops->mode() & KFile::Files)) { | 1177 | if (!(ops->mode() & KFile::Files)) { | ||
1169 | if (i.isNull()) { | 1178 | if (i.isNull()) { | ||
1170 | setLocationText(QUrl()); | 1179 | setLocationText(QUrl()); | ||
1171 | return; | 1180 | return; | ||
1172 | } | 1181 | } | ||
1173 | setLocationText(i.url()); | 1182 | setLocationText(i.url()); | ||
1174 | } else { | 1183 | } else { | ||
1175 | multiSelectionChanged(); | 1184 | multiSelectionChanged(); | ||
1176 | emit q->selectionChanged(); | 1185 | emit q->selectionChanged(); | ||
1177 | } | 1186 | } | ||
1178 | 1187 | | |||
1179 | // If we are saving, let another chance to the user before accepting the dialog (or trying to | 1188 | // Same as above in _k_fileHighlighted(), but for single-click mode | ||
1180 | // accept). This way the user can choose a file and add a "_2" for instance to the filename. | | |||
1181 | // Double clicking however will override this, regardless of single/double click mouse setting, | | |||
1182 | // see: _k_slotViewDoubleClicked | | |||
1183 | if (operationMode == KFileWidget::Saving) { | 1189 | if (operationMode == KFileWidget::Saving) { | ||
1184 | locationEdit->setFocus(); | 1190 | locationEdit->setFocus(); | ||
1185 | } else { | 1191 | } else { | ||
1186 | q->slotOk(); | 1192 | q->slotOk(); | ||
1187 | } | 1193 | } | ||
1188 | } | 1194 | } | ||
1189 | 1195 | | |||
1190 | // I know it's slow to always iterate thru the whole filelist | 1196 | // I know it's slow to always iterate thru the whole filelist | ||
▲ Show 20 Lines • Show All 1715 Lines • Show Last 20 Lines |