Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KFind
Commits
496cc35b
Commit
496cc35b
authored
Jun 17, 2017
by
Laurent Montel
Browse files
Fix clazy warning
parent
087b1e4b
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/kfinddlg.cpp
View file @
496cc35b
...
...
@@ -67,7 +67,7 @@ KfindDlg::KfindDlg(const QUrl & url, QWidget *parent)
win
=
new
KFindTreeView
(
frame
,
this
);
mStatusBar
=
new
KStatusBar
(
frame
);
mStatusBar
->
insertItem
(
Q
Latin1
String
(
"AMiddleLengthText..."
),
0
);
mStatusBar
->
insertItem
(
QString
Literal
(
"AMiddleLengthText..."
),
0
);
setStatusMsg
(
i18nc
(
"the application is currently idle, there is no active search"
,
"Idle."
)
);
mStatusBar
->
setItemAlignment
(
0
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
);
mStatusBar
->
insertPermanentItem
(
QString
(),
1
,
1
);
...
...
src/kfindtreeview.cpp
View file @
496cc35b
...
...
@@ -347,23 +347,23 @@ KFindTreeView::KFindTreeView( QWidget *parent, KfindDlg * findDialog )
m_actionCollection
->
addAssociatedWidget
(
this
);
QAction
*
open
=
KStandardAction
::
open
(
this
,
SLOT
(
slotExecuteSelected
()),
this
);
m_actionCollection
->
addAction
(
Q
Latin1
String
(
"file_open"
),
open
);
m_actionCollection
->
addAction
(
QString
Literal
(
"file_open"
),
open
);
QAction
*
copy
=
KStandardAction
::
copy
(
this
,
SLOT
(
copySelection
()),
this
);
m_actionCollection
->
addAction
(
Q
Latin1
String
(
"edit_copy"
),
copy
);
m_actionCollection
->
addAction
(
QString
Literal
(
"edit_copy"
),
copy
);
QAction
*
openFolder
=
new
QAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"window-new"
)),
i18n
(
"&Open containing folder(s)"
),
this
);
QAction
*
openFolder
=
new
QAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"window-new"
)),
i18n
(
"&Open containing folder(s)"
),
this
);
connect
(
openFolder
,
&
QAction
::
triggered
,
this
,
&
KFindTreeView
::
openContainingFolder
);
m_actionCollection
->
addAction
(
Q
Latin1
String
(
"openfolder"
),
openFolder
);
m_actionCollection
->
addAction
(
QString
Literal
(
"openfolder"
),
openFolder
);
QAction
*
del
=
new
QAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"edit-delete"
)),
i18n
(
"&Delete"
),
this
);
QAction
*
del
=
new
QAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"edit-delete"
)),
i18n
(
"&Delete"
),
this
);
connect
(
del
,
&
QAction
::
triggered
,
this
,
&
KFindTreeView
::
deleteSelectedFiles
);
m_actionCollection
->
setDefaultShortcut
(
del
,
Qt
::
SHIFT
+
Qt
::
Key_Delete
);
QAction
*
trash
=
new
QAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"user-trash"
)),
i18n
(
"&Move to Trash"
),
this
);
QAction
*
trash
=
new
QAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"user-trash"
)),
i18n
(
"&Move to Trash"
),
this
);
connect
(
trash
,
&
QAction
::
triggered
,
this
,
&
KFindTreeView
::
moveToTrashSelectedFiles
);
m_actionCollection
->
setDefaultShortcut
(
trash
,
Qt
::
Key_Delete
);
m_actionCollection
->
addAction
(
Q
Latin1
String
(
"trash"
),
trash
);
m_actionCollection
->
addAction
(
QString
Literal
(
"trash"
),
trash
);
header
()
->
setStretchLastSection
(
true
);
...
...
@@ -441,7 +441,7 @@ void KFindTreeView::saveResults()
KFileDialog
*
dlg
=
new
KFileDialog
(
QUrl
(),
QString
(),
this
);
dlg
->
setOperationMode
(
KFileDialog
::
Saving
);
dlg
->
setWindowTitle
(
i18nc
(
"@title:window"
,
"Save Results As"
)
);
dlg
->
setFilter
(
QString
::
fromLatin1
(
"*.html|%1
\n
*.txt|%2"
).
arg
(
i18n
(
"HTML page"
),
i18n
(
"Text file"
)
)
);
dlg
->
setFilter
(
QString
Literal
(
"*.html|%1
\n
*.txt|%2"
).
arg
(
i18n
(
"HTML page"
),
i18n
(
"Text file"
)
)
);
dlg
->
setConfirmOverwrite
(
true
);
dlg
->
exec
();
...
...
@@ -484,11 +484,11 @@ void KFindTreeView::saveResults()
Q_FOREACH
(
const
KFindItem
&
item
,
itemList
)
{
const
KFileItem
fileItem
=
item
.
getFileItem
();
stream
<<
QString
::
fromLatin1
(
"<dt><a href=
\"
%1
\"
>%2</a></dt>
\n
"
).
arg
(
stream
<<
QString
Literal
(
"<dt><a href=
\"
%1
\"
>%2</a></dt>
\n
"
).
arg
(
fileItem
.
url
().
url
(),
fileItem
.
url
().
toDisplayString
()
);
}
stream
<<
QString
::
fromLatin1
(
"</dl>
\n
</body>
\n
</html>
\n
"
);
stream
<<
QString
Literal
(
"</dl>
\n
</body>
\n
</html>
\n
"
);
}
else
{
...
...
@@ -563,11 +563,11 @@ void KFindTreeView::contextMenuRequested( const QPoint & p)
delete
m_contextMenu
;
m_contextMenu
=
new
QMenu
(
this
);
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
Q
Latin1
String
(
"file_open"
)));
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
Q
Latin1
String
(
"openfolder"
)));
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
Q
Latin1
String
(
"edit_copy"
)));
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
QString
Literal
(
"file_open"
)));
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
QString
Literal
(
"openfolder"
)));
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
QString
Literal
(
"edit_copy"
)));
//m_contextMenu->addAction(m_actionCollection->action(QLatin1String("del")));
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
Q
Latin1
String
(
"trash"
)));
m_contextMenu
->
addAction
(
m_actionCollection
->
action
(
QString
Literal
(
"trash"
)));
m_contextMenu
->
addSeparator
();
// Open With...
...
...
src/kftabdlg.cpp
View file @
496cc35b
...
...
@@ -69,14 +69,14 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
// ************ Page One ************
pages
[
0
]
=
new
QWidget
;
pages
[
0
]
->
setObjectName
(
Q
Latin1
String
(
"page1"
)
);
pages
[
0
]
->
setObjectName
(
QString
Literal
(
"page1"
)
);
nameBox
=
new
KComboBox
(
pages
[
0
]);
nameBox
->
setEditable
(
true
);
nameBox
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Fixed
);
// allow smaller than widest entry
QLabel
*
namedL
=
new
QLabel
(
i18nc
(
"this is the label for the name textfield"
,
"&Named:"
),
pages
[
0
]);
namedL
->
setBuddy
(
nameBox
);
namedL
->
setObjectName
(
Q
Latin1
String
(
"named"
)
);
namedL
->
setObjectName
(
QString
Literal
(
"named"
)
);
namedL
->
setToolTip
(
i18n
(
"You can use wildcard matching and
\"
;
\"
for separating multiple names"
)
);
dirBox
=
new
KUrlComboBox
(
KUrlComboBox
::
Directories
,
pages
[
0
]);
dirBox
->
setEditable
(
true
);
...
...
@@ -85,7 +85,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
dirBox
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Fixed
);
// allow smaller than widest entry
QLabel
*
lookinL
=
new
QLabel
(
i18n
(
"Look &in:"
),
pages
[
0
]);
lookinL
->
setBuddy
(
dirBox
);
lookinL
->
setObjectName
(
Q
Latin1
String
(
"lookin"
)
);
lookinL
->
setObjectName
(
QString
Literal
(
"lookin"
)
);
subdirsCb
=
new
QCheckBox
(
i18n
(
"Include &subfolders"
),
pages
[
0
]);
caseSensCb
=
new
QCheckBox
(
i18n
(
"Case s&ensitive search"
),
pages
[
0
]);
browseB
=
new
QPushButton
(
i18n
(
"&Browse..."
),
pages
[
0
]);
...
...
@@ -97,7 +97,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
caseSensCb
->
setChecked
(
false
);
useLocateCb
->
setChecked
(
false
);
hiddenFilesCb
->
setChecked
(
false
);
if
(
KStandardDirs
::
findExe
(
Q
Latin1
String
(
"locate"
)).
isEmpty
())
if
(
KStandardDirs
::
findExe
(
QString
Literal
(
"locate"
)).
isEmpty
())
useLocateCb
->
setEnabled
(
false
);
nameBox
->
setDuplicatesEnabled
(
false
);
...
...
@@ -173,16 +173,16 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
// ************ Page Two
pages
[
1
]
=
new
QWidget
;
pages
[
1
]
->
setObjectName
(
Q
Latin1
String
(
"page2"
)
);
pages
[
1
]
->
setObjectName
(
QString
Literal
(
"page2"
)
);
findCreated
=
new
QCheckBox
(
i18n
(
"Find all files created or &modified:"
),
pages
[
1
]);
bg
=
new
QButtonGroup
();
rb
[
0
]
=
new
QRadioButton
(
i18n
(
"&between"
),
pages
[
1
]
);
rb
[
1
]
=
new
QRadioButton
(
pages
[
1
]);
// text set in updateDateLabels
andL
=
new
QLabel
(
i18n
(
"and"
),
pages
[
1
]);
andL
->
setObjectName
(
Q
Latin1
String
(
"and"
)
);
andL
->
setObjectName
(
QString
Literal
(
"and"
)
);
betweenType
=
new
KComboBox
(
pages
[
1
]
);
betweenType
->
setObjectName
(
Q
Latin1
String
(
"comboBetweenType"
)
);
betweenType
->
setObjectName
(
QString
Literal
(
"comboBetweenType"
)
);
betweenType
->
addItems
(
QVector
<
QString
>
(
5
).
toList
());
// texts set in updateDateLabels
betweenType
->
setCurrentIndex
(
1
);
updateDateLabels
(
1
,
1
);
...
...
@@ -190,35 +190,35 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
const
QDate
dt
=
QDate
::
currentDate
().
addYears
(
-
1
);
fromDate
=
new
KDateComboBox
(
pages
[
1
]);
fromDate
->
setObjectName
(
Q
Latin1
String
(
"fromDate"
)
);
fromDate
->
setObjectName
(
QString
Literal
(
"fromDate"
)
);
fromDate
->
setDate
(
dt
);
toDate
=
new
KDateComboBox
(
pages
[
1
]
);
toDate
->
setObjectName
(
Q
Latin1
String
(
"toDate"
)
);
toDate
->
setObjectName
(
QString
Literal
(
"toDate"
)
);
timeBox
=
new
KIntSpinBox
(
pages
[
1
]
);
timeBox
->
setRange
(
1
,
60
);
timeBox
->
setSingleStep
(
1
);
timeBox
->
setObjectName
(
Q
Latin1
String
(
"timeBox"
)
);
timeBox
->
setObjectName
(
QString
Literal
(
"timeBox"
)
);
sizeBox
=
new
KComboBox
(
pages
[
1
]
);
sizeBox
->
setObjectName
(
Q
Latin1
String
(
"sizeBox"
)
);
sizeBox
->
setObjectName
(
QString
Literal
(
"sizeBox"
)
);
QLabel
*
sizeL
=
new
QLabel
(
i18n
(
"File &size is:"
),
pages
[
1
]);
sizeL
->
setBuddy
(
sizeBox
);
sizeEdit
=
new
KIntSpinBox
(
pages
[
1
]
);
sizeEdit
->
setRange
(
0
,
INT_MAX
);
sizeEdit
->
setSingleStep
(
1
);
sizeEdit
->
setObjectName
(
Q
Latin1
String
(
"sizeEdit"
)
);
sizeEdit
->
setObjectName
(
QString
Literal
(
"sizeEdit"
)
);
sizeEdit
->
setValue
(
1
);
sizeUnitBox
=
new
KComboBox
(
pages
[
1
]
);
sizeUnitBox
->
setObjectName
(
Q
Latin1
String
(
"sizeUnitBox"
)
);
sizeUnitBox
->
setObjectName
(
QString
Literal
(
"sizeUnitBox"
)
);
m_usernameBox
=
new
KComboBox
(
pages
[
1
]
);
m_usernameBox
->
setEditable
(
true
);
m_usernameBox
->
setObjectName
(
Q
Latin1
String
(
"m_combo1"
));
m_usernameBox
->
setObjectName
(
QString
Literal
(
"m_combo1"
));
QLabel
*
usernameLabel
=
new
QLabel
(
i18n
(
"Files owned by &user:"
),
pages
[
1
]);
usernameLabel
->
setBuddy
(
m_usernameBox
);
m_groupBox
=
new
KComboBox
(
pages
[
1
]
);
m_groupBox
->
setEditable
(
true
);
m_groupBox
->
setObjectName
(
Q
Latin1
String
(
"m_combo2"
)
);
m_groupBox
->
setObjectName
(
QString
Literal
(
"m_combo2"
)
);
QLabel
*
groupLabel
=
new
QLabel
(
i18n
(
"Owned by &group:"
),
pages
[
1
]);
groupLabel
->
setBuddy
(
m_groupBox
);
...
...
@@ -233,7 +233,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
sizeUnitBox
->
addItem
(
i18n
(
"GiB"
)
);
sizeUnitBox
->
setCurrentIndex
(
1
);
int
tmp
=
sizeEdit
->
fontMetrics
().
width
(
Q
Latin1
String
(
" 000000000 "
));
int
tmp
=
sizeEdit
->
fontMetrics
().
width
(
QString
Literal
(
" 000000000 "
));
sizeEdit
->
setMinimumSize
(
tmp
,
sizeEdit
->
sizeHint
().
height
());
m_usernameBox
->
setDuplicatesEnabled
(
false
);
...
...
@@ -292,16 +292,16 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
// ************ Page Three
pages
[
2
]
=
new
QWidget
;
pages
[
2
]
->
setObjectName
(
Q
Latin1
String
(
"page3"
)
);
pages
[
2
]
->
setObjectName
(
QString
Literal
(
"page3"
)
);
typeBox
=
new
KComboBox
(
pages
[
2
]
);
typeBox
->
setObjectName
(
Q
Latin1
String
(
"typeBox"
)
);
typeBox
->
setObjectName
(
QString
Literal
(
"typeBox"
)
);
typeBox
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Fixed
);
// allow smaller than widest entry
QLabel
*
typeL
=
new
QLabel
(
i18nc
(
"label for the file type combobox"
,
"File &type:"
),
pages
[
2
]
);
typeL
->
setBuddy
(
typeBox
);
textEdit
=
new
KLineEdit
(
pages
[
2
]);
textEdit
->
setClearButtonShown
(
true
);
textEdit
->
setObjectName
(
Q
Latin1
String
(
"textEdit"
)
);
textEdit
->
setObjectName
(
QString
Literal
(
"textEdit"
)
);
QLabel
*
textL
=
new
QLabel
(
i18n
(
"C&ontaining text:"
),
pages
[
2
]);
textL
->
setBuddy
(
textEdit
);
...
...
@@ -330,7 +330,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
if
(
!
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"KRegExpEditor/KRegExpEditor"
)).
isEmpty
()
)
{
// The editor is available, so lets use it.
editRegExp
=
new
QPushButton
(
i18n
(
"&Edit..."
),
pages
[
2
]);
editRegExp
->
setObjectName
(
Q
Latin1
String
(
"editRegExp"
)
);
editRegExp
->
setObjectName
(
QString
Literal
(
"editRegExp"
)
);
}
metainfokeyEdit
=
new
KLineEdit
(
pages
[
2
]);
...
...
@@ -375,7 +375,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
regexpContentCb
->
hide
();
// Layout
tmp
=
sizeEdit
->
fontMetrics
().
width
(
Q
Latin1
String
(
" 00000 "
));
tmp
=
sizeEdit
->
fontMetrics
().
width
(
QString
Literal
(
" 00000 "
));
sizeEdit
->
setMinimumSize
(
tmp
,
sizeEdit
->
sizeHint
().
height
());
QGridLayout
*
grid2
=
new
QGridLayout
(
pages
[
2
]
);
...
...
@@ -394,7 +394,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
grid2
->
addWidget
(
textMetaInfo
,
4
,
2
,
Qt
::
AlignHCenter
);
grid2
->
addWidget
(
metainfoEdit
,
4
,
3
);
metainfokeyEdit
->
setText
(
Q
Latin1
String
(
"*"
));
metainfokeyEdit
->
setText
(
QString
Literal
(
"*"
));
if
(
editRegExp
)
{
// The editor was available, so lets use it.
...
...
@@ -510,21 +510,21 @@ void KfindTabWidget::initSpecialMimeTypes()
void
KfindTabWidget
::
saveHistory
()
{
save_pattern
(
nameBox
,
Q
Latin1
String
(
"History"
),
Q
Latin1
String
(
"Patterns"
));
save_pattern
(
dirBox
,
Q
Latin1
String
(
"History"
),
Q
Latin1
String
(
"Directories"
));
save_pattern
(
nameBox
,
QString
Literal
(
"History"
),
QString
Literal
(
"Patterns"
));
save_pattern
(
dirBox
,
QString
Literal
(
"History"
),
QString
Literal
(
"Directories"
));
}
void
KfindTabWidget
::
loadHistory
()
{
// Load pattern history
KConfigGroup
conf
(
KSharedConfig
::
openConfig
(),
Q
Latin1
String
(
"History"
));
QStringList
sl
=
conf
.
readEntry
(
Q
Latin1
String
(
"Patterns"
),
QStringList
());
KConfigGroup
conf
(
KSharedConfig
::
openConfig
(),
QString
Literal
(
"History"
));
QStringList
sl
=
conf
.
readEntry
(
QString
Literal
(
"Patterns"
),
QStringList
());
if
(
!
sl
.
isEmpty
())
nameBox
->
addItems
(
sl
);
else
nameBox
->
addItem
(
Q
Latin1
String
(
"*"
));
nameBox
->
addItem
(
QString
Literal
(
"*"
));
sl
=
conf
.
readPathEntry
(
Q
Latin1
String
(
"Directories"
),
QStringList
());
sl
=
conf
.
readPathEntry
(
QString
Literal
(
"Directories"
),
QStringList
());
if
(
!
sl
.
isEmpty
())
{
dirBox
->
addItems
(
sl
);
// If the _searchPath already exists in the list we do not
...
...
@@ -556,7 +556,7 @@ void KfindTabWidget::loadHistory()
void
KfindTabWidget
::
slotEditRegExp
()
{
if
(
!
regExpDialog
)
regExpDialog
=
KServiceTypeTrader
::
createInstanceFromQuery
<
KDialog
>
(
Q
Latin1
String
(
"KRegExpEditor/KRegExpEditor"
),
QString
(),
this
);
regExpDialog
=
KServiceTypeTrader
::
createInstanceFromQuery
<
KDialog
>
(
QString
Literal
(
"KRegExpEditor/KRegExpEditor"
),
QString
(),
this
);
KRegExpEditorInterface
*
iface
=
qobject_cast
<
KRegExpEditorInterface
*>
(
regExpDialog
);
if
(
!
iface
)
...
...
@@ -654,7 +654,7 @@ void KfindTabWidget::setQuery(KQuery *query)
if
(
!
itemAlreadyContained
)
dirBox
->
addItem
(
dirBox
->
currentText
().
trimmed
(),
0
);
QString
regex
=
nameBox
->
currentText
().
isEmpty
()
?
Q
Latin1
String
(
"*"
)
:
nameBox
->
currentText
();
QString
regex
=
nameBox
->
currentText
().
isEmpty
()
?
QString
Literal
(
"*"
)
:
nameBox
->
currentText
();
query
->
setRegExp
(
regex
,
caseSensCb
->
isChecked
());
itemAlreadyContained
=
false
;
for
(
int
idx
=
0
;
idx
<
nameBox
->
count
();
idx
++
)
...
...
@@ -882,7 +882,7 @@ void KfindTabWidget::updateDateLabels(int type, int value)
QString
typeKey
(
type
==
0
?
QLatin1Char
(
'i'
)
:
type
==
1
?
QLatin1Char
(
'h'
)
:
type
==
2
?
QLatin1Char
(
'd'
)
:
type
==
3
?
QLatin1Char
(
'm'
)
:
QLatin1Char
(
'y'
));
rb
[
1
]
->
setText
(
ki18ncp
(
"during the previous minute(s)/hour(s)/...; "
"dynamic context 'type': 'i' minutes, 'h' hours, 'd' days, 'm' months, 'y' years"
,
"&during the previous"
,
"&during the previous"
).
subs
(
value
).
inContext
(
Q
Latin1
String
(
"type"
),
typeKey
).
toString
());
"&during the previous"
,
"&during the previous"
).
subs
(
value
).
inContext
(
QString
Literal
(
"type"
),
typeKey
).
toString
());
betweenType
->
setItemText
(
0
,
i18ncp
(
"use date ranges to search files by modified time"
,
"minute"
,
"minutes"
,
value
));
betweenType
->
setItemText
(
1
,
i18ncp
(
"use date ranges to search files by modified time"
,
"hour"
,
"hours"
,
value
));
betweenType
->
setItemText
(
2
,
i18ncp
(
"use date ranges to search files by modified time"
,
"day"
,
"days"
,
value
));
...
...
src/kquery.cpp
View file @
496cc35b
...
...
@@ -51,30 +51,30 @@ KQuery::KQuery(QObject *parent)
// Files with these mime types can be ignored, even if
// findFormatByFileContent() in some cases may claim that
// these are text files:
ignore_mimetypes
.
append
(
Q
Latin1
String
(
"application/pdf"
));
ignore_mimetypes
.
append
(
Q
Latin1
String
(
"application/postscript"
));
ignore_mimetypes
.
append
(
QString
Literal
(
"application/pdf"
));
ignore_mimetypes
.
append
(
QString
Literal
(
"application/postscript"
));
// PLEASE update the documentation when you add another
// file type here:
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.sun.xml.writer"
));
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.sun.xml.calc"
));
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.sun.xml.impress"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.sun.xml.writer"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.sun.xml.calc"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.sun.xml.impress"
));
// OASIS mimetypes, used by OOo-2.x and KOffice >= 1.4
//ooo_mimetypes.append("application/vnd.oasis.opendocument.chart");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.graphics");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.graphics-template");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.formula");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.image");
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.oasis.opendocument.presentation-template"
));
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.oasis.opendocument.presentation"
));
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.oasis.opendocument.spreadsheet-template"
));
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.oasis.opendocument.spreadsheet"
));
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.oasis.opendocument.text-template"
));
ooo_mimetypes
.
append
(
Q
Latin1
String
(
"application/vnd.oasis.opendocument.text"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.oasis.opendocument.presentation-template"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.oasis.opendocument.presentation"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.oasis.opendocument.spreadsheet-template"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.oasis.opendocument.spreadsheet"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.oasis.opendocument.text-template"
));
ooo_mimetypes
.
append
(
QString
Literal
(
"application/vnd.oasis.opendocument.text"
));
// KOffice-1.3 mimetypes
koffice_mimetypes
.
append
(
Q
Latin1
String
(
"application/x-kword"
));
koffice_mimetypes
.
append
(
Q
Latin1
String
(
"application/x-kspread"
));
koffice_mimetypes
.
append
(
Q
Latin1
String
(
"application/x-kpresenter"
));
koffice_mimetypes
.
append
(
QString
Literal
(
"application/x-kword"
));
koffice_mimetypes
.
append
(
QString
Literal
(
"application/x-kspread"
));
koffice_mimetypes
.
append
(
QString
Literal
(
"application/x-kpresenter"
));
}
KQuery
::~
KQuery
()
...
...
@@ -109,7 +109,7 @@ void KQuery::start()
m_url
=
m_url
.
adjusted
(
QUrl
::
NormalizePathSegments
);
processLocate
->
clearProgram
();
processLocate
->
setProgram
(
Q
Latin1
String
(
"locate"
),
QStringList
()
<<
m_url
.
toLocalFile
()
);
processLocate
->
setProgram
(
QString
Literal
(
"locate"
),
QStringList
()
<<
m_url
.
toLocalFile
()
);
processLocate
->
setOutputChannelMode
(
KProcess
::
SeparateChannels
);
processLocate
->
start
();
...
...
@@ -376,9 +376,9 @@ void KQuery::processQuery( const KFileItem &file)
const
KArchiveDirectory
*
zipfileContent
=
zipfile
.
directory
();
if
(
koffice_mimetypes
.
indexOf
(
file
.
mimetype
())
!=
-
1
)
zipfileEntry
=
(
KZipFileEntry
*
)
zipfileContent
->
entry
(
Q
Latin1
String
(
"maindoc.xml"
));
zipfileEntry
=
(
KZipFileEntry
*
)
zipfileContent
->
entry
(
QString
Literal
(
"maindoc.xml"
));
else
zipfileEntry
=
(
KZipFileEntry
*
)
zipfileContent
->
entry
(
Q
Latin1
String
(
"content.xml"
));
//for OpenOffice.org
zipfileEntry
=
(
KZipFileEntry
*
)
zipfileContent
->
entry
(
QString
Literal
(
"content.xml"
));
//for OpenOffice.org
if
(
!
zipfileEntry
)
{
qWarning
()
<<
"Expected XML file not found in ZIP archive "
<<
file
.
url
()
;
...
...
@@ -386,7 +386,7 @@ void KQuery::processQuery( const KFileItem &file)
}
zippedXmlFileContent
=
zipfileEntry
->
data
();
xmlTags
.
setPattern
(
Q
Latin1
String
(
"<.*>"
));
xmlTags
.
setPattern
(
QString
Literal
(
"<.*>"
));
xmlTags
.
setMinimal
(
true
);
stream
=
new
QTextStream
(
zippedXmlFileContent
,
QIODevice
::
ReadOnly
);
stream
->
setCodec
(
"UTF-8"
);
...
...
src/main.cpp
View file @
496cc35b
...
...
@@ -39,26 +39,26 @@ int main( int argc, char ** argv )
migrate
.
migrate
();
KLocalizedString
::
setApplicationDomain
(
"kfind"
);
KAboutData
aboutData
(
Q
Latin1
String
(
"kfind"
),
i18n
(
"KFind"
),
Q
Latin1
String
(
KFIND_VERSION_STRING
),
i18n
(
"KDE file find utility"
),
KAboutLicense
::
GPL
,
KAboutData
aboutData
(
QString
Literal
(
"kfind"
),
i18n
(
"KFind"
),
QString
Literal
(
KFIND_VERSION_STRING
),
i18n
(
"KDE file find utility"
),
KAboutLicense
::
GPL
,
i18n
(
"(c) 1998-2017, The KDE Developers"
));
aboutData
.
addAuthor
(
i18n
(
"Kai-Uwe Broulik"
),
i18n
(
"Current Maintainer"
),
Q
Latin1
String
(
"kde@privat.broulik.de"
));
aboutData
.
addAuthor
(
i18n
(
"Eric Coquelle"
),
i18n
(
"Former Maintainer"
),
Q
Latin1
String
(
"coquelle@caramail.com"
));
aboutData
.
addAuthor
(
i18n
(
"Mark W. Webb"
),
i18n
(
"Developer"
),
Q
Latin1
String
(
"markwebb@adelphia.net"
));
aboutData
.
addAuthor
(
i18n
(
"Beppe Grimaldi"
),
i18n
(
"UI Design & more search options"
),
Q
Latin1
String
(
"grimalkin@ciaoweb.it"
));
aboutData
.
addAuthor
(
i18n
(
"Kai-Uwe Broulik"
),
i18n
(
"Current Maintainer"
),
QString
Literal
(
"kde@privat.broulik.de"
));
aboutData
.
addAuthor
(
i18n
(
"Eric Coquelle"
),
i18n
(
"Former Maintainer"
),
QString
Literal
(
"coquelle@caramail.com"
));
aboutData
.
addAuthor
(
i18n
(
"Mark W. Webb"
),
i18n
(
"Developer"
),
QString
Literal
(
"markwebb@adelphia.net"
));
aboutData
.
addAuthor
(
i18n
(
"Beppe Grimaldi"
),
i18n
(
"UI Design & more search options"
),
QString
Literal
(
"grimalkin@ciaoweb.it"
));
aboutData
.
addAuthor
(
i18n
(
"Martin Hartig"
));
aboutData
.
addAuthor
(
i18n
(
"Stephan Kulow"
),
QString
(),
Q
Latin1
String
(
"coolo@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Mario Weilguni"
),
QString
(),
Q
Latin1
String
(
"mweilguni@sime.com"
));
aboutData
.
addAuthor
(
i18n
(
"Alex Zepeda"
),
QString
(),
Q
Latin1
String
(
"zipzippy@sonic.net"
));
aboutData
.
addAuthor
(
i18n
(
"Miroslav Flídr"
),
QString
(),
Q
Latin1
String
(
"flidr@kky.zcu.cz"
));
aboutData
.
addAuthor
(
i18n
(
"Harri Porten"
),
QString
(),
Q
Latin1
String
(
"porten@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Dima Rogozin"
),
QString
(),
Q
Latin1
String
(
"dima@mercury.co.il"
));
aboutData
.
addAuthor
(
i18n
(
"Carsten Pfeiffer"
),
QString
(),
Q
Latin1
String
(
"pfeiffer@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Hans Petter Bieker"
),
QString
(),
Q
Latin1
String
(
"bieker@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Waldo Bastian"
),
i18n
(
"UI Design"
),
Q
Latin1
String
(
"bastian@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Alexander Neundorf"
),
QString
(),
Q
Latin1
String
(
"neundorf@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Clarence Dang"
),
QString
(),
Q
Latin1
String
(
"dang@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Stephan Kulow"
),
QString
(),
QString
Literal
(
"coolo@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Mario Weilguni"
),
QString
(),
QString
Literal
(
"mweilguni@sime.com"
));
aboutData
.
addAuthor
(
i18n
(
"Alex Zepeda"
),
QString
(),
QString
Literal
(
"zipzippy@sonic.net"
));
aboutData
.
addAuthor
(
i18n
(
"Miroslav Flídr"
),
QString
(),
QString
Literal
(
"flidr@kky.zcu.cz"
));
aboutData
.
addAuthor
(
i18n
(
"Harri Porten"
),
QString
(),
QString
Literal
(
"porten@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Dima Rogozin"
),
QString
(),
QString
Literal
(
"dima@mercury.co.il"
));
aboutData
.
addAuthor
(
i18n
(
"Carsten Pfeiffer"
),
QString
(),
QString
Literal
(
"pfeiffer@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Hans Petter Bieker"
),
QString
(),
QString
Literal
(
"bieker@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Waldo Bastian"
),
i18n
(
"UI Design"
),
QString
Literal
(
"bastian@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Alexander Neundorf"
),
QString
(),
QString
Literal
(
"neundorf@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Clarence Dang"
),
QString
(),
QString
Literal
(
"dang@kde.org"
));
aboutData
.
setTranslator
(
i18nc
(
"NAME OF TRANSLATORS"
,
"Your names"
),
i18nc
(
"EMAIL OF TRANSLATORS"
,
"Your emails"
));
// enable high dpi support
app
.
setAttribute
(
Qt
::
AA_UseHighDpiPixmaps
,
true
);
...
...
@@ -67,7 +67,7 @@ int main( int argc, char ** argv )
KAboutData
::
setApplicationData
(
aboutData
);
parser
.
addVersionOption
();
parser
.
addHelpOption
();
parser
.
addOption
(
QCommandLineOption
(
QStringList
()
<<
Q
Latin1
String
(
"+[searchpath]"
),
i18n
(
"Path(s) to search"
)));
parser
.
addOption
(
QCommandLineOption
(
QStringList
()
<<
QString
Literal
(
"+[searchpath]"
),
i18n
(
"Path(s) to search"
)));
aboutData
.
setupCommandLine
(
&
parser
);
parser
.
process
(
app
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment