author | ar <ar> | 2004-05-02 17:04:41 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-02 17:04:41 (UTC) |
commit | 4d3379027557e251201b531896974a69ae4c665a (patch) (unidiff) | |
tree | 6e813be1aa29131f8f8e91f532f38f8a381e38f4 /core/multimedia/opieplayer/modplug | |
parent | f8add41b2e0b0371754521b44d95f87fa70a6ff2 (diff) | |
download | opie-4d3379027557e251201b531896974a69ae4c665a.zip opie-4d3379027557e251201b531896974a69ae4c665a.tar.gz opie-4d3379027557e251201b531896974a69ae4c665a.tar.bz2 |
- convert qDebug to odebug
Diffstat (limited to 'core/multimedia/opieplayer/modplug') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/modplug/memfile.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/core/multimedia/opieplayer/modplug/memfile.cpp b/core/multimedia/opieplayer/modplug/memfile.cpp index 8a29997..cd243c7 100644 --- a/core/multimedia/opieplayer/modplug/memfile.cpp +++ b/core/multimedia/opieplayer/modplug/memfile.cpp | |||
@@ -10,24 +10,28 @@ | |||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | General Public License for more details. | 12 | General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
15 | along with this program; see the file COPYING. If not, write to | 15 | along with this program; see the file COPYING. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "memfile.h" | 20 | #include "memfile.h" |
21 | 21 | ||
22 | /* OPIE */ | ||
23 | #include <opie2/odebug.h> | ||
24 | |||
25 | /* STD */ | ||
22 | #include <unistd.h> | 26 | #include <unistd.h> |
23 | #include <sys/mman.h> | 27 | #include <sys/mman.h> |
24 | 28 | ||
25 | MemFile::MemFile() | 29 | MemFile::MemFile() |
26 | { | 30 | { |
27 | } | 31 | } |
28 | 32 | ||
29 | MemFile::MemFile( const QString &name ) | 33 | MemFile::MemFile( const QString &name ) |
30 | : QFile( name ) | 34 | : QFile( name ) |
31 | { | 35 | { |
32 | } | 36 | } |
33 | 37 | ||
@@ -38,39 +42,39 @@ MemFile::~MemFile() | |||
38 | 42 | ||
39 | void MemFile::close() | 43 | void MemFile::close() |
40 | { | 44 | { |
41 | unmap(); | 45 | unmap(); |
42 | QFile::close(); | 46 | QFile::close(); |
43 | } | 47 | } |
44 | 48 | ||
45 | void MemFile::unmap() | 49 | void MemFile::unmap() |
46 | { | 50 | { |
47 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) | 51 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) |
48 | if ( m_data.data() ) | 52 | if ( m_data.data() ) |
49 | { | 53 | { |
50 | munmap( m_data.data(), m_data.size() ); | 54 | munmap( m_data.data(), m_data.size() ); |
51 | m_data.resetRawData( m_data.data(), m_data.size() ); | 55 | m_data.resetRawData( m_data.data(), m_data.size() ); |
52 | } | 56 | } |
53 | #endif | 57 | #endif |
54 | } | 58 | } |
55 | 59 | ||
56 | QByteArray &MemFile::data() | 60 | QByteArray &MemFile::data() |
57 | { | 61 | { |
58 | if ( !m_data.data() ) | 62 | if ( !m_data.data() ) |
59 | { | 63 | { |
60 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) | 64 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) |
61 | const char *rawData = (const char *)mmap( 0, size(), PROT_READ, | 65 | const char *rawData = (const char *)mmap( 0, size(), PROT_READ, |
62 | MAP_SHARED, handle(), 0 ); | 66 | MAP_SHARED, handle(), 0 ); |
63 | if ( rawData ) | 67 | if ( rawData ) |
64 | { | 68 | { |
65 | m_data.setRawData( rawData, size() ); | 69 | m_data.setRawData( rawData, size() ); |
66 | return m_data; | 70 | return m_data; |
67 | } | 71 | } |
68 | else | 72 | else |
69 | qDebug( "MemFile: mmap() failed!" ); | 73 | odebug << "MemFile: mmap() failed!" << oendl; |
70 | // fallback | 74 | // fallback |
71 | #endif | 75 | #endif |
72 | m_data = readAll(); | 76 | m_data = readAll(); |
73 | } | 77 | } |
74 | return m_data; | 78 | return m_data; |
75 | } | 79 | } |
76 | 80 | ||