SymbolEditor  1.3.0
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
Exceptions.cpp
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2011 by Stephen Allewell *
3  * sallewell@users.sourceforge.net *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  ********************************************************************************/
10 
11 
34 #include "Exceptions.h"
35 
36 #include <KLocale>
37 
38 
43 {
44 }
45 
46 
51 {
52 }
53 
54 
61  : version(v)
62 {
63 }
64 
65 
70 {
71 }
72 
73 
79 FailedReadLibrary::FailedReadLibrary(QDataStream::Status status)
80  : m_status(status)
81 {
82 }
83 
84 
89 {
90 }
91 
92 
99 {
100  if (m_status == QDataStream::ReadPastEnd) {
101  return QString(i18n("Tried to read past the end of the data"));
102  }
103 
104  if (m_status == QDataStream::ReadCorruptData) {
105  return QString(i18n("Tried to read corrupted data"));
106  }
107 
108  return QString(i18n("Undefined status message status %1", m_status));
109 }
110 
111 
117 FailedWriteLibrary::FailedWriteLibrary(QDataStream::Status status)
118  : m_status(status)
119 {
120 }
121 
122 
127 {
128 }
129 
130 
137 {
138 #if QT_VERSION >= 0x040800
139 
140  if (m_status == QDataStream::WriteFailed) {
141  return QString(i18n("Failed to write to the device"));
142  }
143 
144 #endif
145 
146  return QString(i18n("Undefined status message status %1", m_status));
147 }
148 
149 
156  : version(v)
157 {
158 }
159 
160 
165 {
166 }