-rw-r--r-- | libopie2/opieui/fileselector/ofiledialog.cpp | 4 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 56 |
2 files changed, 26 insertions, 34 deletions
diff --git a/libopie2/opieui/fileselector/ofiledialog.cpp b/libopie2/opieui/fileselector/ofiledialog.cpp index 2d38961..11a9e33 100644 --- a/libopie2/opieui/fileselector/ofiledialog.cpp +++ b/libopie2/opieui/fileselector/ofiledialog.cpp | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (C) Holger Freyther <freyther@handhelds.org> | 3 | .=l. Copyright (C) Holger Freyther <freyther@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; version 2 of the License. |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 02404e5..5b5dc2f 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -1,40 +1,38 @@ | |||
1 | /* | 1 | /* |
2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project | 2 | =. This file is part of the OPIE Project |
3 | 3 | .=l. Copyright (C) Holger Freyther <freyther@handhelds.org> | |
4 | Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> | 4 | .>+-= |
5 | =. | 5 | _;:, .> :=|. This library is free software; you can |
6 | .=l. | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | Â Â Â Â Â Â .>+-= | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under | 9 | - . .-<_> .<> Foundation; version 2 of the License. |
10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public | 10 | ._= =} : |
11 | .="- .-=="i, Â Â .._ License as published by the Free Software | 11 | .%`+i> _;_. |
12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | Â Â .%`+i> Â Â Â _;_. | 14 | : .. .:, . . . without even the implied warranty of |
15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | : .. Â Â .:, Â Â . . . without even the implied warranty of | 17 | ..}^=.= = ; Library General Public License for more |
18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | ++= -. .` .: details. |
19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU | 19 | : = ...= . :.=- |
20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | ++= Â -. Â Â .` Â Â .: details. | 21 | -_. . . )=. = Library General Public License along with |
22 | : Â Â = Â ...= . :.=- | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU | ||
24 | Â -_. . . Â )=. Â = Library General Public License along with | ||
25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | |||
29 | */ | 27 | */ |
30 | 28 | ||
31 | /* hacky but we need to get FileSelector::filter */ | 29 | /* hacky but we need to get FileSelector::filter */ |
32 | #define private public | 30 | #define private public |
33 | #include <qpe/fileselector.h> | 31 | #include <qpe/fileselector.h> |
34 | #undef private | 32 | #undef private |
35 | 33 | ||
36 | #include "ofileselector_p.h" | 34 | #include "ofileselector_p.h" |
37 | 35 | ||
38 | /* OPIE */ | 36 | /* OPIE */ |
39 | #include <opie2/odebug.h> | 37 | #include <opie2/odebug.h> |
40 | #include <opie2/ofileselector.h> | 38 | #include <opie2/ofileselector.h> |
@@ -622,43 +620,37 @@ void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const | |||
622 | } | 620 | } |
623 | } // not locked | 621 | } // not locked |
624 | } | 622 | } |
625 | 623 | ||
626 | void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) | 624 | void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) |
627 | { | 625 | { |
628 | MimeType type( info->absFilePath() ); | 626 | MimeType type( info->absFilePath() ); |
629 | if (!compliesMime( type.id() ) ) | 627 | if (!compliesMime( type.id() ) ) |
630 | return; | 628 | return; |
631 | 629 | ||
632 | QPixmap pix = type.pixmap(); | 630 | QPixmap pix = type.pixmap(); |
633 | QString dir, name; bool locked; | 631 | QString dir, name; bool locked; |
634 | if ( pix.isNull() ) | 632 | if ( pix.isNull() ) pix = Opie::Core::OResource::loadPixmap( "UnknownDocument", Opie::Core::OResource::SmallIcon ); |
635 | { | ||
636 | QWMatrix matrix; | ||
637 | QPixmap pixer( Opie::Core::OResource::loadPixmap( "UnknownDocument" ) ); | ||
638 | matrix.scale( .4, .4 ); | ||
639 | pix = pixer.xForm( matrix ); | ||
640 | } | ||
641 | dir = info->dirPath( true ); | 633 | dir = info->dirPath( true ); |
642 | locked = false; | 634 | locked = false; |
643 | if ( symlink ) | 635 | if ( symlink ) |
644 | name = info->fileName() + " -> " + createNewPath(info->dirPath(),info->readLink()); | 636 | name = info->fileName() + " -> " + createNewPath(info->dirPath(),info->readLink()); |
645 | else | 637 | else |
646 | { | 638 | { |
647 | name = info->fileName(); | 639 | name = info->fileName(); |
648 | if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || | 640 | if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || |
649 | ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) | 641 | ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) |
650 | { | 642 | { |
651 | locked = true; | 643 | locked = true; |
652 | pix = Opie::Core::OResource::loadPixmap( "locked" ); | 644 | pix = Opie::Core::OResource::loadPixmap( "locked", Opie::Core::OResource::SmallIcon ); |
653 | } | 645 | } |
654 | } | 646 | } |
655 | (void)new OFileSelectorItem( m_view, pix, name, | 647 | (void)new OFileSelectorItem( m_view, pix, name, |
656 | info->lastModified().toString(), QString::number( info->size() ), | 648 | info->lastModified().toString(), QString::number( info->size() ), |
657 | dir, locked ); | 649 | dir, locked ); |
658 | } | 650 | } |
659 | 651 | ||
660 | void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) | 652 | void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) |
661 | { | 653 | { |
662 | bool locked = false; QString name; QPixmap pix; | 654 | bool locked = false; QString name; QPixmap pix; |
663 | 655 | ||
664 | if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || | 656 | if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || |