-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileproperties.cpp
41 lines (36 loc) · 935 Bytes
/
fileproperties.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "fileproperties.h"
#include "db/collection.h"
Meow::FileProperties::FileProperties(
const QList<File> &files, Collection *collection,
QWidget *parent
)
: KPropertiesDialog(makeItems(files), parent)
, mFiles(files), collection(collection)
{
connect(this, SIGNAL(propertiesClosed()), SLOT(deleteLater()));
connect(this, SIGNAL(applied()), SLOT(modified()));
show();
}
void Meow::FileProperties::modified()
{
// TODO reload the file's info
for (QList<File>::iterator i(mFiles.begin()); i != mFiles.end(); ++i)
{
collection->reload(*i);
}
}
KFileItemList Meow::FileProperties::makeItems(const QList<File> &files)
{
KFileItemList kl;
for (QList<File>::const_iterator i(files.begin()); i != files.end(); ++i)
{
const File &f = *i;
kl.append(KFileItem(
f.file(),
KMimeType::findByPath(f.file())->name(),
KFileItem::Unknown
));
}
return kl;
}
// kate: space-indent off; replace-tabs off;