Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kfilewidget.cpp
| Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 112 | { | |||
|---|---|---|---|---|---|
| 113 | delete bookmarkHandler; // Should be deleted before ops! | 113 | delete bookmarkHandler; // Should be deleted before ops! | ||
| 114 | delete ops; | 114 | delete ops; | ||
| 115 | } | 115 | } | ||
| 116 | 116 | | |||
| 117 | void updateLocationWhatsThis(); | 117 | void updateLocationWhatsThis(); | ||
| 118 | void updateAutoSelectExtension(); | 118 | void updateAutoSelectExtension(); | ||
| 119 | void initSpeedbar(); | 119 | void initSpeedbar(); | ||
| 120 | void setPlacesViewSplitterSizes(); | 120 | void setPlacesViewSplitterSizes(); | ||
| 121 | void setLafBoxColumnWidth(); | ||||
| 121 | void initGUI(); | 122 | void initGUI(); | ||
| 122 | void readViewConfig(); | 123 | void readViewConfig(); | ||
| 123 | void writeViewConfig(); | 124 | void writeViewConfig(); | ||
| 124 | void setNonExtSelection(); | 125 | void setNonExtSelection(); | ||
| 125 | void setLocationText(const QUrl &); | 126 | void setLocationText(const QUrl &); | ||
| 126 | void setLocationText(const QList<QUrl> &); | 127 | void setLocationText(const QList<QUrl> &); | ||
| 127 | void appendExtension(QUrl &url); | 128 | void appendExtension(QUrl &url); | ||
| 128 | void updateLocationEditExtension(const QString &); | 129 | void updateLocationEditExtension(const QString &); | ||
| ▲ Show 20 Lines • Show All 1268 Lines • ▼ Show 20 Line(s) | 1397 | { | |||
| 1397 | if (placesViewWidth > 0) { | 1398 | if (placesViewWidth > 0) { | ||
| 1398 | QList<int> sizes = placesViewSplitter->sizes(); | 1399 | QList<int> sizes = placesViewSplitter->sizes(); | ||
| 1399 | sizes[0] = placesViewWidth; | 1400 | sizes[0] = placesViewWidth; | ||
| 1400 | sizes[1] = q->width() - placesViewWidth - placesViewSplitter->handleWidth(); | 1401 | sizes[1] = q->width() - placesViewWidth - placesViewSplitter->handleWidth(); | ||
| 1401 | placesViewSplitter->setSizes(sizes); | 1402 | placesViewSplitter->setSizes(sizes); | ||
| 1402 | } | 1403 | } | ||
| 1403 | } | 1404 | } | ||
| 1404 | 1405 | | |||
| 1406 | void KFileWidgetPrivate::setLafBoxColumnWidth() | ||||
| 1407 | { | ||||
| 1408 | // In order to perfectly align the filename widget with KDirOperator's icon view | ||||
| 1409 | // - placesViewWidth needs to account for the size of the splitter handle | ||||
| 1410 | // - the lafBox grid layout spacing should only affect the label, but not the line edit | ||||
| 1411 | const int adjustment = placesViewSplitter->handleWidth() - lafBox->horizontalSpacing(); | ||||
| 1412 | lafBox->setColumnMinimumWidth(0, placesViewWidth + adjustment); | ||||
| 1413 | } | ||||
| 1414 | | ||||
| 1405 | void KFileWidgetPrivate::initGUI() | 1415 | void KFileWidgetPrivate::initGUI() | ||
| 1406 | { | 1416 | { | ||
| 1407 | delete boxLayout; // deletes all sub layouts | 1417 | delete boxLayout; // deletes all sub layouts | ||
| 1408 | 1418 | | |||
| 1409 | boxLayout = new QVBoxLayout(q); | 1419 | boxLayout = new QVBoxLayout(q); | ||
| 1410 | boxLayout->setMargin(0); // no additional margin to the already existing | 1420 | boxLayout->setMargin(0); // no additional margin to the already existing | ||
| 1411 | 1421 | | |||
| 1412 | placesViewSplitter = new QSplitter(q); | 1422 | placesViewSplitter = new QSplitter(q); | ||
| ▲ Show 20 Lines • Show All 684 Lines • ▼ Show 20 Line(s) | |||||
| 2097 | { | 2107 | { | ||
| 2098 | // qDebug(); | 2108 | // qDebug(); | ||
| 2099 | 2109 | | |||
| 2100 | // we need to record the size of the splitter when the splitter changes size | 2110 | // we need to record the size of the splitter when the splitter changes size | ||
| 2101 | // so we can keep the places box the right size! | 2111 | // so we can keep the places box the right size! | ||
| 2102 | if (placesDock && index == 1) { | 2112 | if (placesDock && index == 1) { | ||
| 2103 | placesViewWidth = pos; | 2113 | placesViewWidth = pos; | ||
| 2104 | // qDebug() << "setting lafBox minwidth to" << placesViewWidth; | 2114 | // qDebug() << "setting lafBox minwidth to" << placesViewWidth; | ||
| 2105 | lafBox->setColumnMinimumWidth(0, placesViewWidth); | 2115 | setLafBoxColumnWidth(); | ||
| 2106 | } | 2116 | } | ||
| 2107 | } | 2117 | } | ||
| 2108 | 2118 | | |||
| 2109 | void KFileWidgetPrivate::_k_activateUrlNavigator() | 2119 | void KFileWidgetPrivate::_k_activateUrlNavigator() | ||
| 2110 | { | 2120 | { | ||
| 2111 | // qDebug(); | 2121 | // qDebug(); | ||
| 2112 | 2122 | | |||
| 2113 | urlNavigator->setUrlEditable(!urlNavigator->isUrlEditable()); | 2123 | urlNavigator->setUrlEditable(!urlNavigator->isUrlEditable()); | ||
| ▲ Show 20 Lines • Show All 438 Lines • ▼ Show 20 Line(s) | 2561 | { | |||
| 2552 | return d->ops->actionCollection(); | 2562 | return d->ops->actionCollection(); | ||
| 2553 | } | 2563 | } | ||
| 2554 | 2564 | | |||
| 2555 | void KFileWidgetPrivate::_k_toggleSpeedbar(bool show) | 2565 | void KFileWidgetPrivate::_k_toggleSpeedbar(bool show) | ||
| 2556 | { | 2566 | { | ||
| 2557 | if (show) { | 2567 | if (show) { | ||
| 2558 | initSpeedbar(); | 2568 | initSpeedbar(); | ||
| 2559 | placesDock->show(); | 2569 | placesDock->show(); | ||
| 2560 | lafBox->setColumnMinimumWidth(0, placesViewWidth); | 2570 | setLafBoxColumnWidth(); | ||
| 2561 | 2571 | | |||
| 2562 | // check to see if they have a home item defined, if not show the home button | 2572 | // check to see if they have a home item defined, if not show the home button | ||
| 2563 | QUrl homeURL; | 2573 | QUrl homeURL; | ||
| 2564 | homeURL.setPath(QDir::homePath()); | 2574 | homeURL.setPath(QDir::homePath()); | ||
| 2565 | KFilePlacesModel *model = static_cast<KFilePlacesModel *>(placesView->model()); | 2575 | KFilePlacesModel *model = static_cast<KFilePlacesModel *>(placesView->model()); | ||
| 2566 | for (int rowIndex = 0; rowIndex < model->rowCount(); rowIndex++) { | 2576 | for (int rowIndex = 0; rowIndex < model->rowCount(); rowIndex++) { | ||
| 2567 | QModelIndex index = model->index(rowIndex, 0); | 2577 | QModelIndex index = model->index(rowIndex, 0); | ||
| 2568 | QUrl url = model->url(index); | 2578 | QUrl url = model->url(index); | ||
| ▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines | |||||