Changeset 229 for trunk/src/corelib
- Timestamp:
- Oct 16, 2009, 1:19:40 AM (16 years ago)
- Location:
- trunk/src/corelib/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qsettings_os2.cpp
r63 r229 677 677 } 678 678 679 680 681 682 683 684 685 686 679 687 switch (dataType) { 680 688 case REG_EXPAND_SZ: … … 685 693 s = QString::fromUtf16(((const ushort*)data.constData())); 686 694 }, { 687 s = QString::fromL ocal8Bit(data.constData());695 s = QString::fromL(data.constData()); 688 696 } ); 689 697 } … … 723 731 s = QString::fromUtf16((const ushort*)data.constData(), data.size()/2); 724 732 }, { 725 s = QString::fromL ocal8Bit(data.constData(), data.size());733 s = QString::fromL(data.constData(), data.size()); 726 734 } ); 727 735 } … … 876 884 QByteArray regValueBuff; 877 885 886 887 888 889 890 891 892 893 878 894 // Determine the type 879 895 switch (value.type()) { … … 897 913 regValueBuff = QByteArray((const char*)s.utf16(), s.length()*2); 898 914 }, { 899 regValueBuff = QByteArray((const char*)s.toL ocal8Bit(), s.length());915 regValueBuff = QByteArray((const char*)s.toL(), s.length()); 900 916 } ); 901 917 } else { … … 906 922 regValueBuff += QByteArray((const char*)s.utf16(), (s.length() + 1)*2); 907 923 }, { 908 regValueBuff += QByteArray((const char*)s.toL ocal8Bit(), s.length() + 1);924 regValueBuff += QByteArray((const char*)s.toL(), s.length() + 1); 909 925 } ); 910 926 } … … 926 942 } 927 943 928 case QVariant::ByteArray:929 // fallthrough intended930 931 944 default: { 932 945 // If the string does not contain '\0', we can use REG_SZ, the native registry … … 938 951 regValueBuff = QByteArray((const char*)s.utf16(), s.length()*2); 939 952 }, { 940 regValueBuff = QByteArray((const char*)s.toL ocal8Bit(), s.length());953 regValueBuff = QByteArray((const char*)s.toL(), s.length()); 941 954 } ); 942 955 } else { … … 944 957 regValueBuff = QByteArray((const char*)s.utf16(), (s.length() + 1)*2); 945 958 }, { 946 regValueBuff = QByteArray((const char*)s.toL ocal8Bit(), s.length() + 1);959 regValueBuff = QByteArray((const char*)s.toL(), s.length() + 1); 947 960 } ); 948 961 } -
trunk/src/corelib/io/qsettings_win.cpp
r2 r229 545 545 } 546 546 547 548 549 550 551 552 553 554 547 555 switch (dataType) { 548 556 case REG_EXPAND_SZ: … … 553 561 s = QString::fromUtf16(((const ushort*)data.constData())); 554 562 }, { 555 s = QString::fromL ocal8Bit(data.constData());563 s = QString::fromL(data.constData()); 556 564 } ); 557 565 } … … 591 599 s = QString::fromUtf16((const ushort*)data.constData(), data.size()/2); 592 600 }, { 593 s = QString::fromL ocal8Bit(data.constData(), data.size());601 s = QString::fromL(data.constData(), data.size()); 594 602 } ); 595 603 } … … 634 642 if (deleteWriteHandleOnExit && writeHandle() != 0) { 635 643 #if defined(Q_OS_WINCE) 636 remove(regList.at(0).key()); 644 remove(regList.at(0).key()); 637 645 #else 638 646 DWORD res; … … 744 752 QByteArray regValueBuff; 745 753 754 755 756 757 758 759 760 761 746 762 // Determine the type 747 763 switch (value.type()) { … … 765 781 regValueBuff = QByteArray((const char*)s.utf16(), s.length()*2); 766 782 }, { 767 regValueBuff = QByteArray((const char*)s.toL ocal8Bit(), s.length());783 regValueBuff = QByteArray((const char*)s.toL(), s.length()); 768 784 } ); 769 785 } else { … … 774 790 regValueBuff += QByteArray((const char*)s.utf16(), (s.length() + 1)*2); 775 791 }, { 776 regValueBuff += QByteArray((const char*)s.toL ocal8Bit(), s.length() + 1);792 regValueBuff += QByteArray((const char*)s.toL(), s.length() + 1); 777 793 } ); 778 794 } … … 794 810 } 795 811 796 case QVariant::ByteArray:797 // On Win95/98/Me QString::toLocal8Bit() fails to handle chars > 0x7F. So we don't go through variantToString() at all.798 if (QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) {799 QByteArray ba = value.toByteArray();800 regValueBuff = "@ByteArray(";801 regValueBuff += ba;802 regValueBuff += ')';803 if (ba.contains('\0')) {804 type = REG_BINARY;805 } else {806 type = REG_SZ;807 regValueBuff += '\0';808 }809 810 break;811 }812 // fallthrough intended813 814 812 default: { 815 813 // If the string does not contain '\0', we can use REG_SZ, the native registry … … 821 819 regValueBuff = QByteArray((const char*)s.utf16(), s.length()*2); 822 820 }, { 823 regValueBuff = QByteArray((const char*)s.toL ocal8Bit(), s.length());821 regValueBuff = QByteArray((const char*)s.toL(), s.length()); 824 822 } ); 825 823 } else { … … 827 825 regValueBuff = QByteArray((const char*)s.utf16(), (s.length() + 1)*2); 828 826 }, { 829 regValueBuff = QByteArray((const char*)s.toL ocal8Bit(), s.length() + 1);827 regValueBuff = QByteArray((const char*)s.toL(), s.length() + 1); 830 828 } ); 831 829 }
Note:
See TracChangeset
for help on using the changeset viewer.