# HG changeset patch # User SokoL_SD # Date 1247562807 0 # Node ID aeeaae4dd54047c650e065882251ce1c85dea74f # Parent 3dadfee974216bbd4e0e588ccde3aa558a3a0358 'Dropsite' fixes for d2. diff -r 3dadfee97421 -r aeeaae4dd540 examples/draganddrop/dropsite/droparea.d --- a/examples/draganddrop/dropsite/droparea.d Mon Jul 13 23:35:23 2009 +0000 +++ b/examples/draganddrop/dropsite/droparea.d Tue Jul 14 09:13:27 2009 +0000 @@ -43,9 +43,6 @@ import qt.gui.QLabel; -import tango.io.Stdout; - - class DropArea : public QLabel { public: @@ -107,7 +104,7 @@ setTextFormat(Qt.PlainText); } else if (mimeData.hasUrls()) { QUrl[] urlList = mimeData.urls(); - char[] text; + string text; for (int i = 0; i < urlList.length && i < 32; ++i) { text ~= urlList[i].path() ~ "\n"; } diff -r 3dadfee97421 -r aeeaae4dd540 examples/draganddrop/dropsite/dropsitewindow.d --- a/examples/draganddrop/dropsite/dropsitewindow.d Mon Jul 13 23:35:23 2009 +0000 +++ b/examples/draganddrop/dropsite/dropsitewindow.d Tue Jul 14 09:13:27 2009 +0000 @@ -47,6 +47,7 @@ import tango.text.convert.Format: format = Format; } else { import std.string; + alias strip trim; } import qt.gui.QWidget; @@ -75,7 +76,7 @@ dropArea = new DropArea; dropArea.changed.connect(&updateFormatsTable); - char[][] labels; + string[] labels; labels ~= tr("Format"); labels ~= tr("Content"); @@ -112,12 +113,12 @@ if (!mimeData) return; - foreach (char[] format; mimeData.formats()) { + foreach (string format; mimeData.formats()) { QTableWidgetItem formatItem = new QTableWidgetItem(format); formatItem.setFlags(Qt.ItemIsEnabled); formatItem.setTextAlignment(Qt.AlignTop | Qt.AlignLeft); - char[] text; + string text; if (format == "text/plain") { text = trim(mimeData.text()); } else if (format == "text/html") { @@ -125,13 +126,16 @@ } else if (format == "text/uri-list") { QUrl[] urlList = mimeData.urls(); for (int i = 0; i < urlList.length && i < 32; ++i) { - char[] url = urlList[i].path(); + string url = urlList[i].path(); text ~= url ~ " "; } } else { QByteArray data = mimeData.data(format); for (int i = 0; i < data.size() && i < 32; ++i) { - char[] hex = toUpper(Format("{0:x}", data.at(i))); + version(Tango) + string hex = toUupper(Format("{0:x}", data.at(i))); + else + string hex = toupper(std.string.format("%x", data.at(i))); text ~= hex ~ " "; } } diff -r 3dadfee97421 -r aeeaae4dd540 examples/draganddrop/dropsite/main.d --- a/examples/draganddrop/dropsite/main.d Mon Jul 13 23:35:23 2009 +0000 +++ b/examples/draganddrop/dropsite/main.d Tue Jul 14 09:13:27 2009 +0000 @@ -42,7 +42,7 @@ import qt.gui.QApplication; import dropsitewindow; -int main(char[][] args) +int main(string[] args) { scope app = new QApplication(args); scope window = new DropSiteWindow;