Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
745739d2
Commit
745739d2
authored
Jan 29, 2009
by
Olli Werwolff
Browse files
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
parents
566b312c
42b7107e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/shared/qrceditor/qrceditor.cpp
View file @
745739d2
...
...
@@ -96,8 +96,6 @@ QrcEditor::QrcEditor(QWidget *parent)
connect
(
&
m_history
,
SIGNAL
(
canRedoChanged
(
bool
)),
this
,
SLOT
(
updateHistoryControls
()));
connect
(
&
m_history
,
SIGNAL
(
canUndoChanged
(
bool
)),
this
,
SLOT
(
updateHistoryControls
()));
connect
(
&
m_history
,
SIGNAL
(
canRedoChanged
(
bool
)),
this
,
SLOT
(
updateCurrent
()));
connect
(
&
m_history
,
SIGNAL
(
canUndoChanged
(
bool
)),
this
,
SLOT
(
updateCurrent
()));
updateHistoryControls
();
updateCurrent
();
}
...
...
@@ -151,28 +149,21 @@ void QrcEditor::updateCurrent()
const
bool
isValid
=
m_treeview
->
currentIndex
().
isValid
();
const
bool
isPrefix
=
m_treeview
->
isPrefix
(
m_treeview
->
currentIndex
())
&&
isValid
;
const
bool
isFile
=
!
isPrefix
&&
isValid
;
int
cursorPosition
;
m_ui
.
aliasLabel
->
setEnabled
(
isFile
);
m_ui
.
aliasText
->
setEnabled
(
isFile
);
m_currentAlias
=
m_treeview
->
currentAlias
();
cursorPosition
=
m_ui
.
aliasText
->
cursorPosition
();
m_ui
.
aliasText
->
setText
(
m_currentAlias
);
m_ui
.
aliasText
->
setCursorPosition
(
cursorPosition
);
m_ui
.
prefixLabel
->
setEnabled
(
isPrefix
);
m_ui
.
prefixText
->
setEnabled
(
isPrefix
);
m_currentPrefix
=
m_treeview
->
currentPrefix
();
cursorPosition
=
m_ui
.
prefixText
->
cursorPosition
();
m_ui
.
prefixText
->
setText
(
m_currentPrefix
);
m_ui
.
prefixText
->
setCursorPosition
(
cursorPosition
);
m_ui
.
languageLabel
->
setEnabled
(
isPrefix
);
m_ui
.
languageText
->
setEnabled
(
isPrefix
);
m_currentLanguage
=
m_treeview
->
currentLanguage
();
cursorPosition
=
m_ui
.
languageText
->
cursorPosition
();
m_ui
.
languageText
->
setText
(
m_currentLanguage
);
m_ui
.
languageText
->
setCursorPosition
(
cursorPosition
);
m_ui
.
addButton
->
setEnabled
(
true
);
m_addFileAction
->
setEnabled
(
isValid
);
...
...
src/shared/qrceditor/resourcefile.cpp
View file @
745739d2
...
...
@@ -61,7 +61,7 @@ namespace qdesigner_internal {
bool
FileList
::
containsFile
(
File
*
file
)
{
foreach
(
File
*
tmpFile
,
*
this
)
foreach
(
const
File
*
tmpFile
,
*
this
)
if
(
tmpFile
->
name
==
file
->
name
&&
tmpFile
->
prefix
()
==
file
->
prefix
())
return
true
;
return
false
;
...
...
@@ -168,7 +168,7 @@ bool ResourceFile::save()
foreach
(
const
QString
&
name
,
name_list
)
{
FileList
file_list
;
QString
lang
;
foreach
(
Prefix
*
pref
,
m_prefix_list
)
{
foreach
(
const
Prefix
*
pref
,
m_prefix_list
)
{
if
(
pref
->
name
==
name
){
file_list
+=
pref
->
file_list
;
lang
=
pref
->
lang
;
...
...
@@ -599,7 +599,7 @@ bool ResourceModel::iconFileExtension(const QString &path)
}
}
foreach
(
QString
ext
,
ext_list
)
{
foreach
(
const
QString
&
ext
,
ext_list
)
{
if
(
path
.
endsWith
(
ext
,
Qt
::
CaseInsensitive
))
return
true
;
}
...
...
@@ -669,10 +669,9 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
QString
stringRes
=
conv_file
.
replace
(
QDir
::
separator
(),
QLatin1Char
(
'/'
));
const
QString
&
alias_file
=
file
->
alias
;
if
(
!
alias_file
.
isEmpty
())
appendParenthesized
(
alias_file
,
stringRes
);
appendParenthesized
(
alias_file
,
stringRes
);
result
=
stringRes
;
result
=
"Qt::ToolTipRole "
+
stringRes
;
}
break
;
...
...
@@ -690,14 +689,14 @@ void ResourceModel::getItem(const QModelIndex &index, QString &prefix, QString &
if
(
!
index
.
isValid
())
return
;
void
*
const
internalPointer
=
index
.
internalPointer
();
Node
*
const
node
=
reinterpret_cast
<
Node
*>
(
internalPointer
);
Prefix
*
const
p
=
node
->
prefix
();
const
void
*
internalPointer
=
index
.
internalPointer
();
const
Node
*
node
=
reinterpret_cast
<
const
Node
*>
(
internalPointer
);
const
Prefix
*
p
=
node
->
prefix
();
Q_ASSERT
(
p
);
bool
const
isFileNode
=
(
p
!=
node
);
const
bool
isFileNode
=
(
p
!=
node
);
if
(
isFileNode
)
{
File
*
const
f
=
node
->
file
();
const
File
*
f
=
node
->
file
();
Q_ASSERT
(
f
);
if
(
!
f
->
alias
.
isEmpty
())
file
=
f
->
alias
;
...
...
@@ -810,7 +809,7 @@ void ResourceModel::addFiles(int prefixIndex, const QStringList &fileNames, int
const
int
prefix_idx
=
prefixIndex
;
QStringList
unique_list
;
foreach
(
QString
file
,
file_list
)
{
foreach
(
const
QString
&
file
,
file_list
)
{
if
(
!
m_resource_file
.
contains
(
prefix_idx
,
file
)
&&
!
unique_list
.
contains
(
file
))
unique_list
.
append
(
file
);
}
...
...
@@ -821,7 +820,7 @@ void ResourceModel::addFiles(int prefixIndex, const QStringList &fileNames, int
const
int
cnt
=
m_resource_file
.
fileCount
(
prefix_idx
);
beginInsertRows
(
prefix_model_idx
,
cnt
,
cnt
+
unique_list
.
count
()
-
1
);
// ### FIXME
foreach
(
QString
file
,
unique_list
)
foreach
(
const
QString
&
file
,
unique_list
)
m_resource_file
.
addFile
(
prefix_idx
,
file
);
const
QFileInfo
fi
(
file_list
.
last
());
...
...
src/shared/qrceditor/resourcefile_p.h
View file @
745739d2
...
...
@@ -69,8 +69,8 @@ protected:
Q_ASSERT
(
m_prefix
);
}
public:
File
*
file
()
{
return
m_file
;
}
Prefix
*
prefix
()
{
return
m_prefix
;
}
File
*
file
()
const
{
return
m_file
;
}
Prefix
*
prefix
()
const
{
return
m_prefix
;
}
private:
File
*
m_file
;
Prefix
*
m_prefix
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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