Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 9eba23e..7c6d314 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -35,98 +35,98 @@ protected: | |||
35 | tvaluelist m_LastParsed; | 35 | tvaluelist m_LastParsed; |
36 | //! the delemiter to use | 36 | //! the delemiter to use |
37 | QString mDelemiter; | 37 | QString mDelemiter; |
38 | //! the inner delemiter | 38 | //! the inner delemiter |
39 | QString m2Delemiter; | 39 | QString m2Delemiter; |
40 | //! the real split routine | 40 | //! the real split routine |
41 | void splitit(); | 41 | void splitit(); |
42 | //! the content | 42 | //! the content |
43 | QString m_Command; | 43 | QString m_Command; |
44 | //! constructor | 44 | //! constructor |
45 | ValueExplode(){} | 45 | ValueExplode(){} |
46 | public: | 46 | public: |
47 | //! constructor | 47 | //! constructor |
48 | /*! | 48 | /*! |
49 | * \param aCommand the string to be splitted | 49 | * \param aCommand the string to be splitted |
50 | * \param aDelemiter which sign will be the delemiter character | 50 | * \param aDelemiter which sign will be the delemiter character |
51 | * \param a2Delemiter which sign will delemiter the key-value-pairs between other delemiters | 51 | * \param a2Delemiter which sign will delemiter the key-value-pairs between other delemiters |
52 | */ | 52 | */ |
53 | ValueExplode(const QString&aCommand,const char aDelemiter = '&',const char a2Delemiter='='); | 53 | ValueExplode(const QString&aCommand,const char aDelemiter = '&',const char a2Delemiter='='); |
54 | //! destructor | 54 | //! destructor |
55 | virtual ~ValueExplode(); | 55 | virtual ~ValueExplode(); |
56 | //! assigen operator | 56 | //! assigen operator |
57 | /*! | 57 | /*! |
58 | * \return a list of substrings | 58 | * \return a list of substrings |
59 | */ | 59 | */ |
60 | operator const tvaluelist& (){return m_LastParsed;} | 60 | operator const tvaluelist& (){return m_LastParsed;} |
61 | }; | 61 | }; |
62 | 62 | ||
63 | ValueExplode::~ValueExplode() | 63 | ValueExplode::~ValueExplode() |
64 | { | 64 | { |
65 | } | 65 | } |
66 | 66 | ||
67 | ValueExplode::ValueExplode(const QString&aCommand,const char aDelemiter,const char a2Delemiter) | 67 | ValueExplode::ValueExplode(const QString&aCommand,const char aDelemiter,const char a2Delemiter) |
68 | :m_LastParsed(),m_Command(aCommand) | 68 | :m_LastParsed(),m_Command(aCommand) |
69 | { | 69 | { |
70 | mDelemiter = aDelemiter; | 70 | mDelemiter = aDelemiter; |
71 | m2Delemiter = a2Delemiter; | 71 | m2Delemiter = a2Delemiter; |
72 | splitit(); | 72 | splitit(); |
73 | } | 73 | } |
74 | 74 | ||
75 | void ValueExplode::splitit() | 75 | void ValueExplode::splitit() |
76 | { | 76 | { |
77 | QString iLine; | 77 | QString iLine; |
78 | m_LastParsed.clear(); | 78 | m_LastParsed.clear(); |
79 | if (mDelemiter.isEmpty()||m2Delemiter.isEmpty()) { | 79 | if (mDelemiter.isEmpty()||m2Delemiter.isEmpty()) { |
80 | m_LastParsed.append(tkeyvalues(m_Command,"")); | 80 | m_LastParsed.append(tkeyvalues(m_Command,"")); |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | int pos,pos2,startpos; | 83 | int pos,pos2; |
84 | startpos = 0; | 84 | unsigned startpos = 0; |
85 | iLine = m_Command; | 85 | iLine = m_Command; |
86 | while ( (pos = iLine.find(mDelemiter,startpos))!=-1) { | 86 | while ( (pos = iLine.find(mDelemiter,startpos))!=-1) { |
87 | pos2 = iLine.find(m2Delemiter,startpos); | 87 | pos2 = iLine.find(m2Delemiter,startpos); |
88 | if (pos2==-1||pos2>pos) { | 88 | if (pos2==-1||pos2>pos) { |
89 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos-startpos),"")); | 89 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos-startpos),"")); |
90 | } else { | 90 | } else { |
91 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1,pos-pos2-1))); | 91 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1,pos-pos2-1))); |
92 | } | 92 | } |
93 | startpos = pos+1; | 93 | startpos = pos+1; |
94 | } | 94 | } |
95 | if (startpos<iLine.length()) { | 95 | if (startpos<iLine.length()) { |
96 | pos2 = iLine.find(m2Delemiter,startpos); | 96 | pos2 = iLine.find(m2Delemiter,startpos); |
97 | if (pos2==-1) { | 97 | if (pos2==-1) { |
98 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos),"")); | 98 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos),"")); |
99 | } else { | 99 | } else { |
100 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1))); | 100 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1))); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) | 105 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) |
106 | : MainWindow( parent, name, WStyle_ContextHelp ) | 106 | : MainWindow( parent, name, WStyle_ContextHelp ) |
107 | { | 107 | { |
108 | setup_signalblocking(); | 108 | setup_signalblocking(); |
109 | settings = new Settings(); | 109 | settings = new Settings(); |
110 | folderView->populate( settings->getAccounts() ); | 110 | folderView->populate( settings->getAccounts() ); |
111 | } | 111 | } |
112 | 112 | ||
113 | OpieMail::~OpieMail() | 113 | OpieMail::~OpieMail() |
114 | { | 114 | { |
115 | if (settings) delete settings; | 115 | if (settings) delete settings; |
116 | } | 116 | } |
117 | 117 | ||
118 | void OpieMail::setup_signalblocking() | 118 | void OpieMail::setup_signalblocking() |
119 | { | 119 | { |
120 | /* for networking we must block SIGPIPE and Co. */ | 120 | /* for networking we must block SIGPIPE and Co. */ |
121 | struct sigaction blocking_action,temp_action; | 121 | struct sigaction blocking_action,temp_action; |
122 | blocking_action.sa_handler = SIG_IGN; | 122 | blocking_action.sa_handler = SIG_IGN; |
123 | sigemptyset(&(blocking_action.sa_mask)); | 123 | sigemptyset(&(blocking_action.sa_mask)); |
124 | blocking_action.sa_flags = 0; | 124 | blocking_action.sa_flags = 0; |
125 | sigaction(SIGPIPE,&blocking_action,&temp_action); | 125 | sigaction(SIGPIPE,&blocking_action,&temp_action); |
126 | } | 126 | } |
127 | 127 | ||
128 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 128 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
129 | { | 129 | { |
130 | // copied from old mail2 | 130 | // copied from old mail2 |
131 | if (msg == "writeMail(QString,QString)") | 131 | if (msg == "writeMail(QString,QString)") |
132 | { | 132 | { |