- Timestamp:
- Nov 24, 2009, 3:02:54 PM (16 years ago)
- Location:
- trunk/src/gui/kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qmime.h
r338 r347 142 142 143 143 static ULONG registerMimeType(const QString &mime); 144 static void unregisterMimeType(ULONG mimeId); 144 145 145 146 static ULONG allocateMemory(size_t size); -
trunk/src/gui/kernel/qmime_pm.cpp
r344 r347 169 169 170 170 /*! 171 Unregisters the MIME type identified by \a id which was previously 172 registered with registerMimeType(). 173 */ 174 // static 175 void QPMMime::unregisterMimeType(ULONG mimeId) 176 { 177 WinDeleteAtom(WinQuerySystemAtomTable(), mimeId); 178 } 179 180 /*! 171 181 Allocates a block of shared memory of the given size and returns the address 172 182 of this block. This memory block may be then filled with data and returned … … 366 376 public: 367 377 QPMMimeText(); 378 ~QPMMimeText(); 368 379 369 380 // for converting from Qt … … 388 399 , CF_TextHtml (registerMimeType(QLatin1String("text/html"))) 389 400 { 401 } 402 403 QPMMimeText::~QPMMimeText() 404 { 405 unregisterMimeType(CF_TextHtml); 406 unregisterMimeType(CF_TextUnicode); 390 407 } 391 408 … … 645 662 public: 646 663 QPMMimeAnyMime(); 664 ~QPMMimeAnyMime(); 647 665 648 666 // for converting from Qt … … 692 710 } 693 711 712 QPMMimeAnyMime::~QPMMimeAnyMime() 713 { 714 foreach(ULONG cf, cfMap.values()) 715 unregisterMimeType(cf); 716 } 717 694 718 QList<QPMMime::MimeCFPair> QPMMimeAnyMime::formatsForMimeData(const QMimeData *mimeData) const 695 719 { … … 819 843 if (atomStr.startsWith(mimePrefix)) { 820 844 // the format represents the mime type we can recognize 845 // increase the reference count 846 ULONG cf = QPMMime::registerMimeType(atomStr); 847 Q_ASSERT(cf == format); 848 // extract the real mime type (w/o our prefix) 821 849 mime = atomStr.mid(mimePrefix.size()); 822 850 if (!mime.isEmpty()) { 823 cfMap[mime] = format;824 mimeMap[ format] = mime;851 cfMap[mime] = cf; 852 mimeMap[cf] = mime; 825 853 } 826 854 }
Note:
See TracChangeset
for help on using the changeset viewer.