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