Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kfilewidget.cpp
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 82 | public: | |||
---|---|---|---|---|---|
114 | { | 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 initGUI(); | 123 | void initGUI(); | ||
123 | void readViewConfig(); | 124 | void readViewConfig(); | ||
124 | void writeViewConfig(); | 125 | void writeViewConfig(); | ||
125 | void setNonExtSelection(); | 126 | void setNonExtSelection(); | ||
126 | void setLocationText(const QUrl &); | 127 | void setLocationText(const QUrl &); | ||
127 | void setLocationText(const QList<QUrl> &); | 128 | void setLocationText(const QList<QUrl> &); | ||
128 | void appendExtension(QUrl &url); | 129 | void appendExtension(QUrl &url); | ||
129 | void updateLocationEditExtension(const QString &); | 130 | void updateLocationEditExtension(const QString &); | ||
▲ Show 20 Lines • Show All 1254 Lines • ▼ Show 20 Line(s) | 1364 | { | |||
1384 | placesView->setUrl(url); | 1385 | placesView->setUrl(url); | ||
1385 | 1386 | | |||
1386 | placesDock->setWidget(placesView); | 1387 | placesDock->setWidget(placesView); | ||
1387 | placesViewSplitter->insertWidget(0, placesDock); | 1388 | placesViewSplitter->insertWidget(0, placesDock); | ||
1388 | 1389 | | |||
1389 | // initialize the size of the splitter | 1390 | // initialize the size of the splitter | ||
1390 | placesViewWidth = configGroup.readEntry(SpeedbarWidth, placesView->sizeHint().width()); | 1391 | placesViewWidth = configGroup.readEntry(SpeedbarWidth, placesView->sizeHint().width()); | ||
1391 | 1392 | | |||
1392 | QList<int> sizes = placesViewSplitter->sizes(); | 1393 | // Needed for when the dialog is shown with the places panel initially hidden | ||
1393 | if (placesViewWidth > 0) { | 1394 | setPlacesViewSplitterSizes(); | ||
1394 | sizes[0] = placesViewWidth + 1; | | |||
1395 | sizes[1] = q->width() - placesViewWidth - 1; | | |||
1396 | placesViewSplitter->setSizes(sizes); | | |||
1397 | } | | |||
1398 | 1395 | | |||
1399 | QObject::connect(placesDock, SIGNAL(visibilityChanged(bool)), | 1396 | QObject::connect(placesDock, SIGNAL(visibilityChanged(bool)), | ||
1400 | q, SLOT(_k_toggleSpeedbar(bool))); | 1397 | q, SLOT(_k_toggleSpeedbar(bool))); | ||
1401 | } | 1398 | } | ||
1402 | 1399 | | |||
1400 | void KFileWidgetPrivate::setPlacesViewSplitterSizes() | ||||
1401 | { | ||||
1402 | if (placesViewWidth > 0) { | ||||
1403 | QList<int> sizes = placesViewSplitter->sizes(); | ||||
1404 | sizes[0] = placesViewWidth; | ||||
1405 | sizes[1] = q->width() - placesViewWidth - placesViewSplitter->handleWidth(); | ||||
1406 | placesViewSplitter->setSizes(sizes); | ||||
1407 | } | ||||
1408 | } | ||||
1409 | | ||||
1403 | void KFileWidgetPrivate::initGUI() | 1410 | void KFileWidgetPrivate::initGUI() | ||
1404 | { | 1411 | { | ||
1405 | delete boxLayout; // deletes all sub layouts | 1412 | delete boxLayout; // deletes all sub layouts | ||
1406 | 1413 | | |||
1407 | boxLayout = new QVBoxLayout(q); | 1414 | boxLayout = new QVBoxLayout(q); | ||
1408 | boxLayout->setMargin(0); // no additional margin to the already existing | 1415 | boxLayout->setMargin(0); // no additional margin to the already existing | ||
1409 | 1416 | | |||
1410 | placesViewSplitter = new QSplitter(q); | 1417 | placesViewSplitter = new QSplitter(q); | ||
▲ Show 20 Lines • Show All 419 Lines • ▼ Show 20 Line(s) | |||||
1830 | 1837 | | |||
1831 | void KFileWidget::resizeEvent(QResizeEvent *event) | 1838 | void KFileWidget::resizeEvent(QResizeEvent *event) | ||
1832 | { | 1839 | { | ||
1833 | QWidget::resizeEvent(event); | 1840 | QWidget::resizeEvent(event); | ||
1834 | 1841 | | |||
1835 | if (d->placesDock) { | 1842 | if (d->placesDock) { | ||
1836 | // we don't want our places dock actually changing size when we resize | 1843 | // we don't want our places dock actually changing size when we resize | ||
1837 | // and qt doesn't make it easy to enforce such a thing with QSplitter | 1844 | // and qt doesn't make it easy to enforce such a thing with QSplitter | ||
1838 | QList<int> sizes = d->placesViewSplitter->sizes(); | 1845 | d->setPlacesViewSplitterSizes(); | ||
1839 | sizes[0] = d->placesViewWidth + 1; // without this pixel, our places view is reduced 1 pixel each time is shown. | | |||
1840 | sizes[1] = width() - d->placesViewWidth - 1; | | |||
1841 | d->placesViewSplitter->setSizes(sizes); | | |||
1842 | } | 1846 | } | ||
1843 | } | 1847 | } | ||
1844 | 1848 | | |||
1845 | void KFileWidget::showEvent(QShowEvent *event) | 1849 | void KFileWidget::showEvent(QShowEvent *event) | ||
1846 | { | 1850 | { | ||
1847 | if (!d->hasView) { // delayed view-creation | 1851 | if (!d->hasView) { // delayed view-creation | ||
1848 | Q_ASSERT(d); | 1852 | Q_ASSERT(d); | ||
1849 | Q_ASSERT(d->ops); | 1853 | Q_ASSERT(d->ops); | ||
▲ Show 20 Lines • Show All 1026 Lines • Show Last 20 Lines |