tools/linguist/shared/translatormessage.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   107             if (!trans.isEmpty())
   107             if (!trans.isEmpty())
   108                 return true;
   108                 return true;
   109         return false;
   109         return false;
   110     }
   110     }
   111 
   111 
   112     bool operator==(const TranslatorMessage& m) const;
       
   113     bool operator<(const TranslatorMessage& m) const;
       
   114 
       
   115     QString fileName() const { return m_fileName; }
   112     QString fileName() const { return m_fileName; }
   116     void setFileName(const QString &fileName) { m_fileName = fileName; }
   113     void setFileName(const QString &fileName) { m_fileName = fileName; }
   117     int lineNumber() const { return m_lineNumber; }
   114     int lineNumber() const { return m_lineNumber; }
   118     void setLineNumber(int lineNumber) { m_lineNumber = lineNumber; }
   115     void setLineNumber(int lineNumber) { m_lineNumber = lineNumber; }
   119     void clearReferences();
   116     void clearReferences();
   175     bool m_plural;
   172     bool m_plural;
   176 };
   173 };
   177 
   174 
   178 Q_DECLARE_TYPEINFO(TranslatorMessage, Q_MOVABLE_TYPE);
   175 Q_DECLARE_TYPEINFO(TranslatorMessage, Q_MOVABLE_TYPE);
   179 
   176 
   180 int qHash(const TranslatorMessage &msg);
       
   181 
       
   182 struct TranslatorMessagePtr {
       
   183     TranslatorMessagePtr(const TranslatorMessage &tm)
       
   184     {
       
   185         ptr = &tm;
       
   186     }
       
   187 
       
   188     inline const TranslatorMessage *operator->() const
       
   189     {
       
   190         return ptr;
       
   191     }
       
   192 
       
   193     const TranslatorMessage *ptr;
       
   194 };
       
   195 
       
   196 Q_DECLARE_TYPEINFO(TranslatorMessagePtr, Q_MOVABLE_TYPE);
       
   197 
       
   198 inline int qHash(TranslatorMessagePtr tmp)
       
   199 {
       
   200     return qHash(*tmp.ptr);
       
   201 }
       
   202 
       
   203 inline bool operator==(TranslatorMessagePtr tmp1, TranslatorMessagePtr tmp2)
       
   204 {
       
   205     return *tmp1.ptr == *tmp2.ptr;
       
   206 }
       
   207 
       
   208 QT_END_NAMESPACE
   177 QT_END_NAMESPACE
   209 
   178 
   210 #endif // QT_NO_TRANSLATION
   179 #endif // QT_NO_TRANSLATION
   211 
   180 
   212 #endif // TRANSLATORMESSAGE_H
   181 #endif // TRANSLATORMESSAGE_H