kget
bittorrentsettings.h
Go to the documentation of this file.00001
00002
00003 #ifndef BITTORRENTSETTINGS_H
00004 #define BITTORRENTSETTINGS_H
00005
00006 #include <kconfigskeleton.h>
00007 #include <kdebug.h>
00008
00009 class KDE_EXPORT BittorrentSettings : public KConfigSkeleton
00010 {
00011 public:
00012
00013 static BittorrentSettings *self();
00014 ~BittorrentSettings();
00015
00019 static
00020 void setUploadLimit( int v )
00021 {
00022 if (!self()->isImmutable( QString::fromLatin1 ( "UploadLimit" ) ))
00023 self()->mUploadLimit = v;
00024 }
00025
00029 static
00030 int uploadLimit()
00031 {
00032 return self()->mUploadLimit;
00033 }
00034
00038 static
00039 void setDownloadLimit( int v )
00040 {
00041 if (!self()->isImmutable( QString::fromLatin1 ( "DownloadLimit" ) ))
00042 self()->mDownloadLimit = v;
00043 }
00044
00048 static
00049 int downloadLimit()
00050 {
00051 return self()->mDownloadLimit;
00052 }
00053
00057 static
00058 void setPort( int v )
00059 {
00060 if (!self()->isImmutable( QString::fromLatin1 ( "Port" ) ))
00061 self()->mPort = v;
00062 }
00063
00067 static
00068 int port()
00069 {
00070 return self()->mPort;
00071 }
00072
00076 static
00077 void setMaxShareRatio( double v )
00078 {
00079 if (!self()->isImmutable( QString::fromLatin1 ( "MaxShareRatio" ) ))
00080 self()->mMaxShareRatio = v;
00081 }
00082
00086 static
00087 double maxShareRatio()
00088 {
00089 return self()->mMaxShareRatio;
00090 }
00091
00095 static
00096 void setTorrentDir( const QString & v )
00097 {
00098 if (!self()->isImmutable( QString::fromLatin1 ( "TorrentDir" ) ))
00099 self()->mTorrentDir = v;
00100 }
00101
00105 static
00106 QString torrentDir()
00107 {
00108 return self()->mTorrentDir;
00109 }
00110
00114 static
00115 void setTmpDir( const QString & v )
00116 {
00117 if (!self()->isImmutable( QString::fromLatin1 ( "TmpDir" ) ))
00118 self()->mTmpDir = v;
00119 }
00120
00124 static
00125 QString tmpDir()
00126 {
00127 return self()->mTmpDir;
00128 }
00129
00133 static
00134 void setPreAlloc( bool v )
00135 {
00136 if (!self()->isImmutable( QString::fromLatin1 ( "PreAlloc" ) ))
00137 self()->mPreAlloc = v;
00138 }
00139
00143 static
00144 bool preAlloc()
00145 {
00146 return self()->mPreAlloc;
00147 }
00148
00152 static
00153 void setFileColumnWidths( const QList<int> & v )
00154 {
00155 if (!self()->isImmutable( QString::fromLatin1 ( "FileColumnWidths" ) ))
00156 self()->mFileColumnWidths = v;
00157 }
00158
00162 static
00163 QList<int> fileColumnWidths()
00164 {
00165 return self()->mFileColumnWidths;
00166 }
00167
00171 static
00172 void setPeersColumnWidths( const QList<int> & v )
00173 {
00174 if (!self()->isImmutable( QString::fromLatin1 ( "PeersColumnWidths" ) ))
00175 self()->mPeersColumnWidths = v;
00176 }
00177
00181 static
00182 QList<int> peersColumnWidths()
00183 {
00184 return self()->mPeersColumnWidths;
00185 }
00186
00190 static
00191 void setChunksColumnWidths( const QList<int> & v )
00192 {
00193 if (!self()->isImmutable( QString::fromLatin1 ( "ChunksColumnWidths" ) ))
00194 self()->mChunksColumnWidths = v;
00195 }
00196
00200 static
00201 QList<int> chunksColumnWidths()
00202 {
00203 return self()->mChunksColumnWidths;
00204 }
00205
00206 protected:
00207 BittorrentSettings();
00208 friend class BittorrentSettingsHelper;
00209
00210
00211
00212 int mUploadLimit;
00213 int mDownloadLimit;
00214 int mPort;
00215 double mMaxShareRatio;
00216
00217
00218 QString mTorrentDir;
00219 QString mTmpDir;
00220 bool mPreAlloc;
00221
00222
00223 QList<int> mFileColumnWidths;
00224 QList<int> mPeersColumnWidths;
00225 QList<int> mChunksColumnWidths;
00226
00227 private:
00228 };
00229
00230 #endif
00231