mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kfile: merge it into kio
once upon a time it was either part of it or was separated from it Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
30eedcf057
commit
a65bd3b685
68 changed files with 175 additions and 1013 deletions
|
@ -459,7 +459,6 @@ add_subdirectory( kdecore )
|
|||
add_subdirectory( kded )
|
||||
add_subdirectory( kdeui )
|
||||
add_subdirectory( kdewidgets )
|
||||
add_subdirectory( kfile )
|
||||
add_subdirectory( kimgio )
|
||||
add_subdirectory( kinit )
|
||||
add_subdirectory( kio )
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
185 kdecore (KAuthorization)
|
||||
200 kdeui (KMainWindow)
|
||||
240 kdeui (kdelibs)
|
||||
250 kfile (kdelibs)
|
||||
260 kdeui (KXmlGui)
|
||||
264 kdeui (KIconLoader)
|
||||
265 kdeui (KIconEffect)
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
project(kfile)
|
||||
|
||||
include_directories(
|
||||
${KDE4_KIO_INCLUDES}
|
||||
${CMAKE_SOURCE_DIR}/solid
|
||||
${CMAKE_BINARY_DIR}/solid
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=250)
|
||||
|
||||
if(ENABLE_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
set(kfile_LIB_SRCS
|
||||
kdiroperator.cpp
|
||||
kdiroperatordetailview.cpp
|
||||
# used in combination with kio/kio/kdirmodel.cpp
|
||||
kdirsortfilterproxymodel.cpp
|
||||
kfilebookmarkhandler.cpp
|
||||
kfilefiltercombo.cpp
|
||||
kfilewidget.cpp
|
||||
kfileplacesitem.cpp
|
||||
kfileplacesmodel.cpp
|
||||
kfileplacesview.cpp
|
||||
kfileplaceeditdialog.cpp
|
||||
kfilepreviewgenerator.cpp
|
||||
knameandurlinputdialog.cpp
|
||||
knewfilemenu.cpp
|
||||
kurlnavigatordropdownbutton.cpp
|
||||
kurlnavigatorbuttonbase.cpp
|
||||
kurlnavigatorbutton.cpp
|
||||
kurlnavigatorplacesselector.cpp
|
||||
kurlnavigatorprotocolcombo.cpp
|
||||
kurlnavigatortogglebutton.cpp
|
||||
kurlnavigator.cpp
|
||||
kurlnavigatormenu.cpp
|
||||
kdefaultviewadapter.cpp
|
||||
)
|
||||
|
||||
add_library(kfile SHARED ${kfile_LIB_SRCS})
|
||||
|
||||
target_link_libraries(kfile PUBLIC
|
||||
kdecore
|
||||
kdeui
|
||||
kio
|
||||
solid
|
||||
)
|
||||
|
||||
set_target_properties(kfile PROPERTIES
|
||||
VERSION ${GENERIC_LIB_VERSION}
|
||||
SOVERSION ${GENERIC_LIB_SOVERSION}
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS kfile
|
||||
EXPORT kdelibsTargets
|
||||
DESTINATION ${KDE4_LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
generate_export_header(kfile)
|
||||
|
||||
install(
|
||||
FILES
|
||||
kdiroperator.h
|
||||
kdirsortfilterproxymodel.h
|
||||
kfilefiltercombo.h
|
||||
kfileplacesmodel.h
|
||||
kfileplacesview.h
|
||||
kfilepreviewgenerator.h
|
||||
kfilewidget.h
|
||||
kurlnavigator.h
|
||||
knewfilemenu.h
|
||||
knameandurlinputdialog.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/kfile_export.h
|
||||
DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
############ module used by KFileDialog ##########
|
||||
|
||||
kde4_add_plugin(kfilemodule kfilemodule.cpp)
|
||||
|
||||
target_link_libraries(kfilemodule
|
||||
kfile
|
||||
kio
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS kfilemodule
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install(
|
||||
FILES kfilemodule.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
|
@ -1,2 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
# they get into kio4.pot
|
|
@ -1,47 +0,0 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright 2007 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kfilemodule.h"
|
||||
#include "kfilewidget.h"
|
||||
#include "kpluginfactory.h"
|
||||
|
||||
K_PLUGIN_FACTORY(KFileModuleFactory, registerPlugin<KFileModule>();)
|
||||
K_EXPORT_PLUGIN(KFileModuleFactory("kfilemodule", "kio4"))
|
||||
|
||||
KFileModule::KFileModule(QObject* parent, const QVariantList&)
|
||||
: KAbstractFileModule(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QWidget* KFileModule::createFileWidget(const KUrl& startDir, QWidget *parent)
|
||||
{
|
||||
return new KFileWidget(startDir, parent);
|
||||
}
|
||||
|
||||
KUrl KFileModule::getStartUrl( const KUrl& startDir, QString& recentDirClass )
|
||||
{
|
||||
return KFileWidget::getStartUrl(startDir, recentDirClass);
|
||||
}
|
||||
|
||||
void KFileModule::setStartDir( const KUrl& directory )
|
||||
{
|
||||
KFileWidget::setStartDir(directory);
|
||||
}
|
||||
|
||||
#include "moc_kfilemodule.cpp"
|
|
@ -1,141 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Name=KFileModule
|
||||
Name[ar]=KFileModule
|
||||
Name[ast]=KFileModule
|
||||
Name[bg]=Модул KFile
|
||||
Name[bn]=কে-ফাইল মডিইল
|
||||
Name[bs]=KFileModule
|
||||
Name[ca]=KFileModule
|
||||
Name[ca@valencia]=KFileModule
|
||||
Name[cs]=Modul KFile
|
||||
Name[da]=KFileModule
|
||||
Name[de]=KFile-Modul
|
||||
Name[el]=Άρθρωμα KFile
|
||||
Name[en_GB]=KFileModule
|
||||
Name[es]=KFileModule
|
||||
Name[et]=KFileModule
|
||||
Name[eu]=KFileModulua
|
||||
Name[fa]=KFileModule
|
||||
Name[fi]=KFileModule
|
||||
Name[fr]=KFileModule
|
||||
Name[ga]=KFileModule
|
||||
Name[gl]=KFileModule
|
||||
Name[gu]=KFile મોડ્યુલ
|
||||
Name[he]=מודול KFile
|
||||
Name[hi]=KFileModule
|
||||
Name[hr]=KModulDatoteke
|
||||
Name[hu]=KFileModule
|
||||
Name[hy]=KFileModule
|
||||
Name[ia]=Modulo KFile
|
||||
Name[id]=KFileModule
|
||||
Name[is]=KFile eining
|
||||
Name[it]=Modulo KFile
|
||||
Name[ja]=KFile モジュール
|
||||
Name[kk]=KFileModule
|
||||
Name[km]=KFileModule
|
||||
Name[kn]=KFileModule
|
||||
Name[ko]=KFileModule
|
||||
Name[ku]=ModûlaKFile
|
||||
Name[lt]=KFileModulis
|
||||
Name[lv]=KFileModule
|
||||
Name[mr]=KFile विभाग
|
||||
Name[ms]=KFileModule
|
||||
Name[nb]=KFileModule
|
||||
Name[nds]=K-Dateimoduul
|
||||
Name[nl]=KFileModule
|
||||
Name[nn]=KFileModule
|
||||
Name[pa]=KFileModule
|
||||
Name[pl]=Moduł KFile
|
||||
Name[pt]=KFileModule
|
||||
Name[pt_BR]=KFileModule
|
||||
Name[ro]=KFileModule
|
||||
Name[ru]=KFileModule
|
||||
Name[se]=KFileModule
|
||||
Name[si]=KDED මොඩියුලය
|
||||
Name[sk]=KFile modul
|
||||
Name[sl]=Modul KFile
|
||||
Name[sr]=Модул к‑фајла
|
||||
Name[sr@ijekavian]=Модул к‑фајла
|
||||
Name[sr@ijekavianlatin]=Modul KFilea
|
||||
Name[sr@latin]=Modul KFilea
|
||||
Name[sv]=Kfil-modul
|
||||
Name[ta]=KFileModule
|
||||
Name[tg]=KFileModule
|
||||
Name[th]=KFileModule
|
||||
Name[tr]=KFile Modülü
|
||||
Name[tt]=KFileModule
|
||||
Name[ug]=KFile بۆلىكى
|
||||
Name[uk]=KFileModule
|
||||
Name[vi]=KFileModule
|
||||
Name[wa]=Module KFile
|
||||
Name[x-test]=xxKFileModulexx
|
||||
Name[zh_CN]=KFile 模块
|
||||
Name[zh_TW]=KFile 模組
|
||||
Comment=The default KDE file module providing the standard file dialog
|
||||
Comment[ar]=وحدة ملف كدي الافتراضية التي تعطي مربع الملف القياسي
|
||||
Comment[bg]=Подразбиращият се файлов модул на KDE, осигуряващ стандартния диалогов прозорец за файлове
|
||||
Comment[bs]=Podrazumijevani KDE‑ov modul datoteka koji daje standardnu datoteku dijalog
|
||||
Comment[ca]=El mòdul de fitxers per defecte del KDE que proporciona el diàleg de fitxer estàndard
|
||||
Comment[ca@valencia]=El mòdul de fitxers per defecte del KDE que proporciona el diàleg de fitxer estàndard
|
||||
Comment[cs]=Výchozí souborový modul poskytující standardní souborový dialog
|
||||
Comment[da]=KDE's standard filmodul som giver standard fildialogen
|
||||
Comment[de]=Das Standard-KDE-Dateimodul, das den Standard-Dateidialog bereitstellt
|
||||
Comment[el]=Το προεπιλεγμένο άρθρωμα KDE που παρέχει τον τυπικό διάλογο αρχείων
|
||||
Comment[en_GB]=The default KDE file module providing the standard file dialogue
|
||||
Comment[es]=El módulo de archivos por omisión de KDE que proporciona el diálogo de archivos estándar
|
||||
Comment[et]=KDE vaikimisi failimoodul, mis pakub standardset failidialoogi
|
||||
Comment[eu]=Fitxategi elkarrizketa koadro estandarra eskeintzen duen KDE fitxategi modulu lehenetsia
|
||||
Comment[fi]=KDE:n oletustiedostoikkunan toteuttava moduuli
|
||||
Comment[fr]=Le module de fichiers KDE par défaut fournissant la boîte de dialogue standard d'ouverture de fichiers
|
||||
Comment[ga]=Modúl réamhshocraithe comhad KDE a sholáthraíonn an gnáthdhialóg comhad
|
||||
Comment[gl]=O módulo predeterminado de KDE para ficheiros, que fornece o diálogo normal de ficheiros
|
||||
Comment[gu]=પ્રમાણભૂત ફાઇલ સંવાદ પૂરું પાડતું મૂળભૂત KDE ફાઇલ મોડ્યુલ
|
||||
Comment[he]=מודול ברירת מחדל של KDE המספק את חלון הקבצים
|
||||
Comment[hr]=Uobičajeni KDE modul za datoteke koji pruža standardni dijalog
|
||||
Comment[hu]=A KDE alapértelmezett, standard fájlkezelő ablakait tartalmazó modul
|
||||
Comment[ia]=Le modulo KDEFile predefinite que forni le file standard de dialogo
|
||||
Comment[id]=Modul berkas KDE standar menyediakan dialog berkas standar
|
||||
Comment[is]=Sjálfgefna KDE skráareiningin sem sér um staðlaða skráagluggann
|
||||
Comment[it]=Il modulo file standard di KDE che fornisce la finestra di dialogo per i file
|
||||
Comment[ja]=標準のファイル選択ダイアログを提供する KDE の標準ファイルモジュール
|
||||
Comment[kk]=Стандартты файл диалогын қамтамасыз ететін KDE файл модулі
|
||||
Comment[km]=ម៉ូឌុលឯកសារ KDE លំនាំដើមផ្ដល់នូវប្រអប់ឯកសារស្តង់ដារ
|
||||
Comment[ko]=표준 파일 대화상자를 제공하는 기본 KDE 파일 모듈
|
||||
Comment[ku]=KDE modula pelê ya standard, paceya pelê ya standard peyde dike
|
||||
Comment[lt]=Numatytasis KDE failų dialogo modulis
|
||||
Comment[lv]=Noklusētais KDE failu modulis, kas nodrošina standarta failu dialogu
|
||||
Comment[mr]=प्रमाणित फाईल संवाद पुरवणारा मूलभूत केडीई फाईल विभाग
|
||||
Comment[nb]=KDE standard filmodul som skaffer standard fildialog
|
||||
Comment[nds]=Dat KDE-Standarddateimoduul, dat den Standard-Dateidialoog praatstellt
|
||||
Comment[nl]=De standaard KDE-bestandsmodule die de standaard bestandsdialoog levert
|
||||
Comment[nn]=Standard KDE-filmodul for opna/lagra-vindauge
|
||||
Comment[pa]=ਡਿਫਾਲਟ KDE ਫਾਇਲ ਮੋਡੀਊਲ ਸਟੈਂਡਰਡ ਫਾਇਲ ਡਾਈਲਾਗ ਦਿੰਦਾ ਹੈ
|
||||
Comment[pl]=Domyślny moduł plików KDE dostarczający standardowe okno dialogowe plików
|
||||
Comment[pt]=O módulo de ficheiros predefinido do KDE, que fornece a janela de ficheiros normal
|
||||
Comment[pt_BR]=O módulo de arquivos padrão do KDE, que fornece o diálogo de arquivos padronizado
|
||||
Comment[ro]=Modulul de fișier KDE implicit, furnizînd dialogul standard de fișiere
|
||||
Comment[ru]=Модуль по умолчанию диалогового окна выбора файла
|
||||
Comment[se]=Standárda KDE-fiilamodula mii sisttisdoallá standárdafiilaláseža
|
||||
Comment[sk]=Štandardný súborový modul KDE, ktorý poskytuje štandardný súborový dialóg
|
||||
Comment[sl]=Privzeti modul KDE za datoteke, ki ponuja standardno pogovorno okno za datoteke
|
||||
Comment[sr]=Подразумевани КДЕ‑ов модул фајлова који даје стандардни фајл дијалог
|
||||
Comment[sr@ijekavian]=Подразумијевани КДЕ‑ов модул фајлова који даје стандардни фајл дијалог
|
||||
Comment[sr@ijekavianlatin]=Podrazumijevani KDE‑ov modul fajlova koji daje standardni fajl dijalog
|
||||
Comment[sr@latin]=Podrazumevani KDE‑ov modul fajlova koji daje standardni fajl dijalog
|
||||
Comment[sv]=KDE:s standardmodul för filer som tillhandahåller standarddialogrutan för filer
|
||||
Comment[ta]=வழக்கமான கோப்பு பலகத்தை தரும் கேடீயீயின் இயல்பிருப்பு கோப்பு பாகம்
|
||||
Comment[tg]=Файли стандартии модули KDE барои намоиши диалогҳо
|
||||
Comment[th]=มอดูลแฟ้มโดยปริยายของ KDE ที่ให้การใช้งานกล่องแฟ้มต่าง ๆ ที่เป็นมาตรฐาน
|
||||
Comment[tr]=Standart dosya penceresini sağlayan KDE öntanımlı dosya modülü
|
||||
Comment[tt]=Баштан ук билгеләнгән файл сайлау диалог тәрәзәсе модуле
|
||||
Comment[ug]=سۈكۈتتىكى KDE ھۆججەت بۆلىكى ئۆلچەملىك ھۆججەت سۆزلەشكۈ تەمىنلىدى
|
||||
Comment[uk]=Типовий модуль KDE, що забезпечує роботу стандартного діалогового вікна роботи з файлами
|
||||
Comment[vi]=Mô-đun tập tin KDE mặc định cung cấp hộp thoại tập tin chuẩn
|
||||
Comment[wa]=Li module fitchî prémetou di KDE et ki dene li dvize di fitchî standård
|
||||
Comment[x-test]=xxThe default KDE file module providing the standard file dialogxx
|
||||
Comment[zh_CN]=默认 KDE 文件模块提供了标准的文件对话框
|
||||
Comment[zh_TW]=預設的 KDE 檔案模組,提供標準檔案對話框
|
||||
X-KDE-ServiceTypes=KIO/FileModule
|
||||
Type=Service
|
||||
X-KDE-Library=kfilemodule
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright 2007 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KFILEMODULE_H
|
||||
#define KFILEMODULE_H
|
||||
|
||||
#include <kabstractfilemodule.h>
|
||||
|
||||
class KFileModule : public KAbstractFileModule
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KFileModule(QObject* parent, const QVariantList&);
|
||||
|
||||
virtual QWidget* createFileWidget(const KUrl& startDir, QWidget *parent);
|
||||
|
||||
virtual KUrl getStartUrl( const KUrl& startDir, QString& recentDirClass );
|
||||
|
||||
virtual void setStartDir( const KUrl& directory );
|
||||
};
|
||||
|
||||
#endif /* KFILEMODULE_H */
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
MACRO(KFILE_UNIT_TESTS)
|
||||
FOREACH(_testname ${ARGN})
|
||||
kde4_add_test(kfile-${_testname} ${_testname}.cpp)
|
||||
target_link_libraries(kfile-${_testname}
|
||||
${QT_QTTEST_LIBRARY}
|
||||
${QT_QTXML_LIBRARY}
|
||||
kfile
|
||||
kio
|
||||
)
|
||||
ENDFOREACH(_testname)
|
||||
ENDMACRO(KFILE_UNIT_TESTS)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
add_definitions(
|
||||
-DTEST_DATA="${CMAKE_SOURCE_DIR}/solid/solid/backends/fakehw/fakecomputer.xml"
|
||||
)
|
||||
|
||||
KFILE_UNIT_TESTS(
|
||||
kfileplacesmodeltest
|
||||
kurlnavigatortest
|
||||
kdiroperatortest
|
||||
knewfilemenutest
|
||||
)
|
|
@ -12,6 +12,9 @@ include_directories(
|
|||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${KDE4_KDEUI_INCLUDES}
|
||||
${KDE4_KDECORE_INCLUDES}
|
||||
${CMAKE_SOURCE_DIR}/solid
|
||||
${CMAKE_BINARY_DIR}/solid
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/kutils/kpasswdstore
|
||||
${CMAKE_BINARY_DIR}/kutils/kpasswdstore
|
||||
${CMAKE_SOURCE_DIR}/kutils/kexiv2
|
||||
|
@ -93,7 +96,6 @@ set(kbookmarks_STAT_SRCS
|
|||
)
|
||||
|
||||
set(kfile_STAT_SRCS
|
||||
kfile/kabstractfilemodule.cpp
|
||||
kfile/kacleditwidget.cpp
|
||||
kfile/kdiskfreespaceinfo.cpp
|
||||
kfile/kencodingfiledialog.cpp
|
||||
|
@ -114,6 +116,29 @@ set(kfile_STAT_SRCS
|
|||
kfile/kurlrequester.cpp
|
||||
kfile/kurlrequesterdialog.cpp
|
||||
kfile/kfilemetadataprovider.cpp
|
||||
kfile/kdiroperator.cpp
|
||||
kfile/kdiroperatordetailview.cpp
|
||||
# used in combination with kio/kio/kdirmodel.cpp
|
||||
kfile/kdirsortfilterproxymodel.cpp
|
||||
kfile/kfilebookmarkhandler.cpp
|
||||
kfile/kfilefiltercombo.cpp
|
||||
kfile/kfilewidget.cpp
|
||||
kfile/kfileplacesitem.cpp
|
||||
kfile/kfileplacesmodel.cpp
|
||||
kfile/kfileplacesview.cpp
|
||||
kfile/kfileplaceeditdialog.cpp
|
||||
kfile/kfilepreviewgenerator.cpp
|
||||
kfile/knameandurlinputdialog.cpp
|
||||
kfile/knewfilemenu.cpp
|
||||
kfile/kurlnavigatordropdownbutton.cpp
|
||||
kfile/kurlnavigatorbuttonbase.cpp
|
||||
kfile/kurlnavigatorbutton.cpp
|
||||
kfile/kurlnavigatorplacesselector.cpp
|
||||
kfile/kurlnavigatorprotocolcombo.cpp
|
||||
kfile/kurlnavigatortogglebutton.cpp
|
||||
kfile/kurlnavigator.cpp
|
||||
kfile/kurlnavigatormenu.cpp
|
||||
kfile/kdefaultviewadapter.cpp
|
||||
)
|
||||
|
||||
########### next target ###############
|
||||
|
@ -133,6 +158,7 @@ target_link_libraries(kio PUBLIC
|
|||
kdecore
|
||||
kdeui
|
||||
kpasswdstore
|
||||
solid
|
||||
)
|
||||
|
||||
if(ACL_FOUND)
|
||||
|
@ -222,8 +248,6 @@ install(
|
|||
kio/kurifilter.h
|
||||
kio/kurlcompletion.h
|
||||
kio/khttp.h
|
||||
kfile/kabstractfilemodule.h
|
||||
kfile/kabstractfilewidget.h
|
||||
kfile/kdiskfreespaceinfo.h
|
||||
kfile/kencodingfiledialog.h
|
||||
kfile/kfile.h
|
||||
|
@ -240,6 +264,16 @@ install(
|
|||
kfile/kurlcombobox.h
|
||||
kfile/kurlrequester.h
|
||||
kfile/kurlrequesterdialog.h
|
||||
kfile/kdiroperator.h
|
||||
kfile/kdirsortfilterproxymodel.h
|
||||
kfile/kfilefiltercombo.h
|
||||
kfile/kfileplacesmodel.h
|
||||
kfile/kfileplacesview.h
|
||||
kfile/kfilepreviewgenerator.h
|
||||
kfile/kfilewidget.h
|
||||
kfile/kurlnavigator.h
|
||||
kfile/knewfilemenu.h
|
||||
kfile/knameandurlinputdialog.h
|
||||
bookmarks/kbookmark.h
|
||||
bookmarks/kbookmarkmanager.h
|
||||
bookmarks/kbookmarkmenu.h
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#! /usr/bin/env bash
|
||||
$EXTRACTRC `find . ../kioslave ../kfile -name \*.rc -o -name \*.ui` >> rc.cpp || exit 11
|
||||
$XGETTEXT `find . ../kioslave ../kfile -name "*.cpp" -o -name "*.cc" -o -name "*.h" | grep -v "/tests"` -o $podir/kio4.pot
|
||||
$EXTRACTRC `find . ../kioslave -name \*.rc -o -name \*.ui` >> rc.cpp || exit 11
|
||||
$XGETTEXT `find . ../kioslave -name "*.cpp" -o -name "*.cc" -o -name "*.h" | grep -v "/tests"` -o $podir/kio4.pot
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#ifndef CONFIG_KFILE_H
|
||||
#define CONFIG_KFILE_H
|
||||
|
||||
const int kfile_area = 250;
|
||||
|
||||
#define DefaultMixDirsAndFiles false
|
||||
#define DefaultShowHidden false
|
||||
#define DefaultDirsFirst true
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright 2007 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kabstractfilemodule.h"
|
||||
|
||||
KAbstractFileModule::KAbstractFileModule(QObject* parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#include "moc_kabstractfilemodule.cpp"
|
|
@ -1,51 +0,0 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright 2007 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KABSTRACTFILEMODULE_H
|
||||
#define KABSTRACTFILEMODULE_H
|
||||
|
||||
#include <kio/kio_export.h>
|
||||
#include <QtCore/QObject>
|
||||
#include <kurl.h>
|
||||
#include <QWidget>
|
||||
|
||||
/**
|
||||
* Interface to the module that contains the file widget.
|
||||
*
|
||||
* libkfilemodule returns an object that derives from KAbstractFileModule.
|
||||
*
|
||||
* This is internal to KFileDialog.
|
||||
*/
|
||||
class KIO_EXPORT KAbstractFileModule : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KAbstractFileModule(QObject* parent);
|
||||
|
||||
/// the returned widget implements the KAbstractFileWidget interface
|
||||
virtual QWidget* createFileWidget(const KUrl& startDir, QWidget *parent) = 0;
|
||||
|
||||
virtual KUrl getStartUrl( const KUrl& startDir, QString& recentDirClass ) = 0;
|
||||
|
||||
virtual void setStartDir( const KUrl& directory ) = 0;
|
||||
|
||||
// TODO QFileDialog-like methods
|
||||
};
|
||||
|
||||
#endif /* KABSTRACTFILEMODULE_H */
|
|
@ -1,394 +0,0 @@
|
|||
// -*- c++ -*-
|
||||
/* This file is part of the KDE libraries
|
||||
Copyright (C) 1997, 1998 Richard Moore <rich@kde.org>
|
||||
1998 Stephan Kulow <coolo@kde.org>
|
||||
1998 Daniel Grana <grana@ie.iwi.unibe.ch>
|
||||
2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
|
||||
2001 Frerich Raabe <raabe@kde.org>
|
||||
2007 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#ifndef KABSTRACTFILEWIDGET_H
|
||||
#define KABSTRACTFILEWIDGET_H
|
||||
|
||||
class KPreviewWidgetBase;
|
||||
|
||||
#include "kurl.h"
|
||||
#include "kfile.h"
|
||||
#include <kmimetype.h>
|
||||
|
||||
class KPushButton;
|
||||
class KActionCollection;
|
||||
class KToolBar;
|
||||
class KFileWidgetPrivate;
|
||||
class KUrlComboBox;
|
||||
class KFileFilterCombo;
|
||||
|
||||
/**
|
||||
* Base class for KFileWidget.
|
||||
*
|
||||
* This abstract interface allows KFileDialog (in kio) to call methods
|
||||
* on the dlopened KFileWidget (from kfilemodule.so)
|
||||
*
|
||||
* In addition to the pure virtual methods defined below, the implementations
|
||||
* of KAbstractFileWidget are expected to define the following signals:
|
||||
* <ul>
|
||||
* <li>fileSelected(const KUrl&)</li>
|
||||
* <li>fileHighlighted(const KUrl&)</li>
|
||||
* <li>selectionChanged()</li>
|
||||
* <li>filterChanged(const QString&)</li>
|
||||
* <li>accepted()</li>
|
||||
* </ul>
|
||||
*/
|
||||
class KIO_EXPORT KAbstractFileWidget
|
||||
{
|
||||
public:
|
||||
virtual ~KAbstractFileWidget() {}
|
||||
|
||||
/**
|
||||
* Defines some default behavior of the filedialog.
|
||||
* E.g. in mode @p Opening and @p Saving, the selected files/urls will
|
||||
* be added to the "recent documents" list. The Saving mode also implies
|
||||
* setKeepLocation() being set.
|
||||
*
|
||||
* @p Other means that no default actions are performed.
|
||||
*
|
||||
* @see setOperationMode
|
||||
* @see operationMode
|
||||
*/
|
||||
enum OperationMode { Other = 0, Opening, Saving };
|
||||
|
||||
/**
|
||||
* @returns The selected fully qualified filename.
|
||||
*/
|
||||
virtual KUrl selectedUrl() const = 0;
|
||||
|
||||
/**
|
||||
* @returns The list of selected URLs.
|
||||
*/
|
||||
virtual KUrl::List selectedUrls() const = 0;
|
||||
|
||||
/**
|
||||
* @returns the currently shown directory.
|
||||
*/
|
||||
virtual KUrl baseUrl() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the full path of the selected file in the local filesystem.
|
||||
* (Local files only)
|
||||
*/
|
||||
virtual QString selectedFile() const = 0;
|
||||
|
||||
/**
|
||||
* Returns a list of all selected local files.
|
||||
*/
|
||||
virtual QStringList selectedFiles() const = 0;
|
||||
|
||||
/**
|
||||
* Sets the directory to view.
|
||||
*
|
||||
* @param url URL to show.
|
||||
* @param clearforward Indicates whether the forward queue
|
||||
* should be cleared.
|
||||
*/
|
||||
virtual void setUrl(const KUrl &url, bool clearforward = true) = 0;
|
||||
|
||||
/**
|
||||
* Sets the file name to preselect to @p name
|
||||
*
|
||||
* This takes absolute URLs and relative file names.
|
||||
*/
|
||||
virtual void setSelection(const QString& name) = 0;
|
||||
|
||||
/**
|
||||
* Sets the operational mode of the filedialog to @p Saving, @p Opening
|
||||
* or @p Other. This will set some flags that are specific to loading
|
||||
* or saving files. E.g. setKeepLocation() makes mostly sense for
|
||||
* a save-as dialog. So setOperationMode( KFileDialog::Saving ); sets
|
||||
* setKeepLocation for example.
|
||||
*
|
||||
* The mode @p Saving, together with a default filter set via
|
||||
* setMimeFilter() will make the filter combobox read-only.
|
||||
*
|
||||
* The default mode is @p Opening.
|
||||
*
|
||||
* Call this method right after instantiating KFileDialog.
|
||||
*
|
||||
* @see operationMode
|
||||
* @see KFileDialog::OperationMode
|
||||
*/
|
||||
virtual void setOperationMode( OperationMode ) = 0;
|
||||
|
||||
/**
|
||||
* @returns the current operation mode, Opening, Saving or Other. Default
|
||||
* is Other.
|
||||
*
|
||||
* @see operationMode
|
||||
* @see KFileDialog::OperationMode
|
||||
*/
|
||||
virtual OperationMode operationMode() const = 0;
|
||||
|
||||
/**
|
||||
* Sets whether the filename/url should be kept when changing directories.
|
||||
* This is for example useful when having a predefined filename where
|
||||
* the full path for that file is searched.
|
||||
*
|
||||
* This is implicitly set when operationMode() is KFileDialog::Saving
|
||||
*
|
||||
* getSaveFileName() and getSaveUrl() set this to true by default, so that
|
||||
* you can type in the filename and change the directory without having
|
||||
* to type the name again.
|
||||
*/
|
||||
virtual void setKeepLocation( bool keep ) = 0;
|
||||
|
||||
/**
|
||||
* @returns whether the contents of the location edit are kept when
|
||||
* changing directories.
|
||||
*/
|
||||
virtual bool keepsLocation() const = 0;
|
||||
|
||||
/**
|
||||
* Sets the filter to be used to @p filter.
|
||||
*
|
||||
* You can set more
|
||||
* filters for the user to select separated by '\n'. Every
|
||||
* filter entry is defined through namefilter|text to display.
|
||||
* If no | is found in the expression, just the namefilter is
|
||||
* shown. Examples:
|
||||
*
|
||||
* \code
|
||||
* kfile->setFilter("*.cpp|C++ Source Files\n*.h|Header files");
|
||||
* kfile->setFilter("*.cpp");
|
||||
* kfile->setFilter("*.cpp|Sources (*.cpp)");
|
||||
* kfile->setFilter("*.cpp|" + i18n("Sources (*.cpp)"));
|
||||
* kfile->setFilter("*.cpp *.cc *.C|C++ Source Files\n*.h *.H|Header files");
|
||||
* \endcode
|
||||
*
|
||||
* Note: The text to display is not parsed in any way. So, if you
|
||||
* want to show the suffix to select by a specific filter, you must
|
||||
* repeat it.
|
||||
*
|
||||
* If the filter contains an unescaped '/', a mimetype-filter is assumed.
|
||||
* If you would like a '/' visible in your filter it can be escaped with
|
||||
* a '\'. You can specify multiple mimetypes like this (separated with
|
||||
* space):
|
||||
*
|
||||
* \code
|
||||
* kfile->setFilter( "image/png text/html text/plain" );
|
||||
* kfile->setFilter( "*.cue|CUE\\/BIN Files (*.cue)" );
|
||||
* \endcode
|
||||
*
|
||||
* @see filterChanged
|
||||
* @see setMimeFilter
|
||||
*/
|
||||
virtual void setFilter(const QString& filter) = 0;
|
||||
|
||||
/**
|
||||
* Returns the current filter as entered by the user or one of the
|
||||
* predefined set via setFilter().
|
||||
*
|
||||
* @see setFilter()
|
||||
* @see filterChanged()
|
||||
*/
|
||||
virtual QString currentFilter() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the mimetype for the desired output format.
|
||||
*
|
||||
* This is only valid if setFilterMimeType() has been called
|
||||
* previously.
|
||||
*
|
||||
* @see setFilterMimeType()
|
||||
*/
|
||||
virtual KMimeType::Ptr currentFilterMimeType() = 0;
|
||||
|
||||
/**
|
||||
* Sets the filter up to specify the output type.
|
||||
*
|
||||
* @param types a list of mimetypes that can be used as output format
|
||||
* @param defaultType the default mimetype to use as output format, if any.
|
||||
* If @p defaultType is set, it will be set as the current item.
|
||||
* Otherwise, a first item showing all the mimetypes will be created.
|
||||
* Typically, @p defaultType should be empty for loading and set for saving.
|
||||
*
|
||||
* Do not use in conjunction with setFilter()
|
||||
*/
|
||||
virtual void setMimeFilter( const QStringList& types,
|
||||
const QString& defaultType = QString() ) = 0;
|
||||
|
||||
/**
|
||||
* The mimetype for the desired output format.
|
||||
*
|
||||
* This is only valid if setMimeFilter() has been called
|
||||
* previously.
|
||||
*
|
||||
* @see setMimeFilter()
|
||||
*/
|
||||
virtual QString currentMimeFilter() const = 0;
|
||||
|
||||
/**
|
||||
* Clears any mime- or namefilter. Does not reload the directory.
|
||||
*/
|
||||
virtual void clearFilter() = 0;
|
||||
|
||||
/**
|
||||
* Adds a preview widget and enters the preview mode.
|
||||
*
|
||||
* In this mode the dialog is split and the right part contains your
|
||||
* preview widget.
|
||||
*
|
||||
* Ownership is transferred to KFileDialog. You need to create the
|
||||
* preview-widget with "new", i.e. on the heap.
|
||||
*
|
||||
* @param w The widget to be used for the preview.
|
||||
*/
|
||||
virtual void setPreviewWidget(KPreviewWidgetBase *w) = 0;
|
||||
|
||||
/**
|
||||
* Sets the mode of the dialog.
|
||||
*
|
||||
* The mode is defined as (in kfile.h):
|
||||
* \code
|
||||
* enum Mode {
|
||||
* File = 1,
|
||||
* Directory = 2,
|
||||
* Files = 4,
|
||||
* ExistingOnly = 8,
|
||||
* LocalOnly = 16
|
||||
* };
|
||||
* \endcode
|
||||
* You can OR the values, e.g.
|
||||
* \code
|
||||
* KFile::Modes mode = KFile::Files |
|
||||
* KFile::ExistingOnly |
|
||||
* KFile::LocalOnly );
|
||||
* setMode( mode );
|
||||
* \endcode
|
||||
*/
|
||||
virtual void setMode( KFile::Modes m ) = 0;
|
||||
|
||||
/**
|
||||
* Returns the mode of the filedialog.
|
||||
* @see setMode()
|
||||
*/
|
||||
virtual KFile::Modes mode() const = 0;
|
||||
|
||||
/**
|
||||
* Sets the text to be displayed in front of the selection.
|
||||
*
|
||||
* The default is "Location".
|
||||
* Most useful if you want to make clear what
|
||||
* the location is used for.
|
||||
*/
|
||||
virtual void setLocationLabel(const QString& text) = 0;
|
||||
|
||||
/**
|
||||
* Returns a pointer to the toolbar.
|
||||
*
|
||||
* You can use this to insert custom
|
||||
* items into it, e.g.:
|
||||
* \code
|
||||
* yourAction = new KAction( i18n("Your Action"), 0,
|
||||
* this, SLOT( yourSlot() ),
|
||||
* this, "action name" );
|
||||
* yourAction->plug( kfileDialog->toolBar() );
|
||||
* \endcode
|
||||
*/
|
||||
virtual KToolBar *toolBar() const = 0;
|
||||
|
||||
/**
|
||||
* @returns a pointer to the OK-Button in the filedialog.
|
||||
* Note that the button is hidden and unconnected when using KFileWidget alone;
|
||||
* KFileDialog shows it and connects to it.
|
||||
*/
|
||||
virtual KPushButton *okButton() const = 0;
|
||||
|
||||
/**
|
||||
* @returns a pointer to the Cancel-Button in the filedialog.
|
||||
* Note that the button is hidden and unconnected when using KFileWidget alone;
|
||||
* KFileDialog shows it and connects to it.
|
||||
*/
|
||||
virtual KPushButton *cancelButton() const = 0;
|
||||
|
||||
/**
|
||||
* @returns the combobox used to type the filename or full location of the file.
|
||||
*/
|
||||
virtual KUrlComboBox *locationEdit() const = 0;
|
||||
|
||||
/**
|
||||
* @returns the combobox that contains the filters
|
||||
*/
|
||||
virtual KFileFilterCombo *filterWidget() const = 0;
|
||||
|
||||
/**
|
||||
* @returns a pointer to the action collection, holding all the used
|
||||
* KActions.
|
||||
*/
|
||||
virtual KActionCollection *actionCollection() const = 0;
|
||||
|
||||
/**
|
||||
* Set a custom widget that should be added to the bottom of the file dialog.
|
||||
* @param widget A widget, or a widget of widgets, for displaying custom
|
||||
* data in the file widget. This can be used, for example, to
|
||||
* display a check box with the caption "Open as read-only".
|
||||
* When creating this widget, you don't need to specify a parent,
|
||||
* since the widget's parent will be set automatically by KFileWidget.
|
||||
*/
|
||||
virtual void setCustomWidget(QWidget* widget) = 0;
|
||||
|
||||
/**
|
||||
* Sets a custom widget that should be added below the location and the filter
|
||||
* editors.
|
||||
* @param text Label of the custom widget, which is displayed below the labels
|
||||
* "Location:" and "Filter:".
|
||||
* @param widget Any kind of widget, but preferable a combo box or a line editor
|
||||
* to be compliant with the location and filter layout.
|
||||
* When creating this widget, you don't need to specify a parent,
|
||||
* since the widget's parent will be set automatically by KFileWidget.
|
||||
*/
|
||||
virtual void setCustomWidget(const QString& text, QWidget* widget) = 0;
|
||||
|
||||
/**
|
||||
* Called when clicking ok (when this widget is used in KFileDialog)
|
||||
* Might or might not call accept().
|
||||
*/
|
||||
virtual void slotOk() = 0;
|
||||
virtual void accept() = 0;
|
||||
virtual void slotCancel() = 0;
|
||||
|
||||
/**
|
||||
* Sets whether the user should be asked for confirmation
|
||||
* when an overwrite might occurr.
|
||||
*
|
||||
* @param enable Set this to true to enable checking.
|
||||
* @since 4.2
|
||||
*/
|
||||
virtual void setConfirmOverwrite(bool enable) { Q_UNUSED(enable); };
|
||||
|
||||
/**
|
||||
* Forces the inline previews to be shown or hidden, depending on @p show.
|
||||
*
|
||||
* @param show Whether to show inline previews or not.
|
||||
* @since 4.2
|
||||
*/
|
||||
virtual void setInlinePreviewShown(bool show) { Q_UNUSED(show); };
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(KAbstractFileWidget, "org.kde.KAbstractFileWidget")
|
||||
|
||||
#endif /* KABSTRACTFILEWIDGET_H */
|
||||
|
|
@ -1046,7 +1046,7 @@ Qt::SortOrder KDirOperator::Private::sortOrder() const
|
|||
|
||||
void KDirOperator::Private::updateSorting(QDir::SortFlags sort)
|
||||
{
|
||||
kDebug(kfile_area) << "changing sort flags from" << sorting << "to" << sort;
|
||||
kDebug() << "changing sort flags from" << sorting << "to" << sort;
|
||||
if (sort == sorting) {
|
||||
return;
|
||||
}
|
||||
|
@ -1556,7 +1556,7 @@ void KDirOperator::setDirLister(KDirLister *lister)
|
|||
|
||||
QWidget* mainWidget = window();
|
||||
d->dirLister->setMainWindow(mainWidget);
|
||||
kDebug(kfile_area) << "mainWidget=" << mainWidget;
|
||||
kDebug() << "mainWidget=" << mainWidget;
|
||||
|
||||
connect(d->dirLister, SIGNAL(percent(ulong)),
|
||||
SLOT(_k_slotProgress(ulong)));
|
||||
|
@ -1593,8 +1593,6 @@ void KDirOperator::highlightFile(const KFileItem &item)
|
|||
|
||||
void KDirOperator::setCurrentItem(const QString& url)
|
||||
{
|
||||
kDebug(kfile_area);
|
||||
|
||||
KFileItem item = d->dirLister->findByUrl(url);
|
||||
if (d->shouldFetchForItems && item.isNull()) {
|
||||
d->itemsToBeSetAsCurrent << url;
|
||||
|
@ -1607,8 +1605,6 @@ void KDirOperator::setCurrentItem(const QString& url)
|
|||
|
||||
void KDirOperator::setCurrentItem(const KFileItem& item)
|
||||
{
|
||||
kDebug(kfile_area);
|
||||
|
||||
if (!d->itemView) {
|
||||
return;
|
||||
}
|
||||
|
@ -1626,8 +1622,6 @@ void KDirOperator::setCurrentItem(const KFileItem& item)
|
|||
|
||||
void KDirOperator::setCurrentItems(const QStringList& urls)
|
||||
{
|
||||
kDebug(kfile_area);
|
||||
|
||||
if (!d->itemView) {
|
||||
return;
|
||||
}
|
||||
|
@ -1648,8 +1642,6 @@ void KDirOperator::setCurrentItems(const QStringList& urls)
|
|||
|
||||
void KDirOperator::setCurrentItems(const KFileItemList& items)
|
||||
{
|
||||
kDebug(kfile_area);
|
||||
|
||||
if (d->itemView == 0) {
|
||||
return;
|
||||
}
|
|
@ -29,7 +29,7 @@
|
|||
#include <kdirlister.h>
|
||||
#include <kfileitem.h>
|
||||
#include <kfile.h>
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QModelIndex>
|
||||
|
@ -95,7 +95,7 @@ class DeleteJob;
|
|||
* @short A widget for displaying files and browsing directories.
|
||||
* @author Stephan Kulow <coolo@kde.org>, Carsten Pfeiffer <pfeiffer@kde.org>
|
||||
*/
|
||||
class KFILE_EXPORT KDirOperator : public QWidget
|
||||
class KIO_EXPORT KDirOperator : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <kcategorizedsortfilterproxymodel.h>
|
||||
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
|
||||
/**
|
||||
* @brief Acts as proxy model for KDirModel to sort and filter
|
||||
|
@ -47,7 +47,7 @@
|
|||
*
|
||||
* @author Dominic Battre, Martin Pool and Peter Penz
|
||||
*/
|
||||
class KFILE_EXPORT KDirSortFilterProxyModel
|
||||
class KIO_EXPORT KDirSortFilterProxyModel
|
||||
: public KCategorizedSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <config-kfile.h>
|
||||
|
||||
#include <kabstractfilewidget.h>
|
||||
#include <kfilewidget.h>
|
||||
#include <kcombobox.h>
|
||||
#include <kglobal.h>
|
||||
#include <klocale.h>
|
||||
|
|
|
@ -40,37 +40,9 @@
|
|||
#include <krecentdocument.h>
|
||||
#include <kdebug.h>
|
||||
#include <kwindowsystem.h>
|
||||
#include "kabstractfilewidget.h"
|
||||
#include "kabstractfilemodule.h"
|
||||
#include "krecentdirs.h"
|
||||
#include "kservice.h"
|
||||
|
||||
static KAbstractFileModule* s_module = 0;
|
||||
static const char s_defaultFileModuleName[] = "kfilemodule";
|
||||
|
||||
static KAbstractFileModule* loadFileModule( const QString& moduleName )
|
||||
{
|
||||
KService::Ptr fileModuleService = KService::serviceByDesktopName(moduleName);
|
||||
if (fileModuleService) {
|
||||
return fileModuleService->createInstance<KAbstractFileModule>();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static KAbstractFileModule* fileModule()
|
||||
{
|
||||
if (!s_module) {
|
||||
QString moduleName = KConfig("kdeglobals").group(ConfigGroup).readEntry("file module", s_defaultFileModuleName);
|
||||
if (!(s_module = loadFileModule(moduleName))) {
|
||||
kDebug() << "Failed to load configured file module" << moduleName;
|
||||
if (moduleName != s_defaultFileModuleName) {
|
||||
kDebug() << "Falling back to default file module.";
|
||||
s_module = loadFileModule(s_defaultFileModuleName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return s_module;
|
||||
}
|
||||
#include "kfilewidget.h"
|
||||
|
||||
class KFileDialogPrivate
|
||||
{
|
||||
|
@ -81,7 +53,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
KAbstractFileWidget* w;
|
||||
KFileWidget* w;
|
||||
KConfigGroup cfgGroup;
|
||||
};
|
||||
|
||||
|
@ -91,15 +63,14 @@ KFileDialog::KFileDialog(const KUrl &startDir, const QString &filter,
|
|||
d(new KFileDialogPrivate())
|
||||
|
||||
{
|
||||
QWidget* fileQWidget = fileModule()->createFileWidget(startDir, this);
|
||||
d->w = ::qobject_cast<KAbstractFileWidget *>(fileQWidget);
|
||||
d->w = new KFileWidget(startDir, this);
|
||||
|
||||
setButtons( KDialog::None );
|
||||
restoreDialogSize(d->cfgGroup); // call this before the fileQWidget is set as the main widget.
|
||||
restoreDialogSize(d->cfgGroup); // call this before the d->w is set as the main widget.
|
||||
// otherwise the sizes for the components are not obeyed (ereslibre)
|
||||
|
||||
d->w->setFilter(filter);
|
||||
setMainWidget(fileQWidget);
|
||||
setMainWidget(d->w);
|
||||
|
||||
d->w->okButton()->show();
|
||||
connect(d->w->okButton(), SIGNAL(clicked()), SLOT(slotOk()));
|
||||
|
@ -107,23 +78,21 @@ KFileDialog::KFileDialog(const KUrl &startDir, const QString &filter,
|
|||
connect(d->w->cancelButton(), SIGNAL(clicked()), SLOT(slotCancel()));
|
||||
|
||||
// Publish signals
|
||||
// TODO: Move the relevant signal declarations from KFileWidget to the
|
||||
// KAbstractFileWidget interface?
|
||||
// Else, all of these connects (including "accepted") are not typesafe.
|
||||
// Answer: you cannot define signals in a non-qobject base class (DF).
|
||||
// I simply documentde them in kabstractfilewidget.h now.
|
||||
kDebug (kfile_area) << "KFileDialog connecting signals";
|
||||
connect(fileQWidget, SIGNAL(fileSelected(KUrl)),
|
||||
// I simply documentde them in kfilewidget.h now.
|
||||
kDebug () << "KFileDialog connecting signals";
|
||||
connect(d->w, SIGNAL(fileSelected(KUrl)),
|
||||
SIGNAL(fileSelected(KUrl)));
|
||||
connect(fileQWidget, SIGNAL(fileHighlighted(KUrl)),
|
||||
connect(d->w, SIGNAL(fileHighlighted(KUrl)),
|
||||
SIGNAL(fileHighlighted(KUrl)));
|
||||
connect(fileQWidget, SIGNAL(selectionChanged()),
|
||||
connect(d->w, SIGNAL(selectionChanged()),
|
||||
SIGNAL(selectionChanged()));
|
||||
connect(fileQWidget, SIGNAL(filterChanged(QString)),
|
||||
connect(d->w, SIGNAL(filterChanged(QString)),
|
||||
SIGNAL(filterChanged(QString)));
|
||||
|
||||
connect(fileQWidget, SIGNAL(accepted()), SLOT(accept()));
|
||||
//connect(fileQWidget, SIGNAL(canceled()), SLOT(slotCancel()));
|
||||
connect(d->w, SIGNAL(accepted()), SLOT(accept()));
|
||||
//connect(d->w, SIGNAL(canceled()), SLOT(slotCancel()));
|
||||
|
||||
if (customWidget) {
|
||||
d->w->setCustomWidget(QString(), customWidget);
|
||||
|
@ -493,7 +462,7 @@ bool KFileDialog::keepsLocation() const
|
|||
|
||||
void KFileDialog::setOperationMode(OperationMode mode)
|
||||
{
|
||||
d->w->setOperationMode(static_cast<KAbstractFileWidget::OperationMode>(mode));
|
||||
d->w->setOperationMode(static_cast<KFileWidget::OperationMode>(mode));
|
||||
}
|
||||
|
||||
KFileDialog::OperationMode KFileDialog::operationMode() const
|
||||
|
@ -521,12 +490,12 @@ void KFileDialog::hideEvent(QHideEvent* e)
|
|||
// static
|
||||
KUrl KFileDialog::getStartUrl(const KUrl &startDir, QString &recentDirClass)
|
||||
{
|
||||
return fileModule()->getStartUrl(startDir, recentDirClass);
|
||||
return KFileWidget::getStartUrl(startDir, recentDirClass);
|
||||
}
|
||||
|
||||
void KFileDialog::setStartDir(const KUrl& directory)
|
||||
{
|
||||
fileModule()->setStartDir(directory);
|
||||
KFileWidget::setStartDir(directory);
|
||||
}
|
||||
|
||||
KToolBar* KFileDialog::toolBar() const
|
||||
|
@ -534,7 +503,7 @@ KToolBar* KFileDialog::toolBar() const
|
|||
return d->w->toolBar();
|
||||
}
|
||||
|
||||
KAbstractFileWidget* KFileDialog::fileWidget()
|
||||
KFileWidget* KFileDialog::fileWidget()
|
||||
{
|
||||
return d->w;
|
||||
}
|
||||
|
|
|
@ -32,16 +32,13 @@
|
|||
#include <kurl.h>
|
||||
#include <kmimetype.h>
|
||||
|
||||
class KAbstractFileWidget;
|
||||
class KFileWidget;
|
||||
|
||||
class KActionCollection;
|
||||
class KUrlComboBox;
|
||||
class KFileFilterCombo;
|
||||
class KPushButton;
|
||||
class KToolBar;
|
||||
class KPreviewWidgetBase;
|
||||
|
||||
class KFileDialogPrivate;
|
||||
|
||||
/**
|
||||
|
@ -618,7 +615,7 @@ public:
|
|||
* Returns the KFileWidget that implements most of this file dialog.
|
||||
* If you link to libkfile you can cast this to a KFileWidget*.
|
||||
*/
|
||||
KAbstractFileWidget* fileWidget();
|
||||
KFileWidget* fileWidget();
|
||||
|
||||
/**
|
||||
* Returns a pointer to the toolbar.
|
||||
|
|
|
@ -147,11 +147,11 @@ void KFileFilterCombo::setMimeFilter( const QStringList& types,
|
|||
QString allComments, allTypes;
|
||||
for(QStringList::ConstIterator it = types.begin(); it != types.end(); ++it)
|
||||
{
|
||||
kDebug(kfile_area) << *it;
|
||||
kDebug() << *it;
|
||||
KMimeType::Ptr type = KMimeType::mimeType( *it );
|
||||
|
||||
if (!type) {
|
||||
kDebug(kfile_area) << "Could not create mimetype!\n";
|
||||
kDebug() << "Could not create mimetype!\n";
|
||||
continue;
|
||||
}
|
||||
|
|
@ -20,10 +20,10 @@
|
|||
#ifndef KFILEFILTERCOMBO_H
|
||||
#define KFILEFILTERCOMBO_H
|
||||
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
#include <kcombobox.h>
|
||||
|
||||
class KFILE_EXPORT KFileFilterCombo : public KComboBox
|
||||
class KIO_EXPORT KFileFilterCombo : public KComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
#define KFILEPLACEEDITDIALOG_H
|
||||
|
||||
// Not exported anymore, only used internally.
|
||||
//#include <kfile_export.h>
|
||||
//#include <kio/kio_export.h>
|
||||
|
||||
#include <kdialog.h>
|
||||
#include <kurl.h>
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef KFILEPLACESMODEL_H
|
||||
#define KFILEPLACESMODEL_H
|
||||
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
#include <kurl.h>
|
||||
|
@ -37,7 +37,7 @@
|
|||
* where user can access files. Only revelant when
|
||||
* used with QListView or QTableView.
|
||||
*/
|
||||
class KFILE_EXPORT KFilePlacesModel : public QAbstractItemModel
|
||||
class KIO_EXPORT KFilePlacesModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef KFILEPLACESVIEW_H
|
||||
#define KFILEPLACESVIEW_H
|
||||
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
|
||||
#include <QtGui/QListView>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
/**
|
||||
* This class allows to display a KFilePlacesModel.
|
||||
*/
|
||||
class KFILE_EXPORT KFilePlacesView : public QListView
|
||||
class KIO_EXPORT KFilePlacesView : public QListView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef KFILEPREVIEWGENERATOR_H
|
||||
#define KFILEPREVIEWGENERATOR_H
|
||||
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QAbstractItemView>
|
||||
|
@ -47,7 +47,7 @@ class KDirModel;
|
|||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
class KFILE_EXPORT KFilePreviewGenerator : public QObject
|
||||
class KIO_EXPORT KFilePreviewGenerator : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -291,10 +291,10 @@ static const char autocompletionWhatsThisText[] = I18N_NOOP("<qt>While typing in
|
|||
"and selecting a preferred mode from the <b>Text Completion</b> menu.</qt>");
|
||||
|
||||
KFileWidget::KFileWidget( const KUrl& _startDir, QWidget *parent )
|
||||
: QWidget(parent), KAbstractFileWidget(), d(new KFileWidgetPrivate(this))
|
||||
: QWidget(parent), d(new KFileWidgetPrivate(this))
|
||||
{
|
||||
KUrl startDir(_startDir);
|
||||
kDebug(kfile_area) << "startDir" << startDir;
|
||||
kDebug() << "startDir" << startDir;
|
||||
QString filename;
|
||||
|
||||
d->okButton = new KPushButton(KStandardGuiItem::ok(), this);
|
||||
|
@ -577,11 +577,11 @@ KFileWidget::KFileWidget( const KUrl& _startDir, QWidget *parent )
|
|||
{
|
||||
KIO::StatJob *statJob = KIO::stat(startDir, KIO::HideProgressInfo);
|
||||
statRes = KIO::NetAccess::synchronousRun(statJob, this);
|
||||
kDebug(kfile_area) << "stat of" << startDir << "-> statRes" << statRes << "isDir" << statJob->statResult().isDir();
|
||||
kDebug() << "stat of" << startDir << "-> statRes" << statRes << "isDir" << statJob->statResult().isDir();
|
||||
if (!statRes || !statJob->statResult().isDir()) {
|
||||
filename = startDir.fileName();
|
||||
startDir.setPath(startDir.directory());
|
||||
kDebug(kfile_area) << "statJob -> startDir" << startDir << "filename" << filename;
|
||||
kDebug() << "statJob -> startDir" << startDir << "filename" << filename;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -595,7 +595,7 @@ KFileWidget::KFileWidget( const KUrl& _startDir, QWidget *parent )
|
|||
// we could stat it and it is not a directory. Set it.
|
||||
if (!filename.isEmpty()) {
|
||||
QLineEdit* lineEdit = d->locationEdit->lineEdit();
|
||||
kDebug(kfile_area) << "selecting filename" << filename;
|
||||
kDebug() << "selecting filename" << filename;
|
||||
if (statRes) {
|
||||
d->setLocationText(filename);
|
||||
} else {
|
||||
|
@ -705,7 +705,7 @@ void KFileWidget::setPreviewWidget(KPreviewWidgetBase *w) {
|
|||
|
||||
KUrl KFileWidgetPrivate::getCompleteUrl(const QString &_url) const
|
||||
{
|
||||
// kDebug(kfile_area) << "got url " << _url;
|
||||
// kDebug() << "got url " << _url;
|
||||
|
||||
const QString url = KShell::tildeExpand(_url);
|
||||
KUrl u;
|
||||
|
@ -729,7 +729,7 @@ KUrl KFileWidgetPrivate::getCompleteUrl(const QString &_url) const
|
|||
// Called by KFileDialog
|
||||
void KFileWidget::slotOk()
|
||||
{
|
||||
// kDebug(kfile_area) << "slotOk\n";
|
||||
// kDebug() << "slotOk";
|
||||
|
||||
const KFileItemList items = d->ops->selectedItems();
|
||||
const QString locationEditCurrentText(KShell::tildeExpand(d->locationEditCurrentText()));
|
||||
|
@ -745,7 +745,7 @@ void KFileWidget::slotOk()
|
|||
// Make sure that one of the modes was provided
|
||||
if (!((mode & KFile::File) || (mode & KFile::Directory) || (mode & KFile::Files))) {
|
||||
mode |= KFile::File;
|
||||
kDebug(kfile_area) << "No mode() provided";
|
||||
kDebug() << "No mode() provided";
|
||||
}
|
||||
|
||||
// if we are on file mode, and the list of provided files/folder is greater than one, inform
|
||||
|
@ -1357,8 +1357,6 @@ void KFileWidgetPrivate::initGUI()
|
|||
|
||||
void KFileWidgetPrivate::_k_slotFilterChanged()
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
filterDelayTimer.stop();
|
||||
|
||||
QString filter = filterWidget->currentFilter();
|
||||
|
@ -1386,16 +1384,12 @@ void KFileWidgetPrivate::_k_slotFilterChanged()
|
|||
|
||||
void KFileWidget::setUrl(const KUrl& url, bool clearforward)
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
d->ops->setUrl(url, clearforward);
|
||||
}
|
||||
|
||||
// Protected
|
||||
void KFileWidgetPrivate::_k_urlEntered(const KUrl& url)
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
QString filename = locationEditCurrentText();
|
||||
|
||||
KUrlComboBox* pathCombo = urlNavigator->editor();
|
||||
|
@ -1427,14 +1421,11 @@ void KFileWidgetPrivate::_k_urlEntered(const KUrl& url)
|
|||
void KFileWidgetPrivate::_k_locationAccepted(const QString &url)
|
||||
{
|
||||
Q_UNUSED(url);
|
||||
// kDebug(kfile_area);
|
||||
q->slotOk();
|
||||
}
|
||||
|
||||
void KFileWidgetPrivate::_k_enterUrl( const KUrl& url )
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
KUrl fixedUrl( url );
|
||||
// append '/' if needed: url combo does not add it
|
||||
// tokenize() expects it because uses KUrl::setFileName()
|
||||
|
@ -1446,15 +1437,11 @@ void KFileWidgetPrivate::_k_enterUrl( const KUrl& url )
|
|||
|
||||
void KFileWidgetPrivate::_k_enterUrl( const QString& url )
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
_k_enterUrl( KUrl( KUrlCompletion::replacedPath( url, true, true )) );
|
||||
}
|
||||
|
||||
bool KFileWidgetPrivate::toOverwrite(const KUrl &url)
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
KIO::StatJob *statJob = KIO::stat(url, KIO::HideProgressInfo);
|
||||
bool res = KIO::NetAccess::synchronousRun(statJob, q);
|
||||
|
||||
|
@ -1475,7 +1462,7 @@ bool KFileWidgetPrivate::toOverwrite(const KUrl &url)
|
|||
|
||||
void KFileWidget::setSelection(const QString& url)
|
||||
{
|
||||
// kDebug(kfile_area) << "setSelection " << url;
|
||||
// kDebug() << "setSelection " << url;
|
||||
|
||||
if (url.isEmpty()) {
|
||||
return;
|
||||
|
@ -1510,8 +1497,6 @@ void KFileWidgetPrivate::_k_slotLoadingFinished()
|
|||
|
||||
void KFileWidgetPrivate::_k_fileCompletion( const QString& match )
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
if (match.isEmpty() || locationEdit->currentText().contains('"')) {
|
||||
return;
|
||||
}
|
||||
|
@ -1521,8 +1506,6 @@ void KFileWidgetPrivate::_k_fileCompletion( const QString& match )
|
|||
|
||||
void KFileWidgetPrivate::_k_slotLocationChanged( const QString& text )
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
locationEdit->lineEdit()->setModified(true);
|
||||
|
||||
if (text.isEmpty() && ops->view()) {
|
||||
|
@ -1549,8 +1532,6 @@ void KFileWidgetPrivate::_k_slotLocationChanged( const QString& text )
|
|||
|
||||
KUrl KFileWidget::selectedUrl() const
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
if ( d->inAccept )
|
||||
return d->url;
|
||||
else
|
||||
|
@ -1559,8 +1540,6 @@ KUrl KFileWidget::selectedUrl() const
|
|||
|
||||
KUrl::List KFileWidget::selectedUrls() const
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
KUrl::List list;
|
||||
if ( d->inAccept ) {
|
||||
if (d->ops->mode() & KFile::Files)
|
||||
|
@ -1574,8 +1553,6 @@ KUrl::List KFileWidget::selectedUrls() const
|
|||
|
||||
KUrl::List& KFileWidgetPrivate::parseSelectedUrls()
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
if ( filenames.isEmpty() ) {
|
||||
return urlList;
|
||||
}
|
||||
|
@ -1609,8 +1586,6 @@ KUrl::List& KFileWidgetPrivate::parseSelectedUrls()
|
|||
// FIXME: current implementation drawback: a filename can't contain quotes
|
||||
KUrl::List KFileWidgetPrivate::tokenize( const QString& line ) const
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
KUrl::List urls;
|
||||
KUrl u( ops->url() );
|
||||
u.adjustPath(KUrl::AddTrailingSlash);
|
||||
|
@ -1666,8 +1641,6 @@ KUrl::List KFileWidgetPrivate::tokenize( const QString& line ) const
|
|||
|
||||
QString KFileWidget::selectedFile() const
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
if ( d->inAccept ) {
|
||||
const KUrl url = d->mostLocalUrl(d->url);
|
||||
if (url.isLocalFile())
|
||||
|
@ -1683,8 +1656,6 @@ QString KFileWidget::selectedFile() const
|
|||
|
||||
QStringList KFileWidget::selectedFiles() const
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
QStringList list;
|
||||
|
||||
if (d->inAccept) {
|
||||
|
@ -1774,8 +1745,6 @@ bool KFileWidget::eventFilter(QObject* watched, QEvent* event)
|
|||
|
||||
void KFileWidget::setMode( KFile::Modes m )
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
d->ops->setMode(m);
|
||||
if ( d->ops->dirOnlyMode() ) {
|
||||
d->filterWidget->setFilter( i18n("*|All Folders") );
|
||||
|
@ -1874,8 +1843,6 @@ void KFileWidgetPrivate::writeViewConfig()
|
|||
|
||||
void KFileWidgetPrivate::readRecentFiles()
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
QObject::disconnect(locationEdit, SIGNAL(editTextChanged(QString)),
|
||||
q, SLOT(_k_slotLocationChanged(QString)));
|
||||
|
||||
|
@ -1902,7 +1869,6 @@ void KFileWidgetPrivate::readRecentFiles()
|
|||
|
||||
void KFileWidgetPrivate::saveRecentFiles()
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
configGroup.writePathEntry(RecentFiles, locationEdit->urls());
|
||||
|
||||
KUrlComboBox *pathCombo = urlNavigator->editor();
|
||||
|
@ -1922,8 +1888,6 @@ KPushButton * KFileWidget::cancelButton() const
|
|||
// Called by KFileDialog
|
||||
void KFileWidget::slotCancel()
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
d->ops->close();
|
||||
|
||||
d->writeViewConfig();
|
||||
|
@ -1941,8 +1905,6 @@ bool KFileWidget::keepsLocation() const
|
|||
|
||||
void KFileWidget::setOperationMode( OperationMode mode )
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
d->operationMode = mode;
|
||||
d->keepLocation = (mode == Saving);
|
||||
d->filterWidget->setEditable( !d->hasDefaultFilter || mode != Saving );
|
||||
|
@ -1972,8 +1934,7 @@ KFileWidget::OperationMode KFileWidget::operationMode() const
|
|||
|
||||
void KFileWidgetPrivate::_k_slotAutoSelectExtClicked()
|
||||
{
|
||||
// kDebug (kfile_area) << "slotAutoSelectExtClicked(): "
|
||||
// << autoSelectExtCheckBox->isChecked();
|
||||
// kDebug () << "slotAutoSelectExtClicked()" << autoSelectExtCheckBox->isChecked();
|
||||
|
||||
// whether the _user_ wants it on/off
|
||||
autoSelectExtChecked = autoSelectExtCheckBox->isChecked();
|
||||
|
@ -1984,21 +1945,17 @@ void KFileWidgetPrivate::_k_slotAutoSelectExtClicked()
|
|||
|
||||
void KFileWidgetPrivate::_k_placesViewSplitterMoved(int pos, int index)
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
// we need to record the size of the splitter when the splitter changes size
|
||||
// so we can keep the places box the right size!
|
||||
if (placesDock && index == 1) {
|
||||
placesViewWidth = pos;
|
||||
// kDebug() << "setting lafBox minwidth to" << placesViewWidth;
|
||||
// kDebug() << "setting lafBox minwidth to" << placesViewWidth;
|
||||
lafBox->setColumnMinimumWidth(0, placesViewWidth);
|
||||
}
|
||||
}
|
||||
|
||||
void KFileWidgetPrivate::_k_activateUrlNavigator()
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
urlNavigator->setUrlEditable(!urlNavigator->isUrlEditable());
|
||||
if(urlNavigator->isUrlEditable()) {
|
||||
urlNavigator->setFocus();
|
||||
|
@ -2080,7 +2037,7 @@ void KFileWidgetPrivate::updateAutoSelectExtension()
|
|||
// COPYING.txt ...)
|
||||
//
|
||||
|
||||
// kDebug (kfile_area) << "Figure out an extension: ";
|
||||
// kDebug () << "Figure out an extension: ";
|
||||
QString lastExtension = extension;
|
||||
extension.clear();
|
||||
|
||||
|
@ -2100,8 +2057,8 @@ void KFileWidgetPrivate::updateAutoSelectExtension()
|
|||
QString currentExtension = KMimeType::extractKnownExtension(locationEditCurrentText());
|
||||
if ( currentExtension.isEmpty() )
|
||||
currentExtension = locationEditCurrentText().section(QLatin1Char('.'), -1, -1);
|
||||
kDebug (kfile_area) << "filter:" << filter << "locationEdit:" << locationEditCurrentText()
|
||||
<< "currentExtension:" << currentExtension;
|
||||
kDebug () << "filter:" << filter << "locationEdit:" << locationEditCurrentText()
|
||||
<< "currentExtension:" << currentExtension;
|
||||
|
||||
QString defaultExtension;
|
||||
QStringList extensionList;
|
||||
|
@ -2142,7 +2099,7 @@ void KFileWidgetPrivate::updateAutoSelectExtension()
|
|||
else
|
||||
extension = defaultExtension;
|
||||
|
||||
kDebug (kfile_area) << "List:" << extensionList << "auto-selected extension:" << extension;
|
||||
kDebug() << "List:" << extensionList << "auto-selected extension:" << extension;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2231,7 +2188,7 @@ void KFileWidgetPrivate::updateLocationEditExtension (const QString &lastExtensi
|
|||
return;
|
||||
|
||||
KUrl url = getCompleteUrl(urlStr);
|
||||
// kDebug (kfile_area) << "updateLocationEditExtension (" << url << ")";
|
||||
// kDebug() << "updateLocationEditExtension (" << url << ")";
|
||||
|
||||
const int fileNameOffset = urlStr.lastIndexOf ('/') + 1;
|
||||
QString fileName = urlStr.mid (fileNameOffset);
|
||||
|
@ -2248,11 +2205,11 @@ void KFileWidgetPrivate::updateLocationEditExtension (const QString &lastExtensi
|
|||
bool result = KIO::NetAccess::synchronousRun(statJob, q);
|
||||
if (result)
|
||||
{
|
||||
// kDebug (kfile_area) << "\tfile exists";
|
||||
// kDebug () << "\tfile exists";
|
||||
|
||||
if (statJob->statResult().isDir())
|
||||
{
|
||||
// kDebug (kfile_area) << "\tisDir - won't alter extension";
|
||||
// kDebug () << "\tisDir - won't alter extension";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2287,8 +2244,6 @@ void KFileWidgetPrivate::updateLocationEditExtension (const QString &lastExtensi
|
|||
// (this prevents you from accidently saving "file.kwd" as RTF, for example)
|
||||
void KFileWidgetPrivate::updateFilter()
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
if ((operationMode == KFileWidget::Saving) && (ops->mode() & KFile::File) ) {
|
||||
QString urlStr = locationEditCurrentText();
|
||||
if (urlStr.isEmpty())
|
||||
|
@ -2321,8 +2276,6 @@ void KFileWidgetPrivate::updateFilter()
|
|||
// applies only to a file that doesn't already exist
|
||||
void KFileWidgetPrivate::appendExtension (KUrl &url)
|
||||
{
|
||||
// kDebug(kfile_area);
|
||||
|
||||
if (!autoSelectExtCheckBox->isChecked() || extension.isEmpty())
|
||||
return;
|
||||
|
||||
|
@ -2330,7 +2283,7 @@ void KFileWidgetPrivate::appendExtension (KUrl &url)
|
|||
if (fileName.isEmpty())
|
||||
return;
|
||||
|
||||
// kDebug (kfile_area) << "appendExtension(" << url << ")";
|
||||
// kDebug () << "appendExtension(" << url << ")";
|
||||
|
||||
const int len = fileName.length();
|
||||
const int dot = fileName.lastIndexOf ('.');
|
||||
|
@ -2347,14 +2300,13 @@ void KFileWidgetPrivate::appendExtension (KUrl &url)
|
|||
bool res = KIO::NetAccess::synchronousRun(statJob, q);
|
||||
if (res)
|
||||
{
|
||||
// kDebug (kfile_area) << "\tfile exists - won't append extension";
|
||||
// kDebug () << "\tfile exists - won't append extension";
|
||||
return;
|
||||
}
|
||||
|
||||
// suppress automatically append extension?
|
||||
if (suppressExtension)
|
||||
{
|
||||
//
|
||||
// Strip trailing dot
|
||||
// This allows lazy people to have autoSelectExtCheckBox->isChecked
|
||||
// but don't want a file extension to be appended
|
||||
|
@ -2364,15 +2316,15 @@ void KFileWidgetPrivate::appendExtension (KUrl &url)
|
|||
// and the trailing dot will be removed (or just stop being lazy and
|
||||
// turn off this feature so that you can type "README.")
|
||||
//
|
||||
// kDebug (kfile_area) << "\tstrip trailing dot";
|
||||
// kDebug () << "\tstrip trailing dot";
|
||||
url.setFileName (fileName.left (len - 1));
|
||||
}
|
||||
// evilmatically append extension :) if the user hasn't specified one
|
||||
else if (unspecifiedExtension)
|
||||
{
|
||||
// kDebug (kfile_area) << "\tappending extension \'" << extension << "\'...";
|
||||
// kDebug () << "\tappending extension \'" << extension << "\'...";
|
||||
url.setFileName (fileName + extension);
|
||||
// kDebug (kfile_area) << "\tsaving as \'" << url << "\'";
|
||||
// kDebug () << "\tsaving as \'" << url << "\'";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2623,7 +2575,7 @@ KUrl KFileWidget::getStartUrl( const KUrl& startDir,
|
|||
ret = *lastDirectory;
|
||||
}
|
||||
|
||||
kDebug(kfile_area) << "for" << startDir << "->" << ret << "recentDirClass" << recentDirClass << "fileName" << fileName;
|
||||
kDebug() << "for" << startDir << "->" << ret << "recentDirClass" << recentDirClass << "fileName" << fileName;
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -30,19 +30,40 @@
|
|||
|
||||
#include <QtGui/qwidget.h>
|
||||
|
||||
#include "kfile_export.h"
|
||||
#include "kabstractfilewidget.h"
|
||||
#include "kio/kio_export.h"
|
||||
#include "kmimetype.h"
|
||||
#include "kurl.h"
|
||||
#include "kfile.h"
|
||||
#include "kconfiggroup.h"
|
||||
|
||||
class KPreviewWidgetBase;
|
||||
class KPushButton;
|
||||
class KActionCollection;
|
||||
class KToolBar;
|
||||
class KFileWidgetPrivate;
|
||||
class KUrlComboBox;
|
||||
class KFileFilterCombo;
|
||||
class KJob;
|
||||
class KFileItem;
|
||||
class KDirOperator;
|
||||
|
||||
class KFILE_EXPORT KFileWidget : public QWidget, public KAbstractFileWidget
|
||||
class KIO_EXPORT KFileWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(KAbstractFileWidget)
|
||||
public:
|
||||
/**
|
||||
* Defines some default behavior of the filedialog.
|
||||
* E.g. in mode @p Opening and @p Saving, the selected files/urls will
|
||||
* be added to the "recent documents" list. The Saving mode also implies
|
||||
* setKeepLocation() being set.
|
||||
*
|
||||
* @p Other means that no default actions are performed.
|
||||
*
|
||||
* @see setOperationMode
|
||||
* @see operationMode
|
||||
*/
|
||||
enum OperationMode { Other = 0, Opening, Saving };
|
||||
|
||||
/**
|
||||
* Constructs a file selector widget.
|
||||
*
|
||||
|
@ -414,6 +435,24 @@ public:
|
|||
*/
|
||||
virtual void setCustomWidget(const QString& text, QWidget* widget);
|
||||
|
||||
|
||||
/**
|
||||
* Sets whether the user should be asked for confirmation
|
||||
* when an overwrite might occurr.
|
||||
*
|
||||
* @param enable Set this to true to enable checking.
|
||||
* @since 4.2
|
||||
*/
|
||||
virtual void setConfirmOverwrite(bool enable) { Q_UNUSED(enable); };
|
||||
|
||||
/**
|
||||
* Forces the inline previews to be shown or hidden, depending on @p show.
|
||||
*
|
||||
* @param show Whether to show inline previews or not.
|
||||
* @since 4.2
|
||||
*/
|
||||
virtual void setInlinePreviewShown(bool show) { Q_UNUSED(show); };
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Called when clicking ok (when this widget is used in KFileDialog)
|
||||
|
@ -513,5 +552,5 @@ private:
|
|||
Q_PRIVATE_SLOT(d, void _k_slotIconSizeChanged(int))
|
||||
};
|
||||
|
||||
#endif /* KABSTRACTFILEWIDGET_H */
|
||||
#endif /* KFILEWIDGET_H */
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef KNAMEANDURLINPUTDIALOG_H
|
||||
#define KNAMEANDURLINPUTDIALOG_H
|
||||
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
#include <kdialog.h>
|
||||
#include <kurl.h>
|
||||
|
||||
|
@ -35,7 +35,7 @@ class KNameAndUrlInputDialogPrivate;
|
|||
* @since 4.5
|
||||
* @author David Faure <faure@kde.org>
|
||||
*/
|
||||
class KFILE_EXPORT KNameAndUrlInputDialog : public KDialog
|
||||
class KIO_EXPORT KNameAndUrlInputDialog : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
|
@ -139,7 +139,6 @@ public:
|
|||
|
||||
void KNewFileMenuSingleton::parseFiles()
|
||||
{
|
||||
//kDebug(kfile_area);
|
||||
filesParsed = true;
|
||||
QMutableListIterator<KNewFileMenuSingleton::Entry> templIter(*templatesList);
|
||||
while (templIter.hasNext()) {
|
||||
|
@ -172,7 +171,7 @@ void KNewFileMenuSingleton::parseFiles()
|
|||
{
|
||||
// A relative path, then (that's the default in the files we ship)
|
||||
QString linkDir = filePath.left(filePath.lastIndexOf('/') + 1 /*keep / */);
|
||||
//kDebug(kfile_area) << "linkDir=" << linkDir;
|
||||
// kDebug() << "linkDir=" << linkDir;
|
||||
templatePath = linkDir + templatePath;
|
||||
}
|
||||
}
|
||||
|
@ -195,9 +194,9 @@ void KNewFileMenuSingleton::parseFiles()
|
|||
text.truncate(text.length() - 8);
|
||||
}
|
||||
templ.text = text;
|
||||
/*kDebug(kfile_area) << "Updating entry with text=" << text
|
||||
<< "entryType=" << templ.entryType
|
||||
<< "templatePath=" << templ.templatePath;*/
|
||||
/* kDebug() << "Updating entry with text=" << text
|
||||
<< "entryType=" << templ.entryType
|
||||
<< "templatePath=" << templ.templatePath;*/
|
||||
}
|
||||
else {
|
||||
templ.entryType = KNewFileMenuSingleton::Separator;
|
||||
|
@ -362,7 +361,7 @@ public:
|
|||
bool KNewFileMenuPrivate::checkSourceExists(const QString& src)
|
||||
{
|
||||
if (!QFile::exists(src)) {
|
||||
kWarning(kfile_area) << src << "doesn't exist" ;
|
||||
kWarning() << src << "doesn't exist" ;
|
||||
|
||||
KDialog* dialog = new KDialog(m_parentWidget);
|
||||
dialog->setCaption( i18n("Sorry") );
|
||||
|
@ -529,7 +528,7 @@ void KNewFileMenuPrivate::executeStrategy()
|
|||
if (srcFile.open(QIODevice::ReadOnly)) {
|
||||
KMimeType::Ptr wantedMime = KMimeType::findByUrl(uSrc);
|
||||
KMimeType::Ptr mime = KMimeType::findByNameAndContent(m_copyData.m_chosenFileName, srcFile.read(1024));
|
||||
//kDebug() << "mime=" << mime->name() << "wantedMime=" << wantedMime->name();
|
||||
// kDebug() << "mime=" << mime->name() << "wantedMime=" << wantedMime->name();
|
||||
if (!mime->is(wantedMime->name()))
|
||||
chosenFileName += wantedMime->mainExtension();
|
||||
}
|
||||
|
@ -553,7 +552,7 @@ void KNewFileMenuPrivate::executeStrategy()
|
|||
// which KIO::symlink obviously doesn't emit... Needs code in FileUndoManager.
|
||||
//KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Link, lstSrc, dest, kjob);
|
||||
} else {
|
||||
//kDebug(kfile_area) << "KIO::copyAs(" << uSrc.url() << "," << dest.url() << ")";
|
||||
// kDebug() << "KIO::copyAs(" << uSrc.url() << "," << dest.url() << ")";
|
||||
KIO::CopyJob * job = KIO::copyAs(uSrc, dest);
|
||||
job->setDefaultPermissions(true);
|
||||
kjob = job;
|
||||
|
@ -602,7 +601,7 @@ void KNewFileMenuPrivate::fillMenu()
|
|||
|
||||
const bool bSkip = seenTexts.contains(entry.text);
|
||||
if (bSkip) {
|
||||
kDebug(kfile_area) << "skipping" << entry.filePath;
|
||||
kDebug() << "skipping" << entry.filePath;
|
||||
} else {
|
||||
seenTexts.insert(entry.text);
|
||||
//const KNewFileMenuSingleton::Entry entry = templatesList->at(i-1);
|
||||
|
@ -636,7 +635,7 @@ void KNewFileMenuPrivate::fillMenu()
|
|||
if (entry.mimeType.isEmpty()) {
|
||||
mime = KMimeType::findByPath(entry.templatePath);
|
||||
if (mime) {
|
||||
//kDebug() << entry.templatePath << "is" << mime->name();
|
||||
// kDebug() << entry.templatePath << "is" << mime->name();
|
||||
entry.mimeType = mime->name();
|
||||
} else {
|
||||
entry.mimeType = KMimeType::defaultMimeType();
|
||||
|
@ -653,7 +652,7 @@ void KNewFileMenuPrivate::fillMenu()
|
|||
}
|
||||
|
||||
if (!keep) {
|
||||
//kDebug() << "Not keeping" << entry.templatePath;
|
||||
// kDebug() << "Not keeping" << entry.templatePath;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -664,7 +663,7 @@ void KNewFileMenuPrivate::fillMenu()
|
|||
act->setText(i18nc("@item:inmenu Create New", "%1", entry.text));
|
||||
act->setActionGroup(m_newMenuGroup);
|
||||
|
||||
//kDebug() << templatePath << entry.filePath;
|
||||
// kDebug() << templatePath << entry.filePath;
|
||||
|
||||
if (templatePath.endsWith("/URL.desktop")) {
|
||||
linkURL = act;
|
||||
|
@ -798,13 +797,12 @@ void KNewFileMenuPrivate::_k_slotCreateHiddenDirectory()
|
|||
void KNewFileMenuPrivate::_k_slotFillTemplates()
|
||||
{
|
||||
KNewFileMenuSingleton* s = kNewMenuGlobals;
|
||||
//kDebug(kfile_area);
|
||||
// Ensure any changes in the templates dir will call this
|
||||
if (! s->dirWatch) {
|
||||
s->dirWatch = new KDirWatch;
|
||||
const QStringList dirs = m_actionCollection->componentData().dirs()->resourceDirs("templates");
|
||||
for (QStringList::const_iterator it = dirs.constBegin() ; it != dirs.constEnd() ; ++it) {
|
||||
//kDebug(kfile_area) << "Templates resource dir:" << *it;
|
||||
// kDebug() << "Templates resource dir:" << *it;
|
||||
s->dirWatch->addDir(*it);
|
||||
}
|
||||
QObject::connect(s->dirWatch, SIGNAL(dirty(QString)),
|
||||
|
@ -820,7 +818,7 @@ void KNewFileMenuPrivate::_k_slotFillTemplates()
|
|||
const QStringList files = m_actionCollection->componentData().dirs()->findAllResources("templates");
|
||||
QMap<QString, KNewFileMenuSingleton::Entry> slist; // used for sorting
|
||||
Q_FOREACH(const QString& file, files) {
|
||||
//kDebug(kfile_area) << file;
|
||||
// kDebug() << file;
|
||||
if (file[0] != '.') {
|
||||
KNewFileMenuSingleton::Entry e;
|
||||
e.filePath = file;
|
||||
|
@ -966,17 +964,17 @@ KNewFileMenu::KNewFileMenu(KActionCollection* collection, const QString& name, Q
|
|||
|
||||
KNewFileMenu::~KNewFileMenu()
|
||||
{
|
||||
//kDebug(kfile_area) << this;
|
||||
// kDebug() << this;
|
||||
delete d;
|
||||
}
|
||||
|
||||
void KNewFileMenu::checkUpToDate()
|
||||
{
|
||||
KNewFileMenuSingleton* s = kNewMenuGlobals;
|
||||
//kDebug(kfile_area) << this << "m_menuItemsVersion=" << d->m_menuItemsVersion
|
||||
// << "s->templatesVersion=" << s->templatesVersion;
|
||||
// kDebug() << this << "m_menuItemsVersion=" << d->m_menuItemsVersion
|
||||
// << "s->templatesVersion=" << s->templatesVersion;
|
||||
if (d->m_menuItemsVersion < s->templatesVersion || s->templatesVersion == 0) {
|
||||
//kDebug(kfile_area) << "recreating actions";
|
||||
// kDebug() << "recreating actions";
|
||||
// We need to clean up the action collection
|
||||
// We look for our actions using the group
|
||||
foreach (QAction* action, d->m_newMenuGroup->actions())
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <kactionmenu.h>
|
||||
#include <kurl.h>
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
|
||||
class KJob;
|
||||
|
||||
|
@ -51,7 +51,7 @@ class KNewFileMenuPrivate;
|
|||
* from Christoph Pickart <pickart@iam.uni-bonn.de>
|
||||
* @since 4.5
|
||||
*/
|
||||
class KFILE_EXPORT KNewFileMenu : public KActionMenu
|
||||
class KIO_EXPORT KNewFileMenu : public KActionMenu
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
|
@ -23,7 +23,7 @@
|
|||
#ifndef KURLNAVIGATOR_H
|
||||
#define KURLNAVIGATOR_H
|
||||
|
||||
#include <kfile_export.h>
|
||||
#include <kio/kio_export.h>
|
||||
|
||||
#include <kurl.h>
|
||||
#include <QWidget>
|
||||
|
@ -71,7 +71,7 @@ class KUrlComboBox;
|
|||
* the application to restore the view state by getting the values from
|
||||
* KUrlNavigator::locationState().
|
||||
*/
|
||||
class KFILE_EXPORT KUrlNavigator : public QWidget
|
||||
class KIO_EXPORT KUrlNavigator : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -2,10 +2,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|||
# for <kio/global.h>
|
||||
include_directories(${KDE4_KIO_INCLUDES})
|
||||
|
||||
add_definitions(
|
||||
-DTEST_DATA="${CMAKE_SOURCE_DIR}/solid/solid/backends/fakehw/fakecomputer.xml"
|
||||
)
|
||||
|
||||
MACRO(KIO_UNIT_TESTS)
|
||||
FOREACH(_testname ${ARGN})
|
||||
kde4_add_test(kio-${_testname} ${_testname}.cpp)
|
||||
target_link_libraries(kio-${_testname} ${QT_QTTEST_LIBRARY} kio)
|
||||
target_link_libraries(kio-${_testname} ${QT_QTTEST_LIBRARY} ${QT_QTXML_LIBRARY} kio)
|
||||
ENDFOREACH(_testname)
|
||||
ENDMACRO(KIO_UNIT_TESTS)
|
||||
|
||||
|
@ -27,4 +31,8 @@ KIO_UNIT_TESTS(
|
|||
globaltest
|
||||
udsentrytest
|
||||
kfilemetainfotest
|
||||
kfileplacesmodeltest
|
||||
kurlnavigatortest
|
||||
kdiroperatortest
|
||||
knewfilemenutest
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue